mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-03 01:41:44 +00:00
(no commit message provided)
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
package module
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
|
||||
|
||||
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
|
||||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
||||
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
|
||||
|
||||
"cosmossdk.io/core/address"
|
||||
"cosmossdk.io/core/appmodule"
|
||||
"cosmossdk.io/core/store"
|
||||
"cosmossdk.io/depinject"
|
||||
"cosmossdk.io/log"
|
||||
|
||||
modulev1 "github.com/onsonr/hway/api/did/module/v1"
|
||||
"github.com/onsonr/hway/x/did/keeper"
|
||||
)
|
||||
|
||||
var _ appmodule.AppModule = AppModule{}
|
||||
|
||||
// IsOnePerModuleType implements the depinject.OnePerModuleType interface.
|
||||
func (am AppModule) IsOnePerModuleType() {}
|
||||
|
||||
// IsAppModule implements the appmodule.AppModule interface.
|
||||
func (am AppModule) IsAppModule() {}
|
||||
|
||||
func init() {
|
||||
appmodule.Register(
|
||||
&modulev1.Module{},
|
||||
appmodule.Provide(ProvideModule),
|
||||
)
|
||||
}
|
||||
|
||||
type ModuleInputs struct {
|
||||
depinject.In
|
||||
|
||||
Cdc codec.Codec
|
||||
StoreService store.KVStoreService
|
||||
AddressCodec address.Codec
|
||||
|
||||
AccountKeeper authkeeper.AccountKeeper
|
||||
StakingKeeper stakingkeeper.Keeper
|
||||
SlashingKeeper slashingkeeper.Keeper
|
||||
}
|
||||
|
||||
type ModuleOutputs struct {
|
||||
depinject.Out
|
||||
|
||||
Module appmodule.AppModule
|
||||
Keeper keeper.Keeper
|
||||
}
|
||||
|
||||
func ProvideModule(in ModuleInputs) ModuleOutputs {
|
||||
govAddr := authtypes.NewModuleAddress(govtypes.ModuleName).String()
|
||||
|
||||
k := keeper.NewKeeper(in.Cdc, in.StoreService, in.AccountKeeper, log.NewLogger(os.Stderr), govAddr)
|
||||
m := NewAppModule(in.Cdc, k)
|
||||
|
||||
return ModuleOutputs{Module: m, Keeper: k, Out: depinject.Out{}}
|
||||
}
|
||||
Reference in New Issue
Block a user