fix(wallet)_: return balance when available, do not fail all
This commit is contained in:
parent
48ebe24f8e
commit
74fa567cda
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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])
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue