Skip to content

Commit

Permalink
rename variable
Browse files Browse the repository at this point in the history
  • Loading branch information
DongLieu committed Jan 16, 2024
1 parent 56308cf commit f587b0d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 20 deletions.
24 changes: 9 additions & 15 deletions x/multi-staking/keeper/abci_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package keeper_test

import (
"fmt"

"github.com/realio-tech/multi-staking-module/testutil"
"github.com/realio-tech/multi-staking-module/x/multi-staking/types"

Expand All @@ -16,11 +14,11 @@ func (suite *KeeperTestSuite) TestEndBlocker() {

mulStaker := testutil.GenAddress()
valAddr := testutil.GenValAddress()
const gasDenom = "ario"
const multiStakingDenom = "ario"

suite.msKeeper.SetValidatorMultiStakingCoin(suite.ctx, valAddr, gasDenom)
suite.msKeeper.SetValidatorMultiStakingCoin(suite.ctx, valAddr, multiStakingDenom)

mulBalance := sdk.NewCoins(sdk.NewCoin(stakingtypes.DefaultParams().BondDenom, sdk.NewInt(10000)), sdk.NewCoin(gasDenom, sdk.NewInt(10000)))
mulBalance := sdk.NewCoins(sdk.NewCoin(stakingtypes.DefaultParams().BondDenom, sdk.NewInt(10000)), sdk.NewCoin(multiStakingDenom, sdk.NewInt(10000)))
err := suite.app.BankKeeper.MintCoins(suite.ctx, minttypes.ModuleName, mulBalance)
suite.NoError(err)
err = suite.app.BankKeeper.SendCoinsFromModuleToAccount(suite.ctx, minttypes.ModuleName, mulStaker, mulBalance)
Expand All @@ -29,13 +27,13 @@ func (suite *KeeperTestSuite) TestEndBlocker() {
unlockEntry := types.UnlockEntry{
CreationHeight: suite.ctx.BlockHeight(),
UnlockingCoin: types.MultiStakingCoin{
Denom: gasDenom,
Denom: multiStakingDenom,
Amount: sdk.NewInt(10000),
BondWeight: sdk.NewDec(1),
},
}
newUbd := types.MultiStakingUnlock{
UnlockID: &types.UnlockID{
UnlockID: types.UnlockID{
MultiStakerAddr: mulStaker.String(),
ValAddr: valAddr.String(),
},
Expand All @@ -46,24 +44,20 @@ func (suite *KeeperTestSuite) TestEndBlocker() {
matureUnbondingDelegations := suite.msKeeper.GetMatureUnbondingDelegations(suite.ctx)
completionTime := suite.ctx.BlockHeader().Time

unDT := stakingtypes.UnbondingDelegationEntry{
unbondingDelegationEntry := stakingtypes.UnbondingDelegationEntry{
CreationHeight: suite.ctx.BlockHeight(),
CompletionTime: completionTime,
InitialBalance: sdk.NewInt(1000),
Balance: sdk.NewInt(1000),
}

unD := stakingtypes.UnbondingDelegation{
unbondingDelegation := stakingtypes.UnbondingDelegation{
DelegatorAddress: mulStaker.String(),
ValidatorAddress: valAddr.String(),
Entries: []stakingtypes.UnbondingDelegationEntry{unDT},
Entries: []stakingtypes.UnbondingDelegationEntry{unbondingDelegationEntry},
}

matureUnbondingDelegations = append(matureUnbondingDelegations, unD)
matureUnbondingDelegations = append(matureUnbondingDelegations, unbondingDelegation)

a := suite.app.AccountKeeper.GetModuleAccount(suite.ctx, "mint")
if a == nil {
fmt.Println("nill")
}
suite.msKeeper.EndBlocker(suite.ctx, matureUnbondingDelegations)
}
9 changes: 4 additions & 5 deletions x/multi-staking/types/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
func TestGenesisState_Validate(t *testing.T) {
multiStakerAddress := testutil.GenAddress()
valAddr := testutil.GenValAddress()
denom := "ario"
const multiStakingDenom = "ario"

for _, tc := range []struct {
desc string
Expand All @@ -30,12 +30,12 @@ func TestGenesisState_Validate(t *testing.T) {
genState: &types.GenesisState{
MultiStakingLocks: []types.MultiStakingLock{
{
LockID: &types.LockID{
LockID: types.LockID{
MultiStakerAddr: multiStakerAddress.String(),
ValAddr: valAddr.String(),
},
LockedCoin: types.MultiStakingCoin{
Denom: denom,
Denom: multiStakingDenom,
Amount: sdk.NewInt(1000),
BondWeight: sdk.NewDec(1),
},
Expand All @@ -44,14 +44,13 @@ func TestGenesisState_Validate(t *testing.T) {
ValidatorMultiStakingCoins: []types.ValidatorMultiStakingCoin{
{
ValAddr: valAddr.String(),
CoinDenom: denom,
CoinDenom: multiStakingDenom,
},
},
StakingGenesisState: types.DefaultGenesis().StakingGenesisState,
},
valid: true,
},
// this line is used by starport scaffolding # types/genesis/testcase
} {
t.Run(tc.desc, func(t *testing.T) {
err := tc.genState.Validate()
Expand Down

0 comments on commit f587b0d

Please sign in to comment.