bug #2899 - using /send command always uses ETH currency

This commit is contained in:
Goran Jovic 2018-01-04 11:13:11 +01:00 committed by Goran Jović
parent 52ddccca96
commit 5a58211703
2 changed files with 10 additions and 2 deletions

View File

@ -104,7 +104,9 @@
[(re-frame/inject-cofx :now)] [(re-frame/inject-cofx :now)]
(fn [{:keys [db now]} [_ {:keys [id message_id args] :as transaction}]] (fn [{:keys [db now]} [_ {:keys [id message_id args] :as transaction}]]
(if (transaction-valid? transaction) (if (transaction-valid? transaction)
(let [{:keys [from to value symbol data gas gasPrice]} args ;NOTE(goranjovic): the transactions started from chat using /send command
; are only in ether, so this parameter defaults to ETH
(let [{:keys [from to value symbol data gas gasPrice] :or {symbol :ETH}} args
;;TODO (andrey) revisit this map later (this map from old transactions, idk if we need all these fields) ;;TODO (andrey) revisit this map later (this map from old transactions, idk if we need all these fields)
transaction {:id id transaction {:id id
:from from :from from

View File

@ -14,7 +14,13 @@
(re-frame/reg-sub ::send-transaction (re-frame/reg-sub ::send-transaction
:<- [:wallet] :<- [:wallet]
(fn [wallet] (fn [wallet]
(:send-transaction wallet))) (let [transaction (:send-transaction wallet)]
;NOTE(goranjovic): the transactions started from chat using /send command
; are only in ether, so this parameter defaults to ETH
(if (:symbol transaction)
transaction
(assoc transaction :symbol :ETH)))))
(re-frame/reg-sub :wallet.send/symbol (re-frame/reg-sub :wallet.send/symbol
:<- [::send-transaction] :<- [::send-transaction]