2024-02-01 04:48:40 +00:00
|
|
|
package module
|
2024-02-01 10:58:34 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"cosmossdk.io/core/appmodule"
|
2024-02-02 09:39:10 +00:00
|
|
|
"cosmossdk.io/core/store"
|
2024-02-01 10:58:34 +00:00
|
|
|
"cosmossdk.io/depinject"
|
|
|
|
|
|
|
|
"github.com/cosmos/cosmos-sdk/codec"
|
2024-02-02 09:39:10 +00:00
|
|
|
auth "github.com/cosmos/cosmos-sdk/x/auth/keeper"
|
|
|
|
bank "github.com/cosmos/cosmos-sdk/x/bank/keeper"
|
2024-02-01 10:58:34 +00:00
|
|
|
|
|
|
|
modulev1 "git.vdb.to/cerc-io/laconic2d/api/cerc/bond/module/v1"
|
|
|
|
"git.vdb.to/cerc-io/laconic2d/x/bond/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
|
|
|
|
|
2024-02-02 09:39:10 +00:00
|
|
|
Cdc codec.Codec
|
|
|
|
StoreService store.KVStoreService
|
|
|
|
|
|
|
|
AccountKeeper auth.AccountKeeper
|
|
|
|
BankKeeper bank.Keeper
|
2024-02-01 10:58:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type ModuleOutputs struct {
|
|
|
|
depinject.Out
|
|
|
|
|
|
|
|
Keeper keeper.Keeper
|
|
|
|
Module appmodule.AppModule
|
|
|
|
}
|
|
|
|
|
|
|
|
func ProvideModule(in ModuleInputs) ModuleOutputs {
|
2024-02-02 09:39:10 +00:00
|
|
|
k := keeper.NewKeeper(in.Cdc, in.StoreService, in.AccountKeeper, in.BankKeeper)
|
2024-02-01 10:58:34 +00:00
|
|
|
m := NewAppModule(in.Cdc, k)
|
|
|
|
|
|
|
|
return ModuleOutputs{Module: m, Keeper: k}
|
|
|
|
}
|