fix(wallet)_: return balance when available, do not fail all

This commit is contained in:
Anthony Laibe 2024-08-09 12:17:19 +02:00 committed by Anthony Laibe
parent 48ebe24f8e
commit 74fa567cda
2 changed files with 1 additions and 10 deletions

View File

@ -300,7 +300,6 @@ func (bf *DefaultBalanceFetcher) GetBalancesAtByChain(parent context.Context, cl
if err != nil {
return err
}
updateBalance(client.NetworkID(), balances)
return nil
})
@ -310,5 +309,5 @@ func (bf *DefaultBalanceFetcher) GetBalancesAtByChain(parent context.Context, cl
case <-parent.Done():
return nil, parent.Err()
}
return response, group.Error()
return response, nil
}

View File

@ -382,12 +382,4 @@ func TestBalanceFetcherGetBalancesAtByChain(t *testing.T) {
require.NoError(t, err)
require.Equal(t, expectedBalances, balances)
// Fetch native balances and token balances using scan contract for Arbitrum Mainnet
chainClientsArb := map[uint64]chain.ClientInterface{w_common.ArbitrumMainnet: chainClientArb}
balancesArb, errArb := bf.GetBalancesAtByChain(ctx, chainClientsArb, accounts, tokens, atBlocks)
require.Error(t, errArb, "GetBalancesAtByChain should return an error for Arbitrum Mainnet")
require.Contains(t, errArb.Error(), "no scan contract", "Incorrect error message for Arbitrum Mainnet")
require.Nil(t, balancesArb[w_common.ArbitrumMainnet])
}