From cd5cbf228aade86e14dd41d79dbfdc07788f709f Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Wed, 17 Apr 2024 00:26:54 +0200 Subject: [PATCH] fix wiring --- app/app.go | 1 + x/auction/module/module.go | 25 +++++++++---------------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/app/app.go b/app/app.go index ee0fb607c9..5351dff11f 100644 --- a/app/app.go +++ b/app/app.go @@ -510,6 +510,7 @@ func New( app.AuctionKeeperB = auctionkeeper.NewBuilder( appCodec, keys[auction.StoreKey], + auctionmodule.SubAccounts(), app.BankKeeper, app.UGovKeeperB.EmergencyGroup, ) diff --git a/x/auction/module/module.go b/x/auction/module/module.go index 27cf949d16..e339254425 100644 --- a/x/auction/module/module.go +++ b/x/auction/module/module.go @@ -29,13 +29,7 @@ var ( // AppModuleBasic implements the AppModuleBasic interface for the x/leverage // module. -type AppModuleBasic struct { - cdc codec.Codec -} - -func NewAppModuleBasic(cdc codec.Codec) AppModuleBasic { - return AppModuleBasic{cdc: cdc} -} +type AppModuleBasic struct{} // Name returns the x/auction module's name. func (AppModuleBasic) Name() string { @@ -109,7 +103,7 @@ func NewAppModule( cdc codec.Codec, keeper keeper.Builder, bk auction.BankKeeper, ) AppModule { return AppModule{ - AppModuleBasic: NewAppModuleBasic(cdc), + AppModuleBasic: AppModuleBasic{}, kb: keeper, bankKeeper: bk, } @@ -165,12 +159,11 @@ var ( subaccRewardsBid = []byte{0x02} ) -// RewardsAccount returns address of an account holding rewards for auction -func (am AppModule) RewardsAccount() []byte { - return address.Module(am.Name(), subaccRewards) -} - -// RewardsAccount returns address holding auction bid -func (am AppModule) RewardsAccountBid() []byte { - return address.Module(am.Name(), subaccRewardsBid) +// SubAccounts for auction Keeper +func SubAccounts() keeper.SubAccounts { + n := AppModuleBasic{}.Name() + return keeper.SubAccounts{ + Rewards: address.Module(n, subaccRewards), + RewardsBid: address.Module(n, subaccRewardsBid), + } }