Skip to content

Commit

Permalink
Fix StakingQueryDelegationsTo function
Browse files Browse the repository at this point in the history
Update the function to correctly return the amount of staking for each delegator to a specific validator.
  • Loading branch information
LucaPalla95 authored Sep 18, 2024
1 parent c4d7bce commit 0e46a76
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions chain/cosmos/module_staking.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ func (c *CosmosChain) StakingQueryDelegationsTo(ctx context.Context, validator s
}

var delegations []*stakingtypes.DelegationResponse
for _, d := range res.DelegationResponses {
delegations = append(delegations, &d)
for i := range res.DelegationResponses {
delegations = append(delegations, &res.DelegationResponses[i])
}

return delegations, nil
Expand Down

0 comments on commit 0e46a76

Please sign in to comment.