Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

!test: add genesis state for multi staking module to simapp #99

Merged
merged 7 commits into from
Jan 13, 2024

Conversation

neitdung
Copy link
Collaborator

Add following items to genesis state of simapp:

  • Add ario and arst balances
  • Add MultiStakingLocks, MultiStakingCoinInfo, ValidatorMultiStakingCoins to genesis state of multi staking module
  • Add genesis state of multi staking module to genesis state of simapp

BondWeight: sdk.MustNewDecFromStr("0.5"),
}
coinInfos := []multistakingtypes.MultiStakingCoinInfo{msCoinAInfo, msCoinBInfo}
validatorCoins := make([]multistakingtypes.ValidatorMultiStakingCoin, 0, len(valSet.Validators))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

validatorMsCoins

Denom: testutil.MultistakingDenomB,
BondWeight: sdk.MustNewDecFromStr("0.5"),
}
coinInfos := []multistakingtypes.MultiStakingCoinInfo{msCoinAInfo, msCoinBInfo}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

msCoinInfos


bondAmt := sdk.DefaultPowerReduction
for i, val := range valSet.Validators {
valDenom := testutil.MultistakingDenomA
Copy link
Collaborator

@catShaark catShaark Jan 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

valMsDenom

if i%2 == 1 {
valDenom = testutil.MultistakingDenomB
}
validatorCoins = append(validatorCoins, multistakingtypes.ValidatorMultiStakingCoin{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

valMsCoins

ValAddr: sdk.ValAddress(val.Address).String(),
CoinDenom: valDenom,
})
valTokens := coinInfos[i%2].BondWeight.MulInt(bondAmt).RoundInt()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

valBondCoin

@catShaark catShaark merged commit d96beeb into realiotech:main Jan 13, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants