Skip to content

Commit

Permalink
fix validator updates
Browse files Browse the repository at this point in the history
  • Loading branch information
neitdung committed Dec 11, 2024
1 parent 59c11da commit 07354b5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions modules/staking/utils_validators.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package staking
import (
"fmt"

"cosmossdk.io/math"
"github.com/forbole/callisto/v4/modules/staking/keybase"
"github.com/forbole/callisto/v4/types"

Expand Down Expand Up @@ -251,11 +252,12 @@ func (m *Module) updateProposalValidatorStatusSnapshot(
if err != nil {
return err
}
divisor, _ := math.NewIntFromString("1000000000000000000")

snapshots[index] = types.NewProposalValidatorStatusSnapshot(
proposalID,
consAddr.String(),
validator.Tokens.Int64(),
validator.Tokens.Quo(divisor).Int64(),
validator.Status,
validator.Jailed,
height,
Expand Down Expand Up @@ -287,8 +289,8 @@ func (m *Module) updateValidatorStatusAndVP(height int64, validators []stakingty
if err != nil {
return err
}

votingPowers[index] = types.NewValidatorVotingPower(consAddr.String(), validator.Tokens.Int64(), height)
divisor, _ := math.NewIntFromString("1000000000000000000")
votingPowers[index] = types.NewValidatorVotingPower(consAddr.String(), validator.Tokens.Quo(divisor).Int64(), height)

statuses[index] = types.NewValidatorStatus(
consAddr.String(),
Expand Down

0 comments on commit 07354b5

Please sign in to comment.