From a2eb6309060533622e8e910cdb500f84fe23cbab Mon Sep 17 00:00:00 2001 From: Marko Date: Fri, 13 Jan 2023 18:43:09 +0100 Subject: [PATCH] refactor: remove sdk dep from store (#14603) Co-authored-by: Likhita Polavarapu <78951027+likhita-809@users.noreply.github.com> --- CHANGELOG.md | 1 + baseapp/options.go | 5 ++++- simapp/go.mod | 1 + store/listenkv/store_test.go | 3 ++- store/reexport.go | 1 - store/streaming/constructor.go | 21 +++++++++++++-------- store/streaming/constructor_test.go | 7 +++---- store/tracekv/store_test.go | 3 ++- store/types/store.go | 10 ---------- tests/go.mod | 1 + testutil/sims/simulation_helpers.go | 2 +- testutil/sims/simulation_helpers_test.go | 3 ++- types/module/simulation.go | 7 +++---- types/simulation/types.go | 5 +++++ x/auth/module.go | 2 +- x/authz/module/module.go | 2 +- x/bank/module.go | 2 +- x/capability/module.go | 2 +- x/distribution/module.go | 2 +- x/evidence/module.go | 2 +- x/feegrant/module/module.go | 2 +- x/gov/module.go | 2 +- x/group/module/module.go | 2 +- x/mint/module.go | 2 +- x/nft/module/module.go | 2 +- x/params/module.go | 2 +- x/slashing/module.go | 2 +- x/staking/module.go | 2 +- 28 files changed, 52 insertions(+), 46 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf3820959c19..06b3e59a732a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -213,6 +213,7 @@ extension interfaces. `module.Manager.Modules` is now of type `map[string]interf * (x/auth)[#13780](https://github.com/cosmos/cosmos-sdk/pull/13780) Querying with `id` (type of int64) in `AccountAddressByID` grpc query now throws error, use account-id(type of uint64) instead. * (snapshots) [14048](https://github.com/cosmos/cosmos-sdk/pull/14048) Move the Snapshot package to the store package. This is done in an effort group all storage related logic under one package. * (baseapp) [#14050](https://github.com/cosmos/cosmos-sdk/pull/14050) refactor `ABCIListener` interface to accept go contexts +* (store/streaming)[#14603](https://github.com/cosmos/cosmos-sdk/pull/14603) `StoreDecoderRegistry` moved from store to `types/simulations` this breaks the `AppModuleSimulation` interface. ### CLI Breaking Changes diff --git a/baseapp/options.go b/baseapp/options.go index e6e7c5486481..c1ae4b3f61fb 100644 --- a/baseapp/options.go +++ b/baseapp/options.go @@ -5,6 +5,7 @@ import ( "io" dbm "github.com/cosmos/cosmos-db" + "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/codec/types" servertypes "github.com/cosmos/cosmos-sdk/server/types" "github.com/cosmos/cosmos-sdk/store/metrics" @@ -15,6 +16,7 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/mempool" + "github.com/spf13/cast" ) // File for storing in-package BaseApp optional functions, @@ -239,7 +241,8 @@ func (app *BaseApp) SetStreamingService( appCodec storetypes.Codec, keys map[string]*storetypes.KVStoreKey, ) error { - streamers, _, err := streaming.LoadStreamingServices(appOpts, appCodec, app.logger, keys) + homePath := cast.ToString(appOpts.Get(flags.FlagHome)) + streamers, _, err := streaming.LoadStreamingServices(appOpts, appCodec, app.logger, keys, homePath) if err != nil { return err } diff --git a/simapp/go.mod b/simapp/go.mod index 2fe29aa4e680..995533161603 100644 --- a/simapp/go.mod +++ b/simapp/go.mod @@ -188,6 +188,7 @@ replace ( github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 // Simapp always use the latest version of the cosmos-sdk github.com/cosmos/cosmos-sdk => ../. + github.com/cosmos/cosmos-sdk/x/nft => ../x/nft // Fix upstream GHSA-h395-qcrw-5vmq vulnerability. // TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409 github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.8.1 diff --git a/store/listenkv/store_test.go b/store/listenkv/store_test.go index 44bf79612728..c045b2e5fadd 100644 --- a/store/listenkv/store_test.go +++ b/store/listenkv/store_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/cosmos/cosmos-sdk/store/dbadapter" + "github.com/cosmos/cosmos-sdk/store/internal/kv" "github.com/cosmos/cosmos-sdk/store/listenkv" "github.com/cosmos/cosmos-sdk/store/prefix" "github.com/cosmos/cosmos-sdk/store/types" @@ -21,7 +22,7 @@ func bz(s string) []byte { return []byte(s) } func keyFmt(i int) []byte { return bz(fmt.Sprintf("key%0.8d", i)) } func valFmt(i int) []byte { return bz(fmt.Sprintf("value%0.8d", i)) } -var kvPairs = []types.KVPair{ +var kvPairs = []kv.Pair{ {Key: keyFmt(1), Value: valFmt(1)}, {Key: keyFmt(2), Value: valFmt(2)}, {Key: keyFmt(3), Value: valFmt(3)}, diff --git a/store/reexport.go b/store/reexport.go index 5b101b4ac30f..69f46a385f01 100644 --- a/store/reexport.go +++ b/store/reexport.go @@ -13,7 +13,6 @@ type ( CacheMultiStore = types.CacheMultiStore CommitMultiStore = types.CommitMultiStore KVStore = types.KVStore - KVPair = types.KVPair Iterator = types.Iterator CacheKVStore = types.CacheKVStore CommitKVStore = types.CommitKVStore diff --git a/store/streaming/constructor.go b/store/streaming/constructor.go index b44018c96718..a1936e7e64d7 100644 --- a/store/streaming/constructor.go +++ b/store/streaming/constructor.go @@ -7,8 +7,6 @@ import ( "strings" "sync" - "github.com/cosmos/cosmos-sdk/client/flags" - serverTypes "github.com/cosmos/cosmos-sdk/server/types" "github.com/cosmos/cosmos-sdk/store/streaming/file" "github.com/cosmos/cosmos-sdk/store/types" "github.com/tendermint/tendermint/libs/log" @@ -16,8 +14,14 @@ import ( "github.com/spf13/cast" ) -// ServiceConstructor is used to construct a streaming service -type ServiceConstructor func(serverTypes.AppOptions, []types.StoreKey, types.Codec, log.Logger) (types.StreamingService, error) +type ( + // AppOptions is an interface for accessing application options + AppOptions interface { + Get(string) interface{} + } + // ServiceConstructor is used to construct a streaming service + ServiceConstructor func(AppOptions, []types.StoreKey, types.Codec, log.Logger, string) (types.StreamingService, error) +) // ServiceType enum for specifying the type of StreamingService type ServiceType int @@ -85,12 +89,12 @@ func NewServiceConstructor(name string) (ServiceConstructor, error) { // NewFileStreamingService is the streaming.ServiceConstructor function for // creating a FileStreamingService. func NewFileStreamingService( - opts serverTypes.AppOptions, + opts AppOptions, keys []types.StoreKey, marshaller types.Codec, logger log.Logger, + homePath string, ) (types.StreamingService, error) { - homePath := cast.ToString(opts.Get(flags.FlagHome)) filePrefix := cast.ToString(opts.Get(OptStreamersFilePrefix)) fileDir := cast.ToString(opts.Get(OptStreamersFileWriteDir)) outputMetadata := cast.ToBool(opts.Get(OptStreamersFileOutputMetadata)) @@ -117,10 +121,11 @@ func NewFileStreamingService( // WaitGroup and quit channel used to synchronize with the streaming services // and any error that occurs during the setup. func LoadStreamingServices( - appOpts serverTypes.AppOptions, + appOpts AppOptions, appCodec types.Codec, logger log.Logger, keys map[string]*types.KVStoreKey, + homePath string, ) ([]types.StreamingService, *sync.WaitGroup, error) { // waitgroup and quit channel for optional shutdown coordination of the streaming service(s) wg := new(sync.WaitGroup) @@ -167,7 +172,7 @@ func LoadStreamingServices( // Generate the streaming service using the constructor, appOptions, and the // StoreKeys we want to expose. - streamingService, err := constructor(appOpts, exposeStoreKeys, appCodec, logger) + streamingService, err := constructor(appOpts, exposeStoreKeys, appCodec, logger, homePath) if err != nil { // Close any services we may have already spun up before hitting the error // on this one. diff --git a/store/streaming/constructor_test.go b/store/streaming/constructor_test.go index 3f6b033a8198..279dedb9e003 100644 --- a/store/streaming/constructor_test.go +++ b/store/streaming/constructor_test.go @@ -6,7 +6,6 @@ import ( "github.com/stretchr/testify/require" "github.com/tendermint/tendermint/libs/log" - serverTypes "github.com/cosmos/cosmos-sdk/server/types" "github.com/cosmos/cosmos-sdk/store/streaming" "github.com/cosmos/cosmos-sdk/store/streaming/file" "github.com/cosmos/cosmos-sdk/store/types" @@ -36,7 +35,7 @@ func TestStreamingServiceConstructor(t *testing.T) { var expectedType streaming.ServiceConstructor require.IsType(t, expectedType, constructor) - serv, err := constructor(mockOptions, mockKeys, testMarshaller, log.NewNopLogger()) + serv, err := constructor(mockOptions, mockKeys, testMarshaller, log.NewNopLogger(), "path/to/data") require.Nil(t, err) require.IsType(t, &file.StreamingService{}, serv) listeners := serv.Listeners() @@ -51,7 +50,7 @@ func TestLoadStreamingServices(t *testing.T) { keys := types.NewKVStoreKeys("mockKey1", "mockKey2") testCases := map[string]struct { - appOpts serverTypes.AppOptions + appOpts streaming.AppOptions activeStreamersLen int }{ "empty app options": { @@ -72,7 +71,7 @@ func TestLoadStreamingServices(t *testing.T) { for name, tc := range testCases { t.Run(name, func(t *testing.T) { - activeStreamers, _, err := streaming.LoadStreamingServices(tc.appOpts, encCdc, log.NewNopLogger(), keys) + activeStreamers, _, err := streaming.LoadStreamingServices(tc.appOpts, encCdc, log.NewNopLogger(), keys, "path/to/data") require.NoError(t, err) require.Equal(t, tc.activeStreamersLen, len(activeStreamers)) }) diff --git a/store/tracekv/store_test.go b/store/tracekv/store_test.go index dfe1751f52fd..c0c9c72d85f4 100644 --- a/store/tracekv/store_test.go +++ b/store/tracekv/store_test.go @@ -11,6 +11,7 @@ import ( dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/store/dbadapter" + "github.com/cosmos/cosmos-sdk/store/internal/kv" "github.com/cosmos/cosmos-sdk/store/prefix" "github.com/cosmos/cosmos-sdk/store/tracekv" "github.com/cosmos/cosmos-sdk/store/types" @@ -21,7 +22,7 @@ func bz(s string) []byte { return []byte(s) } func keyFmt(i int) []byte { return bz(fmt.Sprintf("key%0.8d", i)) } func valFmt(i int) []byte { return bz(fmt.Sprintf("value%0.8d", i)) } -var kvPairs = []types.KVPair{ +var kvPairs = []kv.Pair{ {Key: keyFmt(1), Value: valFmt(1)}, {Key: keyFmt(2), Value: valFmt(2)}, {Key: keyFmt(3), Value: valFmt(3)}, diff --git a/store/types/store.go b/store/types/store.go index 3bd6563ea0a3..7c462591a365 100644 --- a/store/types/store.go +++ b/store/types/store.go @@ -10,7 +10,6 @@ import ( "github.com/cosmos/cosmos-sdk/store/metrics" pruningtypes "github.com/cosmos/cosmos-sdk/store/pruning/types" snapshottypes "github.com/cosmos/cosmos-sdk/store/snapshots/types" - "github.com/cosmos/cosmos-sdk/types/kv" ) type Store interface { @@ -433,11 +432,6 @@ func (key *MemoryStoreKey) String() string { //---------------------------------------- -// key-value result for iterator queries -type KVPair kv.Pair - -//---------------------------------------- - // TraceContext contains TraceKVStore context data. It will be written with // every trace operation. type TraceContext map[string]interface{} @@ -514,7 +508,3 @@ func NewMemoryStoreKeys(names ...string) map[string]*MemoryStoreKey { return keys } - -// StoreDecoderRegistry defines each of the modules store decoders. Used for ImportExport -// simulation. -type StoreDecoderRegistry map[string]func(kvA, kvB kv.Pair) string diff --git a/tests/go.mod b/tests/go.mod index a83ac91a5620..c7c76adef77d 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -184,6 +184,7 @@ replace ( github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 // We always want to test against the latest version of the SDK. github.com/cosmos/cosmos-sdk => ../. + github.com/cosmos/cosmos-sdk/x/nft => ../x/nft // Fix upstream GHSA-h395-qcrw-5vmq vulnerability. // TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409 github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.8.1 diff --git a/testutil/sims/simulation_helpers.go b/testutil/sims/simulation_helpers.go index 6006958ab975..ec6a619450a6 100644 --- a/testutil/sims/simulation_helpers.go +++ b/testutil/sims/simulation_helpers.go @@ -109,7 +109,7 @@ func PrintStats(db dbm.DB) { // GetSimulationLog unmarshals the KVPair's Value to the corresponding type based on the // each's module store key and the prefix bytes of the KVPair's key. -func GetSimulationLog(storeName string, sdr storetypes.StoreDecoderRegistry, kvAs, kvBs []kv.Pair) (log string) { +func GetSimulationLog(storeName string, sdr simtypes.StoreDecoderRegistry, kvAs, kvBs []kv.Pair) (log string) { for i := 0; i < len(kvAs); i++ { if len(kvAs[i].Value) == 0 && len(kvBs[i].Value) == 0 { // skip if the value doesn't have any bytes diff --git a/testutil/sims/simulation_helpers_test.go b/testutil/sims/simulation_helpers_test.go index 7cd8643bbf52..bea17b2ec521 100644 --- a/testutil/sims/simulation_helpers_test.go +++ b/testutil/sims/simulation_helpers_test.go @@ -15,12 +15,13 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" "github.com/cosmos/cosmos-sdk/types/kv" + "github.com/cosmos/cosmos-sdk/types/simulation" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" ) func TestGetSimulationLog(t *testing.T) { legacyAmino := codec.NewLegacyAmino() - decoders := make(storetypes.StoreDecoderRegistry) + decoders := make(simulation.StoreDecoderRegistry) decoders[authtypes.StoreKey] = func(kvAs, kvBs kv.Pair) string { return "10" } tests := []struct { diff --git a/types/module/simulation.go b/types/module/simulation.go index a4494cf5a33e..d742a6639498 100644 --- a/types/module/simulation.go +++ b/types/module/simulation.go @@ -8,7 +8,6 @@ import ( sdkmath "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/codec" - storetypes "github.com/cosmos/cosmos-sdk/store/types" "github.com/cosmos/cosmos-sdk/types/simulation" ) @@ -22,7 +21,7 @@ type AppModuleSimulation interface { ProposalContents(simState SimulationState) []simulation.WeightedProposalContent // register a func to decode the each module's defined types from their corresponding store key - RegisterStoreDecoder(storetypes.StoreDecoderRegistry) + RegisterStoreDecoder(simulation.StoreDecoderRegistry) // simulation operations (i.e msgs) with their respective weight WeightedOperations(simState SimulationState) []simulation.WeightedOperation @@ -32,7 +31,7 @@ type AppModuleSimulation interface { // for managing and executing simulation functionalities for a group of modules type SimulationManager struct { Modules []AppModuleSimulation // array of app modules; we use an array for deterministic simulation tests - StoreDecoders storetypes.StoreDecoderRegistry // functions to decode the key-value pairs from each module's store + StoreDecoders simulation.StoreDecoderRegistry // functions to decode the key-value pairs from each module's store } // NewSimulationManager creates a new SimulationManager object @@ -41,7 +40,7 @@ type SimulationManager struct { func NewSimulationManager(modules ...AppModuleSimulation) *SimulationManager { return &SimulationManager{ Modules: modules, - StoreDecoders: make(storetypes.StoreDecoderRegistry), + StoreDecoders: make(simulation.StoreDecoderRegistry), } } diff --git a/types/simulation/types.go b/types/simulation/types.go index 199f47fa38e2..702e6b2e49ca 100644 --- a/types/simulation/types.go +++ b/types/simulation/types.go @@ -8,6 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/kv" "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" ) @@ -172,3 +173,7 @@ type Params interface { LivenessTransitionMatrix() TransitionMatrix BlockSizeTransitionMatrix() TransitionMatrix } + +// StoreDecoderRegistry defines each of the modules store decoders. Used for ImportExport +// simulation. +type StoreDecoderRegistry map[string]func(kvA, kvB kv.Pair) string diff --git a/x/auth/module.go b/x/auth/module.go index 089d919ec17d..a3dcb33d25c5 100644 --- a/x/auth/module.go +++ b/x/auth/module.go @@ -184,7 +184,7 @@ func (AppModule) ProposalContents(simState module.SimulationState) []simtypes.We } // RegisterStoreDecoder registers a decoder for auth module's types -func (am AppModule) RegisterStoreDecoder(sdr store.StoreDecoderRegistry) { +func (am AppModule) RegisterStoreDecoder(sdr simtypes.StoreDecoderRegistry) { sdr[types.StoreKey] = simulation.NewDecodeStore(am.accountKeeper) } diff --git a/x/authz/module/module.go b/x/authz/module/module.go index f674d16b6cb6..cee8ad3b8666 100644 --- a/x/authz/module/module.go +++ b/x/authz/module/module.go @@ -213,7 +213,7 @@ func (am AppModule) ProposalContents(simState module.SimulationState) []simtypes } // RegisterStoreDecoder registers a decoder for authz module's types -func (am AppModule) RegisterStoreDecoder(sdr store.StoreDecoderRegistry) { +func (am AppModule) RegisterStoreDecoder(sdr simtypes.StoreDecoderRegistry) { sdr[keeper.StoreKey] = simulation.NewDecodeStore(am.cdc) } diff --git a/x/bank/module.go b/x/bank/module.go index f633ae40ecaf..0b7329296423 100644 --- a/x/bank/module.go +++ b/x/bank/module.go @@ -188,7 +188,7 @@ func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedP } // RegisterStoreDecoder registers a decoder for supply module's types -func (am AppModule) RegisterStoreDecoder(_ store.StoreDecoderRegistry) {} +func (am AppModule) RegisterStoreDecoder(_ simtypes.StoreDecoderRegistry) {} // WeightedOperations returns the all the gov module operations with their respective weights. func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { diff --git a/x/capability/module.go b/x/capability/module.go index 99cd79e38d64..7434eba8109c 100644 --- a/x/capability/module.go +++ b/x/capability/module.go @@ -168,7 +168,7 @@ func (am AppModule) ProposalContents(simState module.SimulationState) []simtypes } // RegisterStoreDecoder registers a decoder for capability module's types -func (am AppModule) RegisterStoreDecoder(sdr store.StoreDecoderRegistry) { +func (am AppModule) RegisterStoreDecoder(sdr simtypes.StoreDecoderRegistry) { sdr[types.StoreKey] = simulation.NewDecodeStore(am.cdc) } diff --git a/x/distribution/module.go b/x/distribution/module.go index 2514ef9714ba..f9d09cfd6ee1 100644 --- a/x/distribution/module.go +++ b/x/distribution/module.go @@ -191,7 +191,7 @@ func (am AppModule) ProposalContents(simState module.SimulationState) []simtypes } // RegisterStoreDecoder registers a decoder for distribution module's types -func (am AppModule) RegisterStoreDecoder(sdr store.StoreDecoderRegistry) { +func (am AppModule) RegisterStoreDecoder(sdr simtypes.StoreDecoderRegistry) { sdr[types.StoreKey] = simulation.NewDecodeStore(am.cdc) } diff --git a/x/evidence/module.go b/x/evidence/module.go index 8d684ddd1ce6..6456572355bc 100644 --- a/x/evidence/module.go +++ b/x/evidence/module.go @@ -183,7 +183,7 @@ func (am AppModule) ProposalContents(simState module.SimulationState) []simtypes } // RegisterStoreDecoder registers a decoder for evidence module's types -func (am AppModule) RegisterStoreDecoder(sdr store.StoreDecoderRegistry) { +func (am AppModule) RegisterStoreDecoder(sdr simtypes.StoreDecoderRegistry) { sdr[types.StoreKey] = simulation.NewDecodeStore(am.keeper) } diff --git a/x/feegrant/module/module.go b/x/feegrant/module/module.go index d330d031a280..b2dea8f55e1c 100644 --- a/x/feegrant/module/module.go +++ b/x/feegrant/module/module.go @@ -214,7 +214,7 @@ func (AppModule) ProposalContents(simState module.SimulationState) []simtypes.We } // RegisterStoreDecoder registers a decoder for feegrant module's types -func (am AppModule) RegisterStoreDecoder(sdr store.StoreDecoderRegistry) { +func (am AppModule) RegisterStoreDecoder(sdr simtypes.StoreDecoderRegistry) { sdr[feegrant.StoreKey] = simulation.NewDecodeStore(am.cdc) } diff --git a/x/gov/module.go b/x/gov/module.go index 3fae0e6888d8..7f7b5e7a475e 100644 --- a/x/gov/module.go +++ b/x/gov/module.go @@ -336,7 +336,7 @@ func (AppModule) ProposalContents(simState module.SimulationState) []simtypes.We } // RegisterStoreDecoder registers a decoder for gov module's types -func (am AppModule) RegisterStoreDecoder(sdr store.StoreDecoderRegistry) { +func (am AppModule) RegisterStoreDecoder(sdr simtypes.StoreDecoderRegistry) { sdr[govtypes.StoreKey] = simulation.NewDecodeStore(am.cdc) } diff --git a/x/group/module/module.go b/x/group/module/module.go index 4dda150725a3..3543536ff7f5 100644 --- a/x/group/module/module.go +++ b/x/group/module/module.go @@ -179,7 +179,7 @@ func (am AppModule) ProposalContents(simState module.SimulationState) []simtypes } // RegisterStoreDecoder registers a decoder for group module's types -func (am AppModule) RegisterStoreDecoder(sdr store.StoreDecoderRegistry) { +func (am AppModule) RegisterStoreDecoder(sdr simtypes.StoreDecoderRegistry) { sdr[group.StoreKey] = simulation.NewDecodeStore(am.cdc) } diff --git a/x/mint/module.go b/x/mint/module.go index 46beaa7b16c0..f31eef38f3d5 100644 --- a/x/mint/module.go +++ b/x/mint/module.go @@ -196,7 +196,7 @@ func (AppModule) ProposalContents(simState module.SimulationState) []simtypes.We } // RegisterStoreDecoder registers a decoder for mint module's types. -func (am AppModule) RegisterStoreDecoder(sdr store.StoreDecoderRegistry) { +func (am AppModule) RegisterStoreDecoder(sdr simtypes.StoreDecoderRegistry) { sdr[types.StoreKey] = simulation.NewDecodeStore(am.cdc) } diff --git a/x/nft/module/module.go b/x/nft/module/module.go index 7017bc0fd89d..9fff53f52100 100644 --- a/x/nft/module/module.go +++ b/x/nft/module/module.go @@ -168,7 +168,7 @@ func (am AppModule) ProposalContents(simState module.SimulationState) []simtypes } // RegisterStoreDecoder registers a decoder for nft module's types -func (am AppModule) RegisterStoreDecoder(sdr store.StoreDecoderRegistry) { +func (am AppModule) RegisterStoreDecoder(sdr simtypes.StoreDecoderRegistry) { sdr[keeper.StoreKey] = simulation.NewDecodeStore(am.cdc) } diff --git a/x/params/module.go b/x/params/module.go index a4dab2ba70e8..c885da447263 100644 --- a/x/params/module.go +++ b/x/params/module.go @@ -120,7 +120,7 @@ func (am AppModule) ProposalContents(simState module.SimulationState) []simtypes } // RegisterStoreDecoder doesn't register any type. -func (AppModule) RegisterStoreDecoder(sdr store.StoreDecoderRegistry) {} +func (AppModule) RegisterStoreDecoder(sdr simtypes.StoreDecoderRegistry) {} // WeightedOperations returns the all the gov module operations with their respective weights. func (am AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation { diff --git a/x/slashing/module.go b/x/slashing/module.go index f87b4109f1bf..877c88f9f917 100644 --- a/x/slashing/module.go +++ b/x/slashing/module.go @@ -187,7 +187,7 @@ func (AppModule) ProposalContents(simState module.SimulationState) []simtypes.We } // RegisterStoreDecoder registers a decoder for slashing module's types -func (am AppModule) RegisterStoreDecoder(sdr store.StoreDecoderRegistry) { +func (am AppModule) RegisterStoreDecoder(sdr simtypes.StoreDecoderRegistry) { sdr[types.StoreKey] = simulation.NewDecodeStore(am.cdc) } diff --git a/x/staking/module.go b/x/staking/module.go index 19a81a26dbad..682b0423505a 100644 --- a/x/staking/module.go +++ b/x/staking/module.go @@ -294,7 +294,7 @@ func (AppModule) ProposalContents(simState module.SimulationState) []simtypes.We } // RegisterStoreDecoder registers a decoder for staking module's types -func (am AppModule) RegisterStoreDecoder(sdr store.StoreDecoderRegistry) { +func (am AppModule) RegisterStoreDecoder(sdr simtypes.StoreDecoderRegistry) { sdr[types.StoreKey] = simulation.NewDecodeStore(am.cdc) }