From 78a746700efa454bb5c80a4af6371d8cc4b63589 Mon Sep 17 00:00:00 2001 From: Luke Date: Mon, 20 Nov 2023 22:07:48 +0800 Subject: [PATCH] imp(staking): use default bond denom constant --- x/staking/keeper/msg_server_test.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/x/staking/keeper/msg_server_test.go b/x/staking/keeper/msg_server_test.go index df1381aabb25..a869e668025e 100644 --- a/x/staking/keeper/msg_server_test.go +++ b/x/staking/keeper/msg_server_test.go @@ -71,7 +71,7 @@ func (s *KeeperTestSuite) TestMsgCreateValidator() { DelegatorAddress: Addr.String(), ValidatorAddress: ValAddr.String(), Pubkey: pubkey, - Value: sdk.NewInt64Coin("stake", 10000), + Value: sdk.NewInt64Coin(sdk.DefaultBondDenom, 10000), }, expErr: true, expErrMsg: "empty description", @@ -91,7 +91,7 @@ func (s *KeeperTestSuite) TestMsgCreateValidator() { DelegatorAddress: Addr.String(), ValidatorAddress: sdk.AccAddress([]byte("invalid")).String(), Pubkey: pubkey, - Value: sdk.NewInt64Coin("stake", 10000), + Value: sdk.NewInt64Coin(sdk.DefaultBondDenom, 10000), }, expErr: true, expErrMsg: "invalid validator address", @@ -111,7 +111,7 @@ func (s *KeeperTestSuite) TestMsgCreateValidator() { DelegatorAddress: Addr.String(), ValidatorAddress: ValAddr.String(), Pubkey: nil, - Value: sdk.NewInt64Coin("stake", 10000), + Value: sdk.NewInt64Coin(sdk.DefaultBondDenom, 10000), }, expErr: true, expErrMsg: "empty validator public key", @@ -131,7 +131,7 @@ func (s *KeeperTestSuite) TestMsgCreateValidator() { DelegatorAddress: Addr.String(), ValidatorAddress: ValAddr.String(), Pubkey: pubkeyInvalidLen, - Value: sdk.NewInt64Coin("stake", 10000), + Value: sdk.NewInt64Coin(sdk.DefaultBondDenom, 10000), }, expErr: true, expErrMsg: "consensus pubkey len is invalid", @@ -151,7 +151,7 @@ func (s *KeeperTestSuite) TestMsgCreateValidator() { DelegatorAddress: Addr.String(), ValidatorAddress: ValAddr.String(), Pubkey: pubkey, - Value: sdk.NewInt64Coin("stake", 0), + Value: sdk.NewInt64Coin(sdk.DefaultBondDenom, 0), }, expErr: true, expErrMsg: "invalid delegation amount", @@ -191,7 +191,7 @@ func (s *KeeperTestSuite) TestMsgCreateValidator() { DelegatorAddress: Addr.String(), ValidatorAddress: ValAddr.String(), Pubkey: pubkey, - Value: sdk.NewInt64Coin("stake", 10000), + Value: sdk.NewInt64Coin(sdk.DefaultBondDenom, 10000), }, expErr: true, expErrMsg: "minimum self delegation must be a positive integer", @@ -211,7 +211,7 @@ func (s *KeeperTestSuite) TestMsgCreateValidator() { DelegatorAddress: Addr.String(), ValidatorAddress: ValAddr.String(), Pubkey: pubkey, - Value: sdk.NewInt64Coin("stake", 10000), + Value: sdk.NewInt64Coin(sdk.DefaultBondDenom, 10000), }, expErr: true, expErrMsg: "minimum self delegation must be a positive integer", @@ -231,7 +231,7 @@ func (s *KeeperTestSuite) TestMsgCreateValidator() { DelegatorAddress: Addr.String(), ValidatorAddress: ValAddr.String(), Pubkey: pubkey, - Value: sdk.NewInt64Coin("stake", 10), + Value: sdk.NewInt64Coin(sdk.DefaultBondDenom, 10), }, expErr: true, expErrMsg: "validator's self delegation must be greater than their minimum self delegation", @@ -255,7 +255,7 @@ func (s *KeeperTestSuite) TestMsgCreateValidator() { DelegatorAddress: Addr.String(), ValidatorAddress: ValAddr.String(), Pubkey: pubkey, - Value: sdk.NewInt64Coin("stake", 10000), + Value: sdk.NewInt64Coin(sdk.DefaultBondDenom, 10000), }, expErr: false, }, @@ -285,7 +285,7 @@ func (s *KeeperTestSuite) TestMsgEditValidator() { require.NotNil(pk) comm := stakingtypes.NewCommissionRates(math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0)) - msg, err := stakingtypes.NewMsgCreateValidator(ValAddr.String(), pk, sdk.NewCoin("stake", math.NewInt(10)), stakingtypes.Description{Moniker: "NewVal"}, comm, math.OneInt()) + msg, err := stakingtypes.NewMsgCreateValidator(ValAddr.String(), pk, sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(10)), stakingtypes.Description{Moniker: "NewVal"}, comm, math.OneInt()) require.NoError(err) res, err := msgServer.CreateValidator(ctx, msg) @@ -459,7 +459,7 @@ func (s *KeeperTestSuite) TestMsgDelegate() { comm := stakingtypes.NewCommissionRates(math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0)) - msg, err := stakingtypes.NewMsgCreateValidator(ValAddr.String(), pk, sdk.NewCoin("stake", math.NewInt(10)), stakingtypes.Description{Moniker: "NewVal"}, comm, math.OneInt()) + msg, err := stakingtypes.NewMsgCreateValidator(ValAddr.String(), pk, sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(10)), stakingtypes.Description{Moniker: "NewVal"}, comm, math.OneInt()) require.NoError(err) res, err := msgServer.CreateValidator(ctx, msg)