From 0e46a768a1dfb594f749ebd9b78cc672f3b94e00 Mon Sep 17 00:00:00 2001 From: Luca Palla <100412354+LucaPalla95@users.noreply.github.com> Date: Wed, 18 Sep 2024 13:08:50 +0200 Subject: [PATCH] Fix StakingQueryDelegationsTo function Update the function to correctly return the amount of staking for each delegator to a specific validator. --- chain/cosmos/module_staking.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chain/cosmos/module_staking.go b/chain/cosmos/module_staking.go index f37ef4f17..ce3afbb22 100644 --- a/chain/cosmos/module_staking.go +++ b/chain/cosmos/module_staking.go @@ -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