mirror of
https://github.com/status-im/open-bounty.git
synced 2025-01-11 10:06:20 +00:00
Error handling for token-balance
This commit is contained in:
parent
b2be946e12
commit
fc817f09cc
@ -156,11 +156,15 @@
|
||||
[bounty-addr token]
|
||||
(let [token-address (get-token-address token)]
|
||||
(log/debug "token-balance" bounty-addr token token-address)
|
||||
(-> (eth/call token-address
|
||||
(:balance-of method-ids)
|
||||
bounty-addr)
|
||||
eth/hex->big-integer
|
||||
(convert-token-value token))))
|
||||
(try
|
||||
(-> (eth/call token-address
|
||||
(:balance-of method-ids)
|
||||
bounty-addr)
|
||||
eth/hex->big-integer
|
||||
(convert-token-value token))
|
||||
(catch Throwable t
|
||||
(log/error "Failed to query token balance " t)
|
||||
0))))
|
||||
|
||||
|
||||
(defn token-balances
|
||||
|
Loading…
x
Reference in New Issue
Block a user