Log issue details along with wrong token balance
This commit is contained in:
parent
34f3913ff4
commit
e540bd04ac
|
@ -146,12 +146,24 @@
|
||||||
|
|
||||||
|
|
||||||
(defn prettify-bounty-items [bounty-items]
|
(defn prettify-bounty-items [bounty-items]
|
||||||
(let [format-float (fn [balance]
|
(let [format-float (fn [bounty balance]
|
||||||
(try
|
(try
|
||||||
(format "%.2f" (float balance))
|
(format "%.2f" (double balance))
|
||||||
(catch Throwable ex
|
(catch Throwable ex
|
||||||
(log/error "Failed to convert token value:" balance)
|
(log/error (str (:repo-owner bounty)
|
||||||
|
"/"
|
||||||
|
(:repo-name bounty)
|
||||||
|
"/"
|
||||||
|
(:issue-number bounty))
|
||||||
|
"Failed to convert token value:" balance)
|
||||||
"0.00")))
|
"0.00")))
|
||||||
|
update-token-values (fn [bounty]
|
||||||
|
(->> bounty
|
||||||
|
:tokens
|
||||||
|
(map (fn [[tla balance]]
|
||||||
|
[tla (format-float bounty balance)]))
|
||||||
|
(into {})
|
||||||
|
(assoc bounty :tokens)))
|
||||||
renames {:user_name :display-name
|
renames {:user_name :display-name
|
||||||
:user_avatar_url :avatar-url
|
:user_avatar_url :avatar-url
|
||||||
:issue_title :issue-title
|
:issue_title :issue-title
|
||||||
|
@ -167,11 +179,7 @@
|
||||||
(rename-keys renames)
|
(rename-keys renames)
|
||||||
(update :value-usd usd-decimal->str)
|
(update :value-usd usd-decimal->str)
|
||||||
(update :balance-eth eth-decimal->str)
|
(update :balance-eth eth-decimal->str)
|
||||||
(update :tokens (fn [tokens]
|
update-token-values)
|
||||||
(into {}
|
|
||||||
(map (fn [[tla balance]]
|
|
||||||
[tla (format-float balance)])
|
|
||||||
tokens)))))
|
|
||||||
bounty-items)))
|
bounty-items)))
|
||||||
|
|
||||||
(defn activity-feed []
|
(defn activity-feed []
|
||||||
|
|
Loading…
Reference in New Issue