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: stakingplus should implement AppmoduleSimulation to run TestAppStateDeterminism #1265

Closed
Closed
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 CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
### Bug Fixes
* chore(deps) [\#1141](https://github.com/Finschia/finschia-sdk/pull/1141) Bump github.com/cosmos/ledger-cosmos-go from 0.12.2 to 0.13.2 to fix ledger signing issue
* (x/auth, x/slashing) [\#1179](https://github.com/Finschia/finschia-sdk/pull/1179) modify missing changes of converting to tendermint
* (x/stakingplus) [\#1265](https://github.com/Finschia/finschia-sdk/pull/1265) implement `module.AppModuleSimulation` for `TestAppStateDeterminism`

### Removed

Expand Down
24 changes: 19 additions & 5 deletions x/stakingplus/module/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"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 +30,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 +65,18 @@ type AppModule struct {
ls exported.Subspace
}

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

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

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
Loading