[#4043] 'GOT IT' screen is not shown after signing an unsigned transaction

Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
This commit is contained in:
psdp 2018-05-08 07:07:44 +00:00 committed by Andrey Shovkoplyas
parent e74bc81ce9
commit 2d1f8989a9
No known key found for this signature in database
GPG Key ID: EAAB7C8622D860A4
3 changed files with 9 additions and 6 deletions

View File

@ -227,8 +227,9 @@
(handlers/register-handler-fx (handlers/register-handler-fx
:wallet/show-sign-transaction :wallet/show-sign-transaction
(fn [{:keys [db]} [_ id from-chat?]] (fn [{:keys [db]} [_ {:keys [id method]} from-chat?]]
{:db (assoc-in db [:wallet :send-transaction] {:id id {:db (assoc-in db [:wallet :send-transaction] {:id id
:method method
:from-chat? from-chat?}) :from-chat? from-chat?})
:dispatch [:navigate-to-modal :wallet-send-transaction-modal]})) :dispatch [:navigate-to-modal :wallet-send-transaction-modal]}))

View File

@ -104,7 +104,7 @@
(fn [_ _] (fn [_ _]
{::show-transaction-moved true})) {::show-transaction-moved true}))
(defn prepare-transaction [{:keys [id message_id args]} now] (defn prepare-transaction [{:keys [id message_id method args]} now]
;;NOTE(goranjovic): the transactions started from chat using /send command ;;NOTE(goranjovic): the transactions started from chat using /send command
;; are only in ether, so this parameter defaults to ETH ;; are only in ether, so this parameter defaults to ETH
(let [{:keys [from to value symbol data gas gasPrice] :or {symbol :ETH}} args] (let [{:keys [from to value symbol data gas gasPrice] :or {symbol :ETH}} args]
@ -114,6 +114,7 @@
:to-name (when (nil? to) :to-name (when (nil? to)
(i18n/label :t/new-contract)) (i18n/label :t/new-contract))
:symbol symbol :symbol symbol
:method method
:value (money/bignumber (or value 0)) :value (money/bignumber (or value 0))
:data data :data data
:gas (when (seq gas) :gas (when (seq gas)
@ -255,7 +256,7 @@
(fn [{{:keys [web3] :as db} :db} [_ later?]] (fn [{{:keys [web3] :as db} :db} [_ later?]]
(let [db' (assoc-in db [:wallet :send-transaction :wrong-password?] false) (let [db' (assoc-in db [:wallet :send-transaction :wrong-password?] false)
network (:network db) network (:network db)
{:keys [amount id password to symbol gas gas-price]} (get-in db [:wallet :send-transaction])] {:keys [amount id password to symbol method gas gas-price]} (get-in db [:wallet :send-transaction])]
(if id (if id
{::accept-transaction {:id id {::accept-transaction {:id id
:password password :password password
@ -272,6 +273,7 @@
:gas gas :gas gas
:gas-price gas-price :gas-price gas-price
:symbol symbol :symbol symbol
:method method
:network network}})))) :network network}}))))
(handlers/register-handler-fx (handlers/register-handler-fx

View File

@ -38,10 +38,10 @@
nil)]) ;; TODO (andrey) implement [unsigned-action unsigned-transactions-count] nil)]) ;; TODO (andrey) implement [unsigned-action unsigned-transactions-count]
(defn action-buttons [{:keys [id] :as transaction}] (defn action-buttons [transaction]
[react/view {:style styles/action-buttons} [react/view {:style styles/action-buttons}
[button/primary-button {:style {:margin-right 12} [button/primary-button {:style {:margin-right 12}
:on-press #(re-frame/dispatch [:wallet/show-sign-transaction id]) :on-press #(re-frame/dispatch [:wallet/show-sign-transaction transaction])
:accessibility-label :sign-button} :accessibility-label :sign-button}
(i18n/label :t/transactions-sign)] (i18n/label :t/transactions-sign)]
[button/secondary-button {:on-press #(on-delete-transaction transaction) [button/secondary-button {:on-press #(on-delete-transaction transaction)