Prathamesh Musale
213c390c37
Some checks failed
Integration Tests / test-integration (push) Successful in 2m48s
E2E Tests / test-e2e (push) Successful in 4m56s
Lint / Run golangci-lint (push) Successful in 5m6s
Unit Tests / test-unit (push) Successful in 3m22s
SDK Tests / sdk_tests_nameservice_expiry (push) Successful in 10m40s
SDK Tests / sdk_tests (push) Successful in 10m55s
SDK Tests / sdk_tests_auctions (push) Failing after 16m7s
Part of https://www.notion.so/Rename-laconic2d-to-laconicd-9028d0c020d24d1288e92ebcb773d7a7 Co-authored-by: neeraj <neeraj.rtly@gmail.com> Reviewed-on: cerc-io/laconic2d#26 Co-authored-by: Prathamesh Musale <prathamesh@noreply.git.vdb.to> Co-committed-by: Prathamesh Musale <prathamesh@noreply.git.vdb.to>
77 lines
1.8 KiB
Go
77 lines
1.8 KiB
Go
package module
|
|
|
|
import (
|
|
"cosmossdk.io/core/appmodule"
|
|
"cosmossdk.io/core/store"
|
|
"cosmossdk.io/depinject"
|
|
|
|
"github.com/cosmos/cosmos-sdk/codec"
|
|
auth "github.com/cosmos/cosmos-sdk/x/auth/keeper"
|
|
bank "github.com/cosmos/cosmos-sdk/x/bank/keeper"
|
|
|
|
modulev1 "git.vdb.to/cerc-io/laconicd/api/cerc/registry/module/v1"
|
|
"git.vdb.to/cerc-io/laconicd/x/auction"
|
|
auctionkeeper "git.vdb.to/cerc-io/laconicd/x/auction/keeper"
|
|
"git.vdb.to/cerc-io/laconicd/x/bond"
|
|
bondkeeper "git.vdb.to/cerc-io/laconicd/x/bond/keeper"
|
|
"git.vdb.to/cerc-io/laconicd/x/registry/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
|
|
|
|
AccountKeeper auth.AccountKeeper
|
|
BankKeeper bank.Keeper
|
|
|
|
BondKeeper *bondkeeper.Keeper
|
|
AuctionKeeper *auctionkeeper.Keeper
|
|
}
|
|
|
|
type ModuleOutputs struct {
|
|
depinject.Out
|
|
|
|
Keeper keeper.Keeper
|
|
Module appmodule.AppModule
|
|
|
|
AuctionHooks auction.AuctionHooksWrapper
|
|
BondHooks bond.BondHooksWrapper
|
|
}
|
|
|
|
func ProvideModule(in ModuleInputs) ModuleOutputs {
|
|
k := keeper.NewKeeper(
|
|
in.Cdc,
|
|
in.StoreService,
|
|
in.AccountKeeper,
|
|
in.BankKeeper,
|
|
in.BondKeeper,
|
|
in.AuctionKeeper,
|
|
)
|
|
m := NewAppModule(in.Cdc, k)
|
|
|
|
recordKeeper := keeper.NewRecordKeeper(in.Cdc, &k, in.AuctionKeeper)
|
|
|
|
return ModuleOutputs{
|
|
Module: m, Keeper: k,
|
|
AuctionHooks: auction.AuctionHooksWrapper{AuctionUsageKeeper: recordKeeper},
|
|
BondHooks: bond.BondHooksWrapper{BondUsageKeeper: recordKeeper},
|
|
}
|
|
}
|