fix(simulation): Fix all problems make test-sim-custom-genesis-fast for simulation test. (backport #17911) (#20909)
Co-authored-by: Chenqun Lu <luchenqun@qq.com> Co-authored-by: Julien Robert <julien@rbrt.fr>
This commit is contained in:
co-authored by
Chenqun Lu
Julien Robert
parent
c51f58c799
commit
698627016d
@@ -91,6 +91,7 @@ type BaseApp struct {
|
||||
addrPeerFilter sdk.PeerFilter // filter peers by address and port
|
||||
idPeerFilter sdk.PeerFilter // filter peers by node ID
|
||||
fauxMerkleMode bool // if true, IAVL MountStores uses MountStoresDB for simulation speed.
|
||||
sigverifyTx bool // in the simulation test, since the account does not have a private key, we have to ignore the tx sigverify.
|
||||
|
||||
// manages snapshots, i.e. dumps of app state at certain intervals
|
||||
snapshotManager *snapshots.Manager
|
||||
@@ -211,6 +212,7 @@ func NewBaseApp(
|
||||
msgServiceRouter: NewMsgServiceRouter(),
|
||||
txDecoder: txDecoder,
|
||||
fauxMerkleMode: false,
|
||||
sigverifyTx: true,
|
||||
queryGasLimit: math.MaxUint64,
|
||||
}
|
||||
|
||||
@@ -667,6 +669,8 @@ func (app *BaseApp) getContextForTx(mode execMode, txBytes []byte) sdk.Context {
|
||||
WithGasMeter(storetypes.NewInfiniteGasMeter())
|
||||
// WithVoteInfos(app.voteInfos) // TODO: identify if this is needed
|
||||
|
||||
ctx = ctx.WithIsSigverifyTx(app.sigverifyTx)
|
||||
|
||||
ctx = ctx.WithConsensusParams(app.GetConsensusParams(ctx))
|
||||
|
||||
if mode == execModeReCheck {
|
||||
|
||||
@@ -260,6 +260,11 @@ func (app *BaseApp) SetFauxMerkleMode() {
|
||||
app.fauxMerkleMode = true
|
||||
}
|
||||
|
||||
// SetNotSigverify during simulation testing, transaction signature verification needs to be ignored.
|
||||
func (app *BaseApp) SetNotSigverifyTx() {
|
||||
app.sigverifyTx = false
|
||||
}
|
||||
|
||||
// SetCommitMultiStoreTracer sets the store tracer on the BaseApp's underlying
|
||||
// CommitMultiStore.
|
||||
func (app *BaseApp) SetCommitMultiStoreTracer(w io.Writer) {
|
||||
|
||||
@@ -35,6 +35,7 @@ func (app *BaseApp) SimDeliver(txEncoder sdk.TxEncoder, tx sdk.Tx) (sdk.GasInfo,
|
||||
if err != nil {
|
||||
return sdk.GasInfo{}, nil, errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "%s", err)
|
||||
}
|
||||
|
||||
gasInfo, result, _, err := app.runTx(execModeFinalize, bz)
|
||||
return gasInfo, result, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user