Skip to content

Commit

Permalink
fix: Simulation is not deterministic due to GenSignedMockTx (cosmos#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
adu-web3 committed Jun 30, 2022
1 parent 1df8264 commit ff81f8a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test_helpers.go
Expand Up @@ -3,7 +3,9 @@ package simapp
import (
"context"
"encoding/json"
"math/rand"
"testing"
"time"

"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
Expand Down Expand Up @@ -257,6 +259,7 @@ func SignCheckDeliver(
chainID string, accNums, accSeqs []uint64, expSimPass, expPass bool, priv ...cryptotypes.PrivKey,
) (sdk.GasInfo, *sdk.Result, error) {
tx, err := simtestutil.GenSignedMockTx(
rand.New(rand.NewSource(time.Now().UnixNano())),
txCfg,
msgs,
sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 0)},
Expand Down Expand Up @@ -307,6 +310,7 @@ func GenSequenceOfTxs(txGen client.TxConfig, msgs []sdk.Msg, accNums []uint64, i
var err error
for i := 0; i < numToGenerate; i++ {
txs[i], err = simtestutil.GenSignedMockTx(
rand.New(rand.NewSource(time.Now().UnixNano())),
txGen,
msgs,
sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 0)},
Expand Down

0 comments on commit ff81f8a

Please sign in to comment.