Merge branch 'develop'
This commit is contained in:
commit
5985af1344
|
@ -0,0 +1 @@
|
||||||
|
ALTER TABLE "public"."issues" ADD COLUMN "winner_login" text;
|
|
@ -310,24 +310,6 @@ AND u.id = p.user_id
|
||||||
AND i.payout_receipt IS NULL
|
AND i.payout_receipt IS NULL
|
||||||
AND i.payout_hash IS NOT NULL;
|
AND i.payout_hash IS NOT NULL;
|
||||||
|
|
||||||
|
|
||||||
-- :name get-bounty-winner :? :*
|
|
||||||
-- :doc return user_id, login and name for a user that has won and
|
|
||||||
-- been paid given bounty issue
|
|
||||||
SELECT
|
|
||||||
u.address AS payout_address,
|
|
||||||
u.login AS payee_login,
|
|
||||||
u.id AS payee_user_id,
|
|
||||||
u.name AS payee_name
|
|
||||||
FROM issues i, users u, pull_requests p
|
|
||||||
WHERE
|
|
||||||
i.issue_id = :issue_id
|
|
||||||
AND p.issue_id = i.issue_id
|
|
||||||
AND p.repo_id = i.repo_id
|
|
||||||
AND u.id = p.user_id
|
|
||||||
AND i.payout_receipt IS NOT NULL;
|
|
||||||
|
|
||||||
|
|
||||||
-- :name update-confirm-hash :! :n
|
-- :name update-confirm-hash :! :n
|
||||||
-- :doc updates issue with confirmation hash
|
-- :doc updates issue with confirmation hash
|
||||||
UPDATE issues
|
UPDATE issues
|
||||||
|
@ -342,6 +324,11 @@ SET execute_hash = :execute_hash,
|
||||||
updated = timezone('utc'::text, now())
|
updated = timezone('utc'::text, now())
|
||||||
WHERE issue_id = :issue_id;
|
WHERE issue_id = :issue_id;
|
||||||
|
|
||||||
|
-- :name update-winner-login :! :n
|
||||||
|
UPDATE issues
|
||||||
|
SET winner_login = :winner_login
|
||||||
|
WHERE issue_id = :issue_id;
|
||||||
|
|
||||||
-- :name update-payout-hash :! :n
|
-- :name update-payout-hash :! :n
|
||||||
-- :doc updates issue with payout transaction hash
|
-- :doc updates issue with payout transaction hash
|
||||||
UPDATE issues
|
UPDATE issues
|
||||||
|
@ -352,7 +339,8 @@ WHERE issue_id = :issue_id;
|
||||||
-- :name reset-payout-hash :! :n
|
-- :name reset-payout-hash :! :n
|
||||||
-- :doc sets issue's payout transaction hash to NULL
|
-- :doc sets issue's payout transaction hash to NULL
|
||||||
UPDATE issues
|
UPDATE issues
|
||||||
SET payout_hash = NULL
|
SET payout_hash = NULL,
|
||||||
|
winner_login = NULL
|
||||||
WHERE issue_id = :issue_id;
|
WHERE issue_id = :issue_id;
|
||||||
|
|
||||||
|
|
||||||
|
@ -436,6 +424,7 @@ SELECT
|
||||||
i.payout_hash AS payout_hash,
|
i.payout_hash AS payout_hash,
|
||||||
i.payout_receipt AS payout_receipt,
|
i.payout_receipt AS payout_receipt,
|
||||||
i.updated AS updated,
|
i.updated AS updated,
|
||||||
|
i.winner_login AS winner_login
|
||||||
r.repo AS repo_name,
|
r.repo AS repo_name,
|
||||||
o.address AS owner_address
|
o.address AS owner_address
|
||||||
FROM issues i, users o, repositories r
|
FROM issues i, users o, repositories r
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
<body>
|
<body>
|
||||||
<div class="news">
|
<div class="news">
|
||||||
<div class="news-inner">
|
<div class="news-inner">
|
||||||
<strong>Hey</strong> Welcome to Status Open Bounty <a href="#" target="_blank">Learn more</a>
|
<strong>Hey</strong> Welcome to Status Open Bounty <strong>$1M</strong> Bounty fund for open source projects on the way <a href="#">Learn more</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="container-wrap">
|
<div class="container-wrap">
|
||||||
|
|
|
@ -50,6 +50,11 @@
|
||||||
(jdbc/with-db-connection [con-db *db*]
|
(jdbc/with-db-connection [con-db *db*]
|
||||||
(db/update-execute-hash con-db {:issue_id issue-id :execute_hash execute-hash})))
|
(db/update-execute-hash con-db {:issue_id issue-id :execute_hash execute-hash})))
|
||||||
|
|
||||||
|
(defn update-winner-login
|
||||||
|
[issue-id login]
|
||||||
|
(jdbc/with-db-connection [con-db *db*]
|
||||||
|
(db/update-winner-login con-db {:issue_id issue-id :winner_login login})))
|
||||||
|
|
||||||
(defn update-payout-hash
|
(defn update-payout-hash
|
||||||
[issue-id payout-hash]
|
[issue-id payout-hash]
|
||||||
(jdbc/with-db-connection [con-db *db*]
|
(jdbc/with-db-connection [con-db *db*]
|
||||||
|
@ -71,11 +76,6 @@
|
||||||
(jdbc/with-db-connection [con-db *db*]
|
(jdbc/with-db-connection [con-db *db*]
|
||||||
(db/get-bounty con-db {:owner owner :repo repo :issue_number issue-number})))
|
(db/get-bounty con-db {:owner owner :repo repo :issue_number issue-number})))
|
||||||
|
|
||||||
(defn get-bounty-winner
|
|
||||||
[issue-id]
|
|
||||||
(jdbc/with-db-connection [con-db *db*]
|
|
||||||
(db/get-bounty-winner con-db {:issue_id issue-id})))
|
|
||||||
|
|
||||||
(defn open-bounty-contracts
|
(defn open-bounty-contracts
|
||||||
[]
|
[]
|
||||||
(jdbc/with-db-connection [con-db *db*]
|
(jdbc/with-db-connection [con-db *db*]
|
||||||
|
|
|
@ -126,10 +126,9 @@
|
||||||
(let [owner-bounties (bounties-db/owner-bounties (:id user))]
|
(let [owner-bounties (bounties-db/owner-bounties (:id user))]
|
||||||
(into {}
|
(into {}
|
||||||
(for [ob owner-bounties
|
(for [ob owner-bounties
|
||||||
:let [b (update ob :value_usd usd-decimal->str)
|
:let [b (update ob :value_usd usd-decimal->str)]]
|
||||||
winner (first (bounties-db/get-bounty-winner (:issue_id b)))]]
|
|
||||||
[(:issue_id b)
|
[(:issue_id b)
|
||||||
(conj (conj b {:winner winner})
|
(conj b
|
||||||
(let [claims (map
|
(let [claims (map
|
||||||
#(update % :value_usd usd-decimal->str)
|
#(update % :value_usd usd-decimal->str)
|
||||||
(bounties-db/bounty-claims (:issue_id b)))]
|
(bounties-db/bounty-claims (:issue_id b)))]
|
||||||
|
|
|
@ -97,6 +97,7 @@
|
||||||
(let [execute-hash (multisig/send-all contract-address payout-address)]
|
(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)
|
(log/info "Payout self-signed, called sign-all(" contract-address payout-address ") tx:" execute-hash)
|
||||||
(db-bounties/update-execute-hash issue-id execute-hash)
|
(db-bounties/update-execute-hash issue-id execute-hash)
|
||||||
|
(db-bounties/update-winner-login issue-id winner-login)
|
||||||
(github/update-merged-issue-comment owner
|
(github/update-merged-issue-comment owner
|
||||||
repo
|
repo
|
||||||
comment-id
|
comment-id
|
||||||
|
|
|
@ -17,8 +17,7 @@
|
||||||
issue-title :issue_title} claim
|
issue-title :issue_title} claim
|
||||||
merged? (= 1 (:pr_state claim))
|
merged? (= 1 (:pr_state claim))
|
||||||
paid? (not-empty (:payout_hash claim))
|
paid? (not-empty (:payout_hash claim))
|
||||||
winner (:winner bounty)
|
winner-login (:winner_login bounty)
|
||||||
winner-login (:payee_login winner)
|
|
||||||
bot-confirm-unmined? (empty? (:confirm_hash bounty))
|
bot-confirm-unmined? (empty? (:confirm_hash bounty))
|
||||||
confirming? (:confirming? bounty)
|
confirming? (:confirming? bounty)
|
||||||
updated (:updated bounty)]
|
updated (:updated bounty)]
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
<body>
|
<body>
|
||||||
<div class="news">
|
<div class="news">
|
||||||
<div class="news-inner">
|
<div class="news-inner">
|
||||||
<strong>Hey</strong> Welcome to Status Open Bounty <a href="#" target="_blank">Learn more</a>
|
<strong>Hey</strong> Welcome to Status Open Bounty <strong>$1M</strong> Bounty fund for open source projects on the way <a href="#">Learn more</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="container-wrap">
|
<div class="container-wrap">
|
||||||
|
|
Loading…
Reference in New Issue