diff --git a/src/clj/commiteth/github/core.clj b/src/clj/commiteth/github/core.clj index 4e11666..c20d7ce 100644 --- a/src/clj/commiteth/github/core.clj +++ b/src/clj/commiteth/github/core.clj @@ -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" diff --git a/src/clj/commiteth/scheduler.clj b/src/clj/commiteth/scheduler.clj index fbb16af..4f1e26b 100644 --- a/src/clj/commiteth/scheduler.clj +++ b/src/clj/commiteth/scheduler.clj @@ -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."