From 722390c784375fc299cdb1a44557b175f45e5d15 Mon Sep 17 00:00:00 2001 From: Anthony Laibe Date: Tue, 2 May 2023 09:52:51 +0200 Subject: [PATCH] fix: reponse may contains less results than expected --- services/wallet/token/token.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/services/wallet/token/token.go b/services/wallet/token/token.go index ec69a8c82..185dc0da8 100644 --- a/services/wallet/token/token.go +++ b/services/wallet/token/token.go @@ -705,7 +705,13 @@ func (tm *Manager) GetBalancesByChain(parent context.Context, clients map[uint64 return nil } + if len(res) != len(chunk) { + log.Error("can't fetch erc20 token balance", "account", account, "error response not complete") + return nil + } + for idx, token := range chunk { + if !res[idx].Success { continue }