Skip to content

Commit

Permalink
fix: fix validators voting power calculations
Browse files Browse the repository at this point in the history
  • Loading branch information
RiccardoM committed Oct 23, 2023
1 parent fdf851c commit b29eefb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/staking/utils_validators.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ func (m *Module) updateProposalValidatorStatusSnapshot(height int64, proposalID
return err
}

var votingPower = validator.Tokens.Int64()
var votingPower = validator.Tokens.Int64() / 1_000_000
if validator.Status != stakingtypes.Bonded || validator.IsJailed() {
votingPower = 0
}
Expand Down Expand Up @@ -303,7 +303,7 @@ func (m *Module) updateValidatorsStatusesAndVotingPowers(height int64, validator
return err
}

var votingPower = validator.Tokens.Int64()
var votingPower = validator.Tokens.Int64() / 1_000_000
if validator.Status != stakingtypes.Bonded || validator.IsJailed() {
votingPower = 0
}
Expand Down

0 comments on commit b29eefb

Please sign in to comment.