Skip to content

Commit

Permalink
fix: Simulation is not deterministic due to GenSignedMockTx (backport c…
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored and JeancarloBarrios committed Sep 28, 2024
1 parent b13d8ae commit 6158b74
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ It is strongly recommended to upgrade to these releases as well.

### Bug Fixes

* (testutil/sims) [#12374](https://github.com/cosmos/cosmos-sdk/pull/12374) fix the non-determinstic behavior in simulations caused by `GenSignedMockTx` and check empty coins slice before it is used to create `banktype.MsgSend`.
* [#12448](https://github.com/cosmos/cosmos-sdk/pull/12448) Start telemetry independently from the API server.
* [#12509](https://github.com/cosmos/cosmos-sdk/pull/12509) Fix `Register{Tx,Tendermint}Service` not being called, resulting in some endpoints like the Simulate endpoint not working.

Expand Down
3 changes: 2 additions & 1 deletion x/genutil/gentx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,10 @@ func (suite *GenTxTestSuite) TestDeliverGenTxs() {
_ = suite.setAccountBalance(addr1, 50)
_ = suite.setAccountBalance(addr2, 1)

r := rand.New(rand.NewSource(time.Now().UnixNano()))
msg := banktypes.NewMsgSend(addr1, addr2, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 1)})
tx, err := helpers.GenSignedMockTx(
rand.New(rand.NewSource(time.Now().UnixNano())),
r,
suite.encodingConfig.TxConfig,
[]sdk.Msg{msg},
sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 10)},
Expand Down

0 comments on commit 6158b74

Please sign in to comment.