Skip to content

Commit

Permalink
Moved balance list
Browse files Browse the repository at this point in the history
  • Loading branch information
MissingNO57 committed Oct 21, 2024
1 parent b1a191d commit fef2eff
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/upgrade_cudos.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,14 @@ func writeMovedBalancesToManifest(genesisData *GenesisData, manifest *UpgradeMan
if delegations, exists := genesisData.Delegations.Get(address); exists {
bondedBalance := sdk.Coins{}
for i := range delegations.Iterate() {
_, delegatedAmount := i.Key, i.Value
validatorOperatorAddr, delegatedAmount := i.Key, i.Value
delegatedBalance := sdk.NewCoin(genesisData.BondDenom, delegatedAmount)
bondedBalance = bondedBalance.Add(delegatedBalance)
upgradeBalance.BondedStakingBalances = append(upgradeBalance.BondedStakingBalances, ValidatorBalance{Validator: validatorOperatorAddr, Balance: sdk.NewCoins(delegatedBalance)})
}

upgradeBalance.BondedStakingBalancesAggr = bondedBalance
// Bonded balance is part of the bank balance in this case, so we need to subtract it
upgradeBalance.BankBalance = upgradeBalance.BankBalance.Sub(bondedBalance)
}

Expand Down

0 comments on commit fef2eff

Please sign in to comment.