Skip to content

Commit

Permalink
fix: stakingplus should implement AppmoduleSimulation in order to run…
Browse files Browse the repository at this point in the history
… TestAppStateDeterminism
  • Loading branch information
jaeseung-bae committed Mar 5, 2024
1 parent 7aaa26e commit 776a61c
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions x/stakingplus/module/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@ import (
"encoding/json"
"fmt"

abci "github.com/cometbft/cometbft/abci/types"

modulev1 "cosmossdk.io/api/cosmos/staking/module/v1"
"cosmossdk.io/core/appmodule"
"cosmossdk.io/core/store"
"cosmossdk.io/depinject"

abci "github.com/cometbft/cometbft/abci/types"
"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/runtime"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
"github.com/cosmos/cosmos-sdk/x/staking"
Expand All @@ -29,11 +28,12 @@ import (
)

var (
_ module.AppModuleBasic = AppModuleBasic{}
_ module.HasServices = AppModule{}
_ module.HasInvariants = AppModule{}
_ module.HasABCIGenesis = AppModule{}
_ module.HasABCIEndBlock = AppModule{}
_ module.AppModuleBasic = AppModuleBasic{}
_ module.HasServices = AppModule{}
_ module.HasInvariants = AppModule{}
_ module.HasABCIGenesis = AppModule{}
_ module.HasABCIEndBlock = AppModule{}
_ module.AppModuleSimulation = AppModule{}

_ appmodule.AppModule = AppModule{}
_ appmodule.HasBeginBlocker = AppModule{}
Expand Down Expand Up @@ -63,6 +63,18 @@ type AppModule struct {
ls exported.Subspace
}

func (am AppModule) GenerateGenesisState(input *module.SimulationState) {
am.impl.GenerateGenesisState(input)
}

func (am AppModule) RegisterStoreDecoder(registry simtypes.StoreDecoderRegistry) {
am.impl.RegisterStoreDecoder(registry)
}

func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation {
return am.impl.WeightedOperations(simState)
}

// NewAppModule creates a new AppModule object
func NewAppModule(cdc codec.Codec, keeper *stakingkeeper.Keeper, ak stakingtypes.AccountKeeper, bk stakingtypes.BankKeeper, fk stakingplus.FoundationKeeper, ls exported.Subspace) AppModule {
impl := staking.NewAppModule(cdc, keeper, ak, bk, ls)
Expand Down

0 comments on commit 776a61c

Please sign in to comment.