Skip to content

Commit 49d12cf

Browse files
fix: change SimulationState.InitialStake to sdkmath.Int (cosmos#11855)
* fix: change SimulationState.InitialStake to sdkmath.Int * cl * aleks' suggestion
1 parent 5fc75ec commit 49d12cf

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

state.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
tmjson "github.com/tendermint/tendermint/libs/json"
1212
tmtypes "github.com/tendermint/tendermint/types"
1313

14+
sdkmath "cosmossdk.io/math"
1415
"github.com/cosmos/cosmos-sdk/codec"
1516
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
1617
simappparams "github.com/cosmos/cosmos-sdk/simapp/params"
@@ -147,10 +148,13 @@ func AppStateRandomizedFn(
147148

148149
// generate a random amount of initial stake coins and a random initial
149150
// number of bonded accounts
150-
var initialStake, numInitiallyBonded int64
151+
var (
152+
numInitiallyBonded int64
153+
initialStake sdkmath.Int
154+
)
151155
appParams.GetOrGenerate(
152156
cdc, simappparams.StakePerAccount, &initialStake, r,
153-
func(r *rand.Rand) { initialStake = r.Int63n(1e12) },
157+
func(r *rand.Rand) { initialStake = sdkmath.NewInt(r.Int63n(1e12)) },
154158
)
155159
appParams.GetOrGenerate(
156160
cdc, simappparams.InitiallyBondedValidators, &numInitiallyBonded, r,

0 commit comments

Comments
 (0)