refactor: migrate calls from alias file to appropriate store/types (#14455)
Co-authored-by: Marko <marbar3778@yahoo.com> Closes https://github.com/cosmos/cosmos-sdk/issues/14406
This commit is contained in:
@@ -42,6 +42,7 @@ import (
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
|
||||
storetypes "github.com/cosmos/cosmos-sdk/store/types"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
||||
)
|
||||
@@ -416,7 +417,8 @@ func (m *Manager) ExportGenesisForModules(ctx sdk.Context, cdc codec.JSONCodec,
|
||||
if module, ok := m.Modules[moduleName].(HasGenesis); ok {
|
||||
channels[moduleName] = make(chan json.RawMessage)
|
||||
go func(module HasGenesis, ch chan json.RawMessage) {
|
||||
ctx := ctx.WithGasMeter(sdk.NewInfiniteGasMeter()) // avoid race conditions
|
||||
ctx := ctx.WithGasMeter(storetypes.NewInfiniteGasMeter()) // avoid race conditions
|
||||
|
||||
ch <- module.ExportGenesis(ctx, cdc)
|
||||
}(module, channels[moduleName])
|
||||
}
|
||||
|
||||
@@ -7,9 +7,8 @@ import (
|
||||
"time"
|
||||
|
||||
sdkmath "cosmossdk.io/math"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
storetypes "github.com/cosmos/cosmos-sdk/store/types"
|
||||
"github.com/cosmos/cosmos-sdk/types/simulation"
|
||||
)
|
||||
|
||||
@@ -23,7 +22,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(sdk.StoreDecoderRegistry)
|
||||
RegisterStoreDecoder(storetypes.StoreDecoderRegistry)
|
||||
|
||||
// simulation operations (i.e msgs) with their respective weight
|
||||
WeightedOperations(simState SimulationState) []simulation.WeightedOperation
|
||||
@@ -32,8 +31,8 @@ type AppModuleSimulation interface {
|
||||
// SimulationManager defines a simulation manager that provides the high level utility
|
||||
// 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 sdk.StoreDecoderRegistry // functions to decode the key-value pairs from each module's store
|
||||
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
|
||||
}
|
||||
|
||||
// NewSimulationManager creates a new SimulationManager object
|
||||
@@ -42,7 +41,7 @@ type SimulationManager struct {
|
||||
func NewSimulationManager(modules ...AppModuleSimulation) *SimulationManager {
|
||||
return &SimulationManager{
|
||||
Modules: modules,
|
||||
StoreDecoders: make(sdk.StoreDecoderRegistry),
|
||||
StoreDecoders: make(storetypes.StoreDecoderRegistry),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user