hash is not applicable for unsigned transactions details

This commit is contained in:
Eric Dvorsak 2017-10-10 19:06:41 +02:00 committed by Roman Volosovskyi
parent 833072087f
commit 5fcf482ef0
1 changed files with 9 additions and 10 deletions

View File

@ -33,11 +33,11 @@
(defn format-unsigned-transaction [{:keys [id] :as transaction}] (defn format-unsigned-transaction [{:keys [id] :as transaction}]
(assoc transaction (assoc transaction
:type :unsigned :type :unsigned
:confirmations 0 :confirmations 0
:symbol "ETH" :symbol "ETH"
;; TODO (andrey) revisit this, we shouldn't set not hash value to the hash field ;; TODO (andrey) revisit this, we shouldn't set not hash value to the hash field
:hash id)) :hash id))
(reg-sub :wallet/unsigned-transactions (reg-sub :wallet/unsigned-transactions
(fn [db] (fn [db]
@ -124,7 +124,8 @@
:cost (i18n/label :not-applicable) :cost (i18n/label :not-applicable)
:gas-limit (i18n/label :not-applicable) :gas-limit (i18n/label :not-applicable)
:gas-used (i18n/label :not-applicable) :gas-used (i18n/label :not-applicable)
:nonce (i18n/label :not-applicable)} :nonce (i18n/label :not-applicable)
:hash (i18n/label :not-applicable)}
{:cost (money/wei->str :eth (money/fee-value gas-used gas-price)) {:cost (money/wei->str :eth (money/fee-value gas-used gas-price))
:url (transactions/get-transaction-details-url network hash)}) :url (transactions/get-transaction-details-url network hash)})
;; TODO (yenda) proper wallet logic when wallet switching is implemented ;; TODO (yenda) proper wallet logic when wallet switching is implemented
@ -146,16 +147,14 @@
100 100
(* 100 (/ confirmations max-confirmations)))))) (* 100 (/ confirmations max-confirmations))))))
(reg-sub (reg-sub :contacts-by-address
:contacts-by-address
(fn [db] (fn [db]
(into {} (map (fn [[_ {:keys [address] :as contact}]] (into {} (map (fn [[_ {:keys [address] :as contact}]]
(when address (when address
[address contact])) [address contact]))
(:contacts/contacts db))))) (:contacts/contacts db)))))
(reg-sub (reg-sub :contact-by-address
:contact-by-address
:<- [:contacts-by-address] :<- [:contacts-by-address]
(fn [contacts [_ address]] (fn [contacts [_ address]]
(let [address' (when address (let [address' (when address