From 083263b7c5d2472cfc782f59aa03857022f6565b Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Wed, 18 Dec 2019 15:48:22 +0100 Subject: [PATCH] Merge PR #5419: Parametrise simulation gas value --- helpers/test_helpers.go | 9 ++++++--- test_helpers.go | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/helpers/test_helpers.go b/helpers/test_helpers.go index a9127a6fbd45..2341635eeea8 100644 --- a/helpers/test_helpers.go +++ b/helpers/test_helpers.go @@ -12,13 +12,16 @@ import ( ) // SimAppChainID hardcoded chainID for simulation -const SimAppChainID = "simulation-app" +const ( + DefaultGenTxGas = 1000000 + SimAppChainID = "simulation-app" +) // GenTx generates a signed mock transaction. -func GenTx(msgs []sdk.Msg, feeAmt sdk.Coins, chainID string, accnums []uint64, seq []uint64, priv ...crypto.PrivKey) auth.StdTx { +func GenTx(msgs []sdk.Msg, feeAmt sdk.Coins, gas uint64, chainID string, accnums []uint64, seq []uint64, priv ...crypto.PrivKey) auth.StdTx { fee := auth.StdFee{ Amount: feeAmt, - Gas: 1000000, // TODO: this should be a param + Gas: gas, } sigs := make([]auth.StdSignature, len(priv)) diff --git a/test_helpers.go b/test_helpers.go index 306b4259fb2d..0e6d22150255 100644 --- a/test_helpers.go +++ b/test_helpers.go @@ -120,6 +120,7 @@ func SignCheckDeliver( tx := helpers.GenTx( msgs, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 0)}, + helpers.DefaultGenTxGas, "", accNums, seq, @@ -163,6 +164,7 @@ func GenSequenceOfTxs(msgs []sdk.Msg, accNums []uint64, initSeqNums []uint64, nu txs[i] = helpers.GenTx( msgs, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 0)}, + helpers.DefaultGenTxGas, "", accNums, initSeqNums,