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
c10221501a
commit
67754abaf1
|
@ -31,18 +31,20 @@
|
|||
(log/error "Unable to deploy bounty contract because"
|
||||
"repo owner has no Ethereum addres")
|
||||
(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)
|
||||
(let [transaction-hash (eth/deploy-contract owner-address)]
|
||||
(if (nil? transaction-hash)
|
||||
(log/error "Failed to deploy contract to" owner-address)
|
||||
(log/info "Contract deployed, transaction-hash:"
|
||||
transaction-hash ))
|
||||
(do
|
||||
(log/info "Contract deployed, 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))))
|
||||
(log/debug "Issue already exists in DB, ignoring"))))
|
||||
|
||||
|
|
|
@ -182,10 +182,21 @@
|
|||
[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
|
||||
[owner repo issue-number]
|
||||
(md-image "Contract deploying" (str (server-address) "/img/deploying_contract.png")))
|
||||
[owner repo issue-number tx-id]
|
||||
(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 []
|
||||
(str "Network: " (if (on-testnet?)
|
||||
|
@ -225,8 +236,8 @@
|
|||
|
||||
|
||||
(defn post-deploying-comment
|
||||
[owner repo issue-number]
|
||||
(let [comment (generate-deploying-comment owner repo issue-number)]
|
||||
[owner repo issue-number tx-id]
|
||||
(let [comment (generate-deploying-comment owner repo issue-number tx-id)]
|
||||
(log/debug "Posting comment to" (str owner "/" repo "/" issue-number) ":" comment)
|
||||
(issues/create-comment owner repo issue-number comment (self-auth-params))))
|
||||
|
||||
|
|
Loading…
Reference in New Issue