Skip to content

Commit

Permalink
set base denom to ario
Browse files Browse the repository at this point in the history
  • Loading branch information
jiujiteiro committed Jul 15, 2022
1 parent 9240cf6 commit 77be9be
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions x/staking/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ var (
pk2 = ed25519.GenPrivKey().PubKey()
addr2 = sdk.AccAddress(pk2.Address())
valAddr2 = sdk.ValAddress(pk2.Address())
coinRio = sdk.NewInt64Coin("urio", 1000)
coinDefault = sdk.NewInt64Coin(sdk.DefaultBondDenom, 1000)
coinRst = sdk.NewInt64Coin("urst", 1000)
coinRio = sdk.NewInt64Coin("ario", 1000)
coinDefault = sdk.NewInt64Coin(sdk.DefaultBondDenom, 1000)
coinRst = sdk.NewInt64Coin("arst", 1000)
commission1 = types.NewCommissionRates(sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec())
)

Expand Down Expand Up @@ -57,7 +57,7 @@ func (suite *KeeperTestSuite) TestMsgServerCreateValidatorMultipleDenoms() {
suite.SetupTest()

params := suite.app.StakingKeeper.GetParams(suite.ctx)
params.BondDenom = "urio,urst"
params.BondDenom = "ario,arst"
suite.app.StakingKeeper.SetParams(suite.ctx, params)

// test rst, supported denom
Expand Down
16 changes: 8 additions & 8 deletions x/staking/keeper/params_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,26 @@ func (suite *KeeperTestSuite) TestSetParamsSetMultiTokenBondDenom() {
expParams := types.DefaultParams()
suite.Require().Equal(expParams.BondDenom, sdk.DefaultBondDenom)

expParams.BondDenom = "urio,urst"
expParams.BondDenom = "ario,arst"
suite.app.StakingKeeper.SetParams(suite.ctx, expParams)

//validate save
resParams := suite.app.StakingKeeper.GetParams(suite.ctx)
suite.Require().Equal(resParams.BondDenom, "urio,urst")
suite.Require().Equal(resParams.BondDenom, "ario,arst")
}

func (suite *KeeperTestSuite) TestIsBondDenomSupported() {
suite.SetupTest()

//validate for default sdk bond denom
expParams := types.DefaultParams()
expParams.BondDenom = "urio,urst"
expParams.BondDenom = "ario,arst"
suite.app.StakingKeeper.SetParams(suite.ctx, expParams)

res := suite.app.StakingKeeper.IsBondDenomSupported(suite.ctx, "urio")
res := suite.app.StakingKeeper.IsBondDenomSupported(suite.ctx, "ario")
suite.Require().True(res)
suite.Require().True(suite.app.StakingKeeper.IsBondDenomSupported(suite.ctx, "urio"))
suite.Require().True(suite.app.StakingKeeper.IsBondDenomSupported(suite.ctx, "urst"))
suite.Require().True(suite.app.StakingKeeper.IsBondDenomSupported(suite.ctx, "ario"))
suite.Require().True(suite.app.StakingKeeper.IsBondDenomSupported(suite.ctx, "arst"))
suite.Require().False(suite.app.StakingKeeper.IsBondDenomSupported(suite.ctx, "stake"))
}

Expand All @@ -53,9 +53,9 @@ func (suite *KeeperTestSuite) TestBondDenomSlice() {
var expected = []string{"stake"}
suite.Require().Equal(suite.app.StakingKeeper.BondDenomSlice(suite.ctx), expected)

expParams.BondDenom = "urio,urst"
expParams.BondDenom = "ario,arst"
suite.app.StakingKeeper.SetParams(suite.ctx, expParams)

expected = []string{"urio", "urst"}
expected = []string{"ario", "arst"}
suite.Require().Equal(suite.app.StakingKeeper.BondDenomSlice(suite.ctx), expected)
}
2 changes: 1 addition & 1 deletion x/staking/keeper/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (k Keeper) TotalBondedTokens(ctx sdk.Context) sdk.Int {

// StakingTokenSupply staking tokens from the total supply
func (k Keeper) StakingTokenSupply(ctx sdk.Context) sdk.Int {
return k.bankKeeper.GetSupply(ctx, "urio").Amount
return k.bankKeeper.GetSupply(ctx, "ario").Amount
}

// BondedRatio the fraction of the staking tokens which are currently bonded
Expand Down

0 comments on commit 77be9be

Please sign in to comment.