mirror of
https://github.com/status-im/open-bounty.git
synced 2025-01-27 09:44:50 +00:00
pretty good representation of ONLY a confirm hash that has just been set
This commit is contained in:
parent
a6287e64b6
commit
222d334c25
@ -35,25 +35,21 @@
|
|||||||
(let [[only-before only-after both] (data/diff
|
(let [[only-before only-after both] (data/diff
|
||||||
(bounty-confirm-hashes start-ob)
|
(bounty-confirm-hashes start-ob)
|
||||||
(bounty-confirm-hashes end-ob))]
|
(bounty-confirm-hashes end-ob))]
|
||||||
;; we only care about the case where
|
|
||||||
;; any of them were nill before and set currently
|
|
||||||
;; but first lets log these to see where we're at
|
|
||||||
(println "whole before: " start-ob)
|
|
||||||
(println "whole after: " end-ob)
|
|
||||||
|
|
||||||
(println "diff before: " only-before)
|
;; making it here means ther was a change in the confirm hashes
|
||||||
(println "diff after: " only-after)
|
;; that was not the result of just setting them on page load
|
||||||
(println "equal at:" both)
|
(if only-after
|
||||||
|
|
||||||
(if only-after
|
|
||||||
;; TODO we'll need to backtrack to get the issue-id
|
;; TODO we'll need to backtrack to get the issue-id
|
||||||
;; in order to dispatch confirm payout
|
;; in order to dispatch confirm payout
|
||||||
(println "new confirm hash detected!"))
|
|
||||||
|
;; now let's see if we can get the issue-id of the one that chagned
|
||||||
context
|
(let [updated-issues (->> end-ob
|
||||||
#_(when changes-after
|
(filter (fn [[issue-id owner-bounty]]
|
||||||
(do (println "examining changes in:" event-name)
|
(let [current-confirm-hash (:confirm_hash owner-bounty)
|
||||||
(println "after:" changes-after)
|
old-confirm-hash (get-in start-ob [issue-id :confirm_hash])]
|
||||||
;; now we need to see if the update included
|
(println "old-confirm-hash is" old-confirm-hash)
|
||||||
;; confirm hash
|
(println "new confirm-hash is" current-confirm-hash)
|
||||||
))))))))
|
(and (nil? old-confirm-hash) (some? new-confirm-hash)))))
|
||||||
|
vals)]
|
||||||
|
(println "updated issues are " updated-issues))
|
||||||
|
context)))))))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user