Merge branch 'develop'

This commit is contained in:
Teemu Patja 2017-11-09 16:27:55 +02:00
commit aab5534c74
No known key found for this signature in database
GPG Key ID: F5B7035E6580FD4C
2 changed files with 22 additions and 7 deletions

View File

@ -243,12 +243,14 @@
(defn generate-merged-comment
[contract-address eth-balance-str tokens winner-login]
[contract-address eth-balance-str tokens winner-login winner-address-missing?]
(format (str "Balance: %s ETH\n"
(token-balances-text tokens)
(contract-addr-text contract-address)
(network-text)
"Status: pending maintainer confirmation\n"
(str "Status: " (if winner-address-missing?
"Pending user to save ETH address"
"Pending maintainer confirmation") "\n")
"Winner: %s\n")
eth-balance-str winner-login))
@ -303,14 +305,17 @@
(assoc (self-auth-params) :body comment))]
(tentacles/safe-parse (http/request req)))))
(defn update-merged-issue-comment
"Update comment for a bounty issue with winning claim (waiting to be
signed off by maintainer)"
[owner repo comment-id contract-address eth-balance-str tokens winner-login]
signed off by maintainer/user ETH address missing)"
[owner repo comment-id contract-address eth-balance-str tokens winner-login winner-address-missing?]
(let [comment (generate-merged-comment contract-address
eth-balance-str
tokens
winner-login)]
winner-login
winner-address-missing?)]
(log/debug (str "Updating merged bounty issue (" owner "/" repo ")"
" comment#" comment-id " with contents: " comment))
(let [req (make-patch-request "repos/%s/%s/issues/comments/%s"

View File

@ -93,7 +93,16 @@
winner-login :winner_login} (db-bounties/pending-bounties)
:let [value (eth/get-balance-hex contract-address)]]
(if (empty? payout-address)
(log/error "Cannot sign pending bounty - winner has no payout address")
(do
(log/error "Cannot sign pending bounty - winner has no payout address")
(github/update-merged-issue-comment owner
repo
comment-id
contract-address
(eth-decimal->str balance-eth)
tokens
winner-login
true))
(let [execute-hash (multisig/send-all contract-address payout-address)]
(log/info "Payout self-signed, called sign-all(" contract-address payout-address ") tx:" execute-hash)
(db-bounties/update-execute-hash issue-id execute-hash)
@ -104,7 +113,8 @@
contract-address
(eth-decimal->str balance-eth)
tokens
winner-login)))))
winner-login
false)))))
(defn update-confirm-hash
"Gets transaction receipt for each pending payout and updates DB confirm_hash with tranaction ID of commiteth bot account's confirmation."