From 98d8a193611ab5ac30ee9d0e271101cdaf36e8c8 Mon Sep 17 00:00:00 2001 From: mmsqe Date: Wed, 21 Jun 2023 23:13:29 +0800 Subject: [PATCH] avoid invalid consensus params when set unlimited max gas for sim test --- x/simulation/params.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x/simulation/params.go b/x/simulation/params.go index 73b520a0fd7..6f31d3eb4cb 100644 --- a/x/simulation/params.go +++ b/x/simulation/params.go @@ -3,6 +3,7 @@ package simulation import ( "encoding/json" "fmt" + "math" "math/rand" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" @@ -187,7 +188,7 @@ func randomConsensusParams(r *rand.Rand, appState json.RawMessage, cdc codec.JSO consensusParams := &cmtproto.ConsensusParams{ Block: &cmtproto.BlockParams{ MaxBytes: int64(simulation.RandIntBetween(r, 20000000, 30000000)), - MaxGas: -1, + MaxGas: math.MaxInt64, }, Validator: &cmtproto.ValidatorParams{ PubKeyTypes: []string{types.ABCIPubKeyTypeEd25519},