Skip to content

Commit

Permalink
imp(staking): use default bond denom constant
Browse files Browse the repository at this point in the history
  • Loading branch information
luchenqun committed Nov 20, 2023
1 parent 8a9ebb7 commit 78a7467
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions x/staking/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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,
},
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 78a7467

Please sign in to comment.