cosmos / cosmos-sdk

:chains: A Framework for Building High Value Public Blockchains :sparkles:
https://cosmos.network/
Apache License 2.0
6.17k stars 3.57k forks source link

tests/sims support for runtime/v2 #20469

Open kocubinski opened 3 months ago

kocubinski commented 3 months ago

simulation.SimulateFromSeed expects a BaseApp. Is it possible for this function to accept an abstraction which both BaseApp and something from runtime/v2 satisfy?

alpe commented 1 month ago

The dependency to *Baseapp could be dropped by an interface that supports methods for setup and flow control. The weighted/ future ops that are executed agains *Baseapp could be executed agains the following interface:

// AppEntrypoint defines the method for delivering simulation TX to the app. This is implemented by *Baseapp
type AppEntrypoint interface {
    SimDeliver(_txEncoder sdk.TxEncoder, tx sdk.Tx) (sdk.GasInfo, *sdk.Result, error)
}

This would be a breaking change though. My work in sims2 branch prepares for this already although I did not modify the Ops for compatibilty.