Store bounty balances as decimal instead of 0x string
This commit is contained in:
parent
9cb48b5183
commit
9149a5a985
|
@ -11,12 +11,21 @@
|
|||
(defn execute
|
||||
[contract to value]
|
||||
(log/debug "multisig.execute(contract, to, value)" contract to value)
|
||||
(eth/execute (eth/eth-account) contract "0xb61d27f6" to value "0x60" "0x0" "0x0"))
|
||||
(eth/execute (eth/eth-account)
|
||||
contract
|
||||
"0xb61d27f6"
|
||||
to
|
||||
value
|
||||
"0x60"
|
||||
"0x0"
|
||||
"0x0"))
|
||||
|
||||
(defn find-confirmation-hash
|
||||
[receipt]
|
||||
(let [logs (:logs receipt)
|
||||
has-confirmation-event #(some (fn [topic] (= topic confirmation-topic)) (:topics %))
|
||||
has-confirmation-event #(some (fn [topic] (= topic
|
||||
confirmation-topic))
|
||||
(:topics %))
|
||||
confirmation-event (first (filter has-confirmation-event logs))
|
||||
confirmation-data (:data confirmation-event)]
|
||||
(when confirmation-data
|
||||
|
|
|
@ -98,8 +98,8 @@
|
|||
[(:issue_id b)
|
||||
(conj b
|
||||
(let [claims (bounties-db/bounty-claims (:issue_id b))
|
||||
balance (:balance b)]
|
||||
{:balance-eth (eth/hex->eth balance 6)
|
||||
balance-eth (:balance b)]
|
||||
{:balance-eth balance-eth ;; TODO: string expected?
|
||||
:claims claims}))]))))
|
||||
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@
|
|||
;; a string is a good idea
|
||||
(db-bounties/update-payout-receipt issue-id (str receipt)))))
|
||||
|
||||
(defn update-balance
|
||||
(defn update-balances
|
||||
[]
|
||||
(doseq [{contract-address :contract_address
|
||||
owner :login
|
||||
|
@ -82,11 +82,11 @@
|
|||
old-balance :balance
|
||||
issue-number :issue_number} (db-bounties/open-bounty-contracts)]
|
||||
(when comment-id
|
||||
(let [current-balance-hex (eth/get-balance-hex contract-address)
|
||||
current-balance-eth (eth/hex->eth current-balance-hex 8)
|
||||
(let [current-balance-eth (-> (eth/get-balance-eth contract-address 8)
|
||||
(read-string))
|
||||
issue-url (str owner "/" repo "/issues/" (str issue-number))]
|
||||
(when-not (= old-balance current-balance-hex)
|
||||
(issues/update-balance contract-address current-balance-hex)
|
||||
(when-not (= old-balance (read-string current-balance-eth))
|
||||
(issues/update-balance contract-address (read-string current-balance-eth))
|
||||
(bounties/update-bounty-comment-image issue-id
|
||||
issue-url
|
||||
contract-address
|
||||
|
@ -141,5 +141,5 @@
|
|||
update-confirm-hash
|
||||
update-payout-receipt
|
||||
self-sign-bounty
|
||||
update-balance])
|
||||
update-balances])
|
||||
:stop (stop-scheduler))
|
||||
|
|
Loading…
Reference in New Issue