diff --git a/src/cljs/status_dapp/events.cljs b/src/cljs/status_dapp/events.cljs index 3b550d8..9afbce8 100644 --- a/src/cljs/status_dapp/events.cljs +++ b/src/cljs/status_dapp/events.cljs @@ -184,6 +184,22 @@ _ (.execute batch)] nil)))) +(re-frame/reg-event-fx + :send-2tx + (fn [{{:keys [web3]} :db} _] + (when web3 + (.sendTransaction (.-eth web3) + (clj->js {:to "0x2127edab5d08b1e11adf7ae4bae16c2b33fdf74a" + :value (.toWei web3 "0.00001" "ether")}) + (fn [e r] + (when (and (not e) r) + (.sendTransaction + (.-eth web3) + (clj->js {:to "0x2127edab5d08b1e11adf7ae4bae16c2b33fdf74a" + :value (.toWei web3 "0.00002" "ether")}) + #(println "resss" % %2)))))))) + + (re-frame/reg-event-fx :contract-call-set (fn [{{:keys [web3 contract]} :db} [_ value]] diff --git a/src/cljs/status_dapp/views.cljs b/src/cljs/status_dapp/views.cljs index 88733c6..b10cba9 100644 --- a/src/cljs/status_dapp/views.cljs +++ b/src/cljs/status_dapp/views.cljs @@ -60,7 +60,8 @@ [ui/button "Deploy simple contract" #(re-frame/dispatch [:deploy-contract (str (first accounts))])]) [react/view {:style {:margin-top 30}} [ui/button "Send one Tx in batch" #(re-frame/dispatch [:send-batch-1tx])] - [ui/button "Send two Txs in batch, 0.00001 and 0.00002 ETH" #(re-frame/dispatch [:send-batch-2tx])]] + [ui/button "Send two Txs in batch, 0.00001 and 0.00002 ETH" #(re-frame/dispatch [:send-batch-2tx])] + [ui/button "Send two Txs, one after another, 0.00001 and 0.00002 ETH" #(re-frame/dispatch [:send-2tx])]] [react/view {:style {:margin-top 30}} [ui/button "Test filters" #(re-frame/dispatch [:check-filters])]]]))