handler for setting pending revocations

comment out confirm hash interceptor for now
This commit is contained in:
Rob Culliton 2018-05-07 11:07:14 -04:00
parent e9f4b0a5ac
commit 12e4d98d58
No known key found for this signature in database
GPG Key ID: 6FDEF60B3DC84D94
2 changed files with 14 additions and 10 deletions

View File

@ -19,6 +19,7 @@
::ui-model/bounty-filter-type|date nil
::ui-model/bounty-filter-type|owner nil}
::open-bounty-claims #{}
::pending-revocations #{}
:owner-bounties {}
:top-hunters []
:activity-feed []})

View File

@ -222,7 +222,7 @@
(reg-event-db
:set-owner-bounties
[commiteth.interceptors/confirm-hash-update]
;; [commiteth.interceptors/confirm-hash-update]
(fn [db [_ issues]]
(assoc db
:owner-bounties issues
@ -413,17 +413,20 @@
(str/replace x #"^0x" ""))
(reg-event-fx
:revoke-bounty-success
:set-pending-revocation
interceptors
(fn [{:keys [db]} [_ issue-id]]
{:db (update db ::db/pending-revocations #(conj % issue-id))}))
(reg-event-fx
:remove-pending-revocation
(fn [{:keys [db]} [_ issue-id]]
{:db (update db ::db/pending-revocations #(disj % issue-id))}))
(reg-event-fx
:revoke-bounty-success
(fn [{:keys [db]} [_ {:keys [issue-id owner-address contract-address confirm-hash]}]]
;; replace with dispatch of pending banner
;; confirm-payout dispatch will be called by a component
;; that subscribes to owner-bounties
;; which will get an updated confirm_hash from the scheduler
{:dispatch [:confirm-payout {:issue_id issue-id
:owner_address owner-address
:contract_address contract-address
:confirm_hash confirm-hash}]}))
{:dispatch [:set-pending-revocation issue-id]}))
(reg-event-fx
:revoke-bounty-error