better logging around payout receipt interceptor

This commit is contained in:
Rob Culliton 2018-05-08 14:34:01 -04:00
parent 08d56400ad
commit c57a6a1a63
No known key found for this signature in database
GPG Key ID: 6FDEF60B3DC84D94
2 changed files with 11 additions and 5 deletions

View File

@ -222,7 +222,8 @@
(reg-event-db (reg-event-db
:set-owner-bounties :set-owner-bounties
;; [commiteth.interceptors/confirm-hash-update] [commiteth.interceptors/watch-confirm-hash
commiteth.interceptors/watch-payout-receipt]
(fn [db [_ issues]] (fn [db [_ issues]]
(assoc db (assoc db
:owner-bounties issues :owner-bounties issues
@ -420,6 +421,7 @@
(reg-event-fx (reg-event-fx
:remove-pending-revocation :remove-pending-revocation
interceptors
(fn [{:keys [db]} [_ issue-id]] (fn [{:keys [db]} [_ issue-id]]
{:db (update db ::db/pending-revocations #(disj % issue-id))})) {:db (update db ::db/pending-revocations #(disj % issue-id))}))

View File

@ -9,12 +9,14 @@
vals vals
(->> (map #(field-name %))))) (->> (map #(field-name %)))))
(defn filter-updated-bounties [field-name new-bounties old-bounties] (defn filter-updated-bounties [field-name old-bounties new-bounties]
"filters collection of bounties to only those with a field that has been recently set" "filters collection of bounties to only those with a field that has been recently set"
(filter (fn [[issue-id owner-bounty]] (filter (fn [[issue-id owner-bounty]]
(let [new-confirm-hash (field-name owner-bounty) (let [new-field-value (field-name owner-bounty)
old-confirm-hash (get-in old-bounties [issue-id field-name])] old-field-value (get-in old-bounties [issue-id field-name])]
(and (nil? old-confirm-hash) (some? new-confirm-hash)))) (println "old value for " field-name " is " old-field-value)
(println "new value for " field-name "is " new-field-value)
(and (nil? old-field-value) (some? new-field-value))))
new-bounties)) new-bounties))
(defn dispatch-confirm-payout [bounty] (defn dispatch-confirm-payout [bounty]
@ -43,6 +45,7 @@
:id :watch-confirm-hash :id :watch-confirm-hash
:after (fn confirm-hash-update-after :after (fn confirm-hash-update-after
[context] [context]
(println "watch confirm hash interceptor...")
(let [event-name (-> context (let [event-name (-> context
:coeffects :coeffects
:event :event
@ -83,6 +86,7 @@
:id :watch-payout-receipt :id :watch-payout-receipt
:after (fn payout-receipt-update-after :after (fn payout-receipt-update-after
[context] [context]
(println "watch payout receipt interceptor...")
(let [event-name (-> context (let [event-name (-> context
:coeffects :coeffects
:event :event