Skip to content

Commit

Permalink
app simi
Browse files Browse the repository at this point in the history
  • Loading branch information
itsdevbear committed Oct 6, 2023
1 parent a556bc4 commit d903059
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions runtime/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package runtime
import (
abci "github.com/cometbft/cometbft/abci/types"

"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/server/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
Expand All @@ -17,10 +16,6 @@ type AppI interface {
// The assigned name of the app.
Name() string

// The application types codec.
// NOTE: This should NOT be sealed before being returned.
LegacyAmino() *codec.LegacyAmino

// Application updates every begin block.
BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error)

Expand All @@ -35,7 +30,12 @@ type AppI interface {

// Exports the state of the application for a genesis file.
ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs, modulesToExport []string) (types.ExportedApp, error)
}

// AppSimI implements the common methods for a Cosmos SDK-based application
// specific blockchain that chooses to utilize the sdk simulation framework.
type AppSimI interface {
AppI
// Helper for the simulation framework.
SimulationManager() *module.SimulationManager
}
4 changes: 2 additions & 2 deletions testutil/sims/simulation_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func SetupSimulation(config simtypes.Config, dirPrefix, dbName string, verbose,

// SimulationOperations retrieves the simulation params from the provided file path
// and returns all the modules weighted operations
func SimulationOperations(app runtime.AppI, cdc codec.JSONCodec, config simtypes.Config) []simtypes.WeightedOperation {
func SimulationOperations(app runtime.AppSimI, cdc codec.JSONCodec, config simtypes.Config) []simtypes.WeightedOperation {
simState := module.SimulationState{
AppParams: make(simtypes.AppParams),
Cdc: cdc,
Expand All @@ -78,7 +78,7 @@ func SimulationOperations(app runtime.AppI, cdc codec.JSONCodec, config simtypes

// CheckExportSimulation exports the app state and simulation parameters to JSON
// if the export paths are defined.
func CheckExportSimulation(app runtime.AppI, config simtypes.Config, params simtypes.Params) error {
func CheckExportSimulation(app runtime.AppSimI, config simtypes.Config, params simtypes.Params) error {
if config.ExportStatePath != "" {
fmt.Println("exporting app state...")
exported, err := app.ExportAppStateAndValidators(false, nil, nil)
Expand Down

0 comments on commit d903059

Please sign in to comment.