mirror of
https://github.com/status-im/open-bounty.git
synced 2025-01-11 18:14:25 +00:00
More logs please
This commit is contained in:
parent
59a60aa261
commit
88ed27d100
@ -1,5 +1,6 @@
|
|||||||
(ns commiteth.eth.multisig-wallet
|
(ns commiteth.eth.multisig-wallet
|
||||||
(:require [commiteth.eth.core :as eth]))
|
(:require [commiteth.eth.core :as eth]
|
||||||
|
[clojure.tools.logging :as log]))
|
||||||
|
|
||||||
(defn is-owner?
|
(defn is-owner?
|
||||||
[contract address]
|
[contract address]
|
||||||
@ -11,12 +12,15 @@
|
|||||||
|
|
||||||
(defn add-owner
|
(defn add-owner
|
||||||
[contract owner]
|
[contract owner]
|
||||||
|
(log/debug "multiowned.addOwner(contract, owner)" contract owner)
|
||||||
(eth/execute (eth/eth-account) contract "0x7065cb48" owner))
|
(eth/execute (eth/eth-account) contract "0x7065cb48" owner))
|
||||||
|
|
||||||
(defn execute
|
(defn execute
|
||||||
[contract to value]
|
[contract to value]
|
||||||
|
(log/debug "multisig.execute(contract, to, value)" contract to value)
|
||||||
(eth/execute (eth/eth-account) contract "0xb61d27f6" to value))
|
(eth/execute (eth/eth-account) contract "0xb61d27f6" to value))
|
||||||
|
|
||||||
(defn confirm
|
(defn confirm
|
||||||
[contract hash]
|
[contract hash]
|
||||||
|
(log/debug "multisig.confirm(contract, hash)")
|
||||||
(eth/execute (eth/eth-account) contract "0x797af627" hash))
|
(eth/execute (eth/eth-account) contract "0x797af627" hash))
|
||||||
|
@ -77,8 +77,8 @@
|
|||||||
(users/me (auth-params token)))
|
(users/me (auth-params token)))
|
||||||
|
|
||||||
(defn add-webhook
|
(defn add-webhook
|
||||||
[token user repo]
|
[user repo token]
|
||||||
(log/debug "adding webhook")
|
(log/debug "adding webhook" (str user "/" repo) token)
|
||||||
(repos/create-hook user repo "web"
|
(repos/create-hook user repo "web"
|
||||||
{:url (str (server-address) "/webhook")
|
{:url (str (server-address) "/webhook")
|
||||||
:content_type "json"}
|
:content_type "json"}
|
||||||
@ -87,8 +87,8 @@
|
|||||||
:active true})))
|
:active true})))
|
||||||
|
|
||||||
(defn remove-webhook
|
(defn remove-webhook
|
||||||
[token user repo hook-id]
|
[user repo hook-id token]
|
||||||
(log/debug "removing webhook")
|
(log/debug "removing webhook" (str user "/" repo) hook-id token)
|
||||||
(repos/delete-hook user repo hook-id (auth-params token)))
|
(repos/delete-hook user repo hook-id (auth-params token)))
|
||||||
|
|
||||||
(defn github-comment-hash
|
(defn github-comment-hash
|
||||||
@ -120,13 +120,13 @@
|
|||||||
(defn post-comment
|
(defn post-comment
|
||||||
[user repo issue-number balance]
|
[user repo issue-number balance]
|
||||||
(let [comment (generate-comment user repo issue-number balance)]
|
(let [comment (generate-comment user repo issue-number balance)]
|
||||||
(log/info "Comment to" (str user "/" repo) ":" comment)
|
(log/debug "Posting comment to" (str user "/" repo) ":" comment)
|
||||||
(issues/create-comment user repo issue-number comment (self-auth-params))))
|
(issues/create-comment user repo issue-number comment (self-auth-params))))
|
||||||
|
|
||||||
(defn update-comment
|
(defn update-comment
|
||||||
[user repo comment-id issue-number balance]
|
[user repo comment-id issue-number balance]
|
||||||
(let [comment (generate-comment user repo issue-number balance)]
|
(let [comment (generate-comment user repo issue-number balance)]
|
||||||
(log/info (str "Updating " user "/" repo " comment #" comment-id " with contents: " comment))
|
(log/debug (str "Updating " user "/" repo " comment #" comment-id " with contents: " comment))
|
||||||
(issues/edit-comment user repo comment-id comment (self-auth-params))))
|
(issues/edit-comment user repo comment-id comment (self-auth-params))))
|
||||||
|
|
||||||
(defn get-issue
|
(defn get-issue
|
||||||
@ -139,4 +139,5 @@
|
|||||||
|
|
||||||
(defn create-label
|
(defn create-label
|
||||||
[user repo token]
|
[user repo token]
|
||||||
|
(log/debug "creating bounty label" (str user "/" repo) token)
|
||||||
(issues/create-label user repo "bounty" "00ff00" (auth-params token)))
|
(issues/create-label user repo "bounty" "00ff00" (auth-params token)))
|
||||||
|
@ -75,9 +75,9 @@
|
|||||||
(repositories/toggle repo-id))]
|
(repositories/toggle repo-id))]
|
||||||
(if (:enabled result)
|
(if (:enabled result)
|
||||||
;; @todo: do we really want to make this call at this moment?
|
;; @todo: do we really want to make this call at this moment?
|
||||||
(let [created-hook (github/add-webhook token login repo)]
|
(let [created-hook (github/add-webhook login repo token)]
|
||||||
(log/debug "Created webhook:" created-hook)
|
(log/debug "Created webhook:" created-hook)
|
||||||
(github/create-label login repo token)
|
(github/create-label login repo token)
|
||||||
(repositories/update-hook-id repo-id (:id created-hook)))
|
(repositories/update-hook-id repo-id (:id created-hook)))
|
||||||
(github/remove-webhook token login repo (:hook_id result)))
|
(github/remove-webhook login repo (:hook_id result) token))
|
||||||
result)))))
|
result)))))
|
||||||
|
@ -6,7 +6,8 @@
|
|||||||
[commiteth.db.users :as users]
|
[commiteth.db.users :as users]
|
||||||
[commiteth.eth.core :as eth]
|
[commiteth.eth.core :as eth]
|
||||||
[ring.util.http-response :refer [ok]]
|
[ring.util.http-response :refer [ok]]
|
||||||
[clojure.string :refer [join]])
|
[clojure.string :refer [join]]
|
||||||
|
[clojure.tools.logging :as log])
|
||||||
(:import [java.lang Integer]))
|
(:import [java.lang Integer]))
|
||||||
|
|
||||||
(def label-name "bounty")
|
(def label-name "bounty")
|
||||||
@ -27,11 +28,14 @@
|
|||||||
|
|
||||||
(defn handle-issue-labeled
|
(defn handle-issue-labeled
|
||||||
[issue]
|
[issue]
|
||||||
(let [{repo-id :id} (:repository issue)
|
(let [{repo-id :id
|
||||||
|
repo :name
|
||||||
|
{user :login} :owner} (:repository issue)
|
||||||
{issue-id :id
|
{issue-id :id
|
||||||
issue-number :number
|
issue-number :number
|
||||||
issue-title :title} (:issue issue)
|
issue-title :title} (:issue issue)
|
||||||
created-issue (issues/create repo-id issue-id issue-number issue-title)]
|
created-issue (issues/create repo-id issue-id issue-number issue-title)]
|
||||||
|
(log/debug (format "Issue %s/%s/%s labeled as bounty" user repo issue-number))
|
||||||
(when (= 1 created-issue)
|
(when (= 1 created-issue)
|
||||||
(issues/update-transaction-hash issue-id (eth/deploy-contract)))))
|
(issues/update-transaction-hash issue-id (eth/deploy-contract)))))
|
||||||
|
|
||||||
@ -40,6 +44,7 @@
|
|||||||
{issue-id :id issue-number :number} :issue}]
|
{issue-id :id issue-number :number} :issue}]
|
||||||
(future
|
(future
|
||||||
(when-let [commit-id (find-commit-id user repo issue-number "referenced")]
|
(when-let [commit-id (find-commit-id user repo issue-number "referenced")]
|
||||||
|
(log/debug (format "Issue %s/%s/%s closed with commit %s" user repo issue-number commit-id))
|
||||||
(issues/close commit-id issue-id))))
|
(issues/close commit-id issue-id))))
|
||||||
|
|
||||||
(def keywords
|
(def keywords
|
||||||
@ -93,6 +98,10 @@
|
|||||||
(validate-issue-number owner repo))
|
(validate-issue-number owner repo))
|
||||||
m {:commit_id commit-id :issue_number issue-number}]
|
m {:commit_id commit-id :issue_number issue-number}]
|
||||||
(when (or commit-id issue-number)
|
(when (or commit-id issue-number)
|
||||||
|
(log/debug (format "Pull request %s/%s/%s closed with reference to %s"
|
||||||
|
login repo pr-number
|
||||||
|
(if commit-id (str "commit-id " commit-id)
|
||||||
|
(str "issue-number " issue-number))))
|
||||||
(pull-requests/create (merge m {:repo_id repo-id
|
(pull-requests/create (merge m {:repo_id repo-id
|
||||||
:pr_id id
|
:pr_id id
|
||||||
:pr_number pr-number
|
:pr_number pr-number
|
||||||
|
Loading…
x
Reference in New Issue
Block a user