Skip to content

Commit

Permalink
PR comment and bug fix with validators append
Browse files Browse the repository at this point in the history
  • Loading branch information
skosito committed Sep 4, 2024
1 parent 09f35e8 commit f88bfa1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions precompiles/staking/staking.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
ptypes "github.com/zeta-chain/node/precompiles/types"
)

// method names
const (
// write
StakeMethodName = "stake"
Expand Down Expand Up @@ -128,13 +129,13 @@ func (c *Contract) GetAllValidators(
validators := c.stakingKeeper.GetAllValidators(ctx)

validatorsRes := make([]Validator, len(validators))
for _, v := range validators {
validatorsRes = append(validatorsRes, Validator{
for i, v := range validators {
validatorsRes[i] = Validator{
OperatorAddress: v.OperatorAddress,
ConsensusPubKey: v.ConsensusPubkey.String(),
BondStatus: uint8(v.Status),
Jailed: v.Jailed,
})
}
}

return method.Outputs.Pack(validatorsRes)
Expand Down

0 comments on commit f88bfa1

Please sign in to comment.