Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add get module account to genesis #113

Merged
merged 2 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions testing/simapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ func NewSimApp(
// why the pointer
app.MultiStakingKeeper = *multistakingkeeper.NewKeeper(
appCodec,
app.AccountKeeper,
app.StakingKeeper,
app.BankKeeper,
keys[multistakingtypes.StoreKey],
Expand Down
2 changes: 2 additions & 0 deletions x/multi-staking/keeper/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState) (res []abc
k.SetValidatorMultiStakingCoin(ctx, valAddr, valMultiStakingCoin.CoinDenom)
}

k.accountKeeper.GetModuleAccount(ctx, types.ModuleName)

return k.stakingKeeper.InitGenesis(ctx, &data.StakingGenesisState)
}

Expand Down
3 changes: 3 additions & 0 deletions x/multi-staking/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,22 @@ import (
type Keeper struct {
storeKey storetypes.StoreKey
cdc codec.BinaryCodec
accountKeeper types.AccountKeeper
stakingKeeper stakingkeeper.Keeper
bankKeeper types.BankKeeper
}

func NewKeeper(
cdc codec.BinaryCodec,
accountKeeper types.AccountKeeper,
stakingKeeper stakingkeeper.Keeper,
bankKeeper types.BankKeeper,
key storetypes.StoreKey,
) *Keeper {
return &Keeper{
cdc: cdc,
storeKey: key,
accountKeeper: accountKeeper,
stakingKeeper: stakingKeeper,
bankKeeper: bankKeeper,
}
Expand Down
6 changes: 6 additions & 0 deletions x/multi-staking/types/expected_keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ import (
abci "github.com/tendermint/tendermint/abci/types"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
)

type AccountKeeper interface {
GetModuleAddress(moduleName string) sdk.AccAddress
GetModuleAccount(ctx sdk.Context, moduleName string) types.ModuleAccountI
}

type StakingKeeper interface {
DequeueAllMatureUBDQueue(ctx sdk.Context, currTime time.Time) (matureUnbonds []stakingtypes.DVPair)
BondDenom(ctx sdk.Context) (res string)
Expand Down
Loading