Skip to content

Commit

Permalink
add BridgeActive to ParamChanges
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed Mar 21, 2023
1 parent 8a20349 commit 55780f4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion module/x/gravity/simulation/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ func genRandomString(r *rand.Rand, minLength, maxLength uint8) string {
return hex.EncodeToString(bz)
}

func GenBridgeActive(r *rand.Rand) bool {
return true
}

func genRandomParams(r *rand.Rand) types.Params {
return types.Params{
GravityId: genRandomString(r, 16, 16),
Expand All @@ -47,7 +51,7 @@ func genRandomParams(r *rand.Rand) types.Params {
SlashFractionEthereumSignature: sdk.NewDec(1).Quo(sdk.NewDec(1000)),
SlashFractionConflictingEthereumSignature: sdk.NewDec(1).Quo(sdk.NewDec(1000)),
UnbondSlashingSignerSetTxsWindow: uint64(r.Intn(maxBlocksInOneRound)),
BridgeActive: true,
BridgeActive: GenBridgeActive(r),
BatchCreationPeriod: uint64(r.Intn(maxBlocksInOneRound)) + 1,
BatchMaxElement: uint64(r.Intn(100)),
ObserveEthereumHeightPeriod: r.Uint64() + 1,
Expand Down
5 changes: 5 additions & 0 deletions module/x/gravity/simulation/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,10 @@ func ParamChanges(r *rand.Rand) []simtypes.ParamChange {
return fmt.Sprintf("\"%d\"", uint64(r.Intn(100))+1)
},
),
simulation.NewSimParamChange(types.ModuleName, string(types.ParamStoreBridgeActive),
func(r *rand.Rand) string {
return fmt.Sprintf("%v", GenBridgeActive(r))
},
),
}
}

0 comments on commit 55780f4

Please sign in to comment.