From ad6a20c65ebfd0b53658edbe31bcce0871d59f73 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Tue, 7 Jan 2025 11:40:16 +0100 Subject: [PATCH] fix(x/staking): use overwritten default bond denom (#23233) --- x/staking/simulation/genesis.go | 2 +- x/staking/types/params.go | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/x/staking/simulation/genesis.go b/x/staking/simulation/genesis.go index 9808c3f430..9f4b4ad44b 100644 --- a/x/staking/simulation/genesis.go +++ b/x/staking/simulation/genesis.go @@ -37,7 +37,7 @@ func getHistEntries(r *rand.Rand) uint32 { // getKeyRotationFee returns randomized keyRotationFee between 10000-1000000. func getKeyRotationFee(r *rand.Rand) sdk.Coin { - return sdk.NewInt64Coin(sdk.DefaultBondDenom, r.Int63n(types.DefaultKeyRotationFee.Amount.Int64()-10000)+10000) + return sdk.NewInt64Coin(sdk.DefaultBondDenom, r.Int63n(990000)+10000) } // RandomizedGenState generates a random GenesisState for staking diff --git a/x/staking/types/params.go b/x/staking/types/params.go index 083fbcaa7a..c30e36c6fb 100644 --- a/x/staking/types/params.go +++ b/x/staking/types/params.go @@ -27,13 +27,8 @@ const ( DefaultMaxEntries uint32 = 7 ) -var ( - // DefaultMinCommissionRate is set to 0% - DefaultMinCommissionRate = math.LegacyZeroDec() - - // DefaultKeyRotationFee is fees used to rotate the ConsPubkey or Operator key - DefaultKeyRotationFee = sdk.NewInt64Coin(sdk.DefaultBondDenom, 1000000) -) +// DefaultMinCommissionRate is set to 0% +var DefaultMinCommissionRate = math.LegacyZeroDec() // NewParams creates a new Params instance func NewParams(unbondingTime time.Duration, @@ -60,7 +55,7 @@ func DefaultParams() Params { DefaultMaxEntries, sdk.DefaultBondDenom, DefaultMinCommissionRate, - DefaultKeyRotationFee, + sdk.NewInt64Coin(sdk.DefaultBondDenom, 1000000), // fees used to rotate the ConsPubkey or Operator key ) }