Skip to content

Commit

Permalink
Merge PR cosmos#5419: Parametrise simulation gas value
Browse files Browse the repository at this point in the history
  • Loading branch information
Alessio Treglia authored and alexanderbez committed Dec 18, 2019
1 parent 2e61d4e commit 083263b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 6 additions & 3 deletions helpers/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 2 additions & 0 deletions test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ func SignCheckDeliver(
tx := helpers.GenTx(
msgs,
sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 0)},
helpers.DefaultGenTxGas,
"",
accNums,
seq,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 083263b

Please sign in to comment.