Include link to etherscan.io for deployment transaction
* include a link to etherscan.io for a bounty contract's "deploying" comment Fixes: #99
This commit is contained in:
parent
4c35a20feb
commit
eb820525bc
|
@ -31,18 +31,20 @@
|
||||||
(log/error "Unable to deploy bounty contract because"
|
(log/error "Unable to deploy bounty contract because"
|
||||||
"repo owner has no Ethereum addres")
|
"repo owner has no Ethereum addres")
|
||||||
(do
|
(do
|
||||||
(->> (github/post-deploying-comment owner
|
|
||||||
repo
|
|
||||||
issue-number)
|
|
||||||
:id
|
|
||||||
(issues/update-comment-id issue-id))
|
|
||||||
(log/debug "Posting dep")
|
|
||||||
(log/debug "deploying contract to " owner-address)
|
(log/debug "deploying contract to " owner-address)
|
||||||
(let [transaction-hash (multisig/deploy-multisig owner-address)]
|
(let [transaction-hash (multisig/deploy-multisig owner-address)]
|
||||||
(if (nil? transaction-hash)
|
(if (nil? transaction-hash)
|
||||||
(log/error "Failed to deploy contract to" owner-address)
|
(log/error "Failed to deploy contract to" owner-address)
|
||||||
|
(do
|
||||||
(log/info "Contract deployed, transaction-hash:"
|
(log/info "Contract deployed, transaction-hash:"
|
||||||
transaction-hash ))
|
transaction-hash)
|
||||||
|
(->> (github/post-deploying-comment owner
|
||||||
|
repo
|
||||||
|
issue-number
|
||||||
|
transaction-hash)
|
||||||
|
:id
|
||||||
|
(issues/update-comment-id issue-id)))
|
||||||
|
)
|
||||||
(issues/update-transaction-hash issue-id transaction-hash))))
|
(issues/update-transaction-hash issue-id transaction-hash))))
|
||||||
(log/debug "Issue already exists in DB, ignoring"))))
|
(log/debug "Issue already exists in DB, ignoring"))))
|
||||||
|
|
||||||
|
|
|
@ -182,10 +182,21 @@
|
||||||
[alt src]
|
[alt src]
|
||||||
(str "!" (md-url alt src)))
|
(str "!" (md-url alt src)))
|
||||||
|
|
||||||
|
(defn etherscan-tx-url [tx-id]
|
||||||
|
(str "https://"
|
||||||
|
(when (on-testnet?) "ropsten.")
|
||||||
|
"etherscan.io/tx/" tx-id))
|
||||||
|
|
||||||
(defn generate-deploying-comment
|
(defn generate-deploying-comment
|
||||||
[owner repo issue-number]
|
[owner repo issue-number tx-id]
|
||||||
(md-image "Contract deploying" (str (server-address) "/img/deploying_contract.png")))
|
(let [deploying-image (md-image
|
||||||
|
"Contract deploying"
|
||||||
|
(str (server-address) "/img/deploying_contract.png"))
|
||||||
|
tx-link (md-url tx-id (etherscan-tx-url tx-id))]
|
||||||
|
(format (str "%s\n"
|
||||||
|
"Transaction: %s\n")
|
||||||
|
deploying-image
|
||||||
|
tx-link)))
|
||||||
|
|
||||||
(defn network-text []
|
(defn network-text []
|
||||||
(str "Network: " (if (on-testnet?)
|
(str "Network: " (if (on-testnet?)
|
||||||
|
@ -244,8 +255,8 @@
|
||||||
|
|
||||||
|
|
||||||
(defn post-deploying-comment
|
(defn post-deploying-comment
|
||||||
[owner repo issue-number]
|
[owner repo issue-number tx-id]
|
||||||
(let [comment (generate-deploying-comment owner repo issue-number)]
|
(let [comment (generate-deploying-comment owner repo issue-number tx-id)]
|
||||||
(log/debug "Posting comment to" (str owner "/" repo "/" issue-number) ":" comment)
|
(log/debug "Posting comment to" (str owner "/" repo "/" issue-number) ":" comment)
|
||||||
(issues/create-comment owner repo issue-number comment (self-auth-params))))
|
(issues/create-comment owner repo issue-number comment (self-auth-params))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue