pretty good representation of ONLY a confirm hash that has just been set

This commit is contained in:
Rob Culliton 2018-05-04 16:33:33 -04:00
parent a6287e64b6
commit 222d334c25
No known key found for this signature in database
GPG Key ID: 6FDEF60B3DC84D94

View File

@ -35,25 +35,21 @@
(let [[only-before only-after both] (data/diff
(bounty-confirm-hashes start-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)
(println "diff after: " only-after)
(println "equal at:" both)
(if only-after
;; making it here means ther was a change in the confirm hashes
;; that was not the result of just setting them on page load
(if only-after
;; TODO we'll need to backtrack to get the issue-id
;; in order to dispatch confirm payout
(println "new confirm hash detected!"))
context
#_(when changes-after
(do (println "examining changes in:" event-name)
(println "after:" changes-after)
;; now we need to see if the update included
;; confirm hash
))))))))
;; in order to dispatch confirm payout
;; now let's see if we can get the issue-id of the one that chagned
(let [updated-issues (->> end-ob
(filter (fn [[issue-id owner-bounty]]
(let [current-confirm-hash (:confirm_hash owner-bounty)
old-confirm-hash (get-in start-ob [issue-id :confirm_hash])]
(println "old-confirm-hash is" old-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)))))))