From 63da0ffb50bf931c3143aa508020b52c8a6da2e5 Mon Sep 17 00:00:00 2001 From: Goran Jovic Date: Thu, 21 Jun 2018 14:59:53 +0200 Subject: [PATCH] bug #4832 - not showing erc721 in transaction history as if it was erc20 Signed-off-by: Igor Mandrigin --- src/status_im/utils/ethereum/erc20.cljs | 47 +++++++++++++------------ 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/src/status_im/utils/ethereum/erc20.cljs b/src/status_im/utils/ethereum/erc20.cljs index 716f1950f4..12b54612fb 100644 --- a/src/status_im/utils/ethereum/erc20.cljs +++ b/src/status_im/utils/ethereum/erc20.cljs @@ -87,36 +87,37 @@ (keep identity (for [transfer transfers] (if-let [token (->> transfer :address (tokens/address->token chain))] - [(:transactionHash transfer) - {:block (-> block-info :number str) - :hash (:transactionHash transfer) - :symbol (:symbol token) - :from (-> transfer :topics second remove-padding) - :to (-> transfer :topics last remove-padding) - :value (-> transfer :data ethereum/hex->bignumber) - :type direction + (when-not (:nft? token) + [(:transactionHash transfer) + {:block (-> block-info :number str) + :hash (:transactionHash transfer) + :symbol (:symbol token) + :from (-> transfer :topics second remove-padding) + :to (-> transfer :topics last remove-padding) + :value (-> transfer :data ethereum/hex->bignumber) + :type direction - :confirmations (str (- current-block-number (-> transfer :blockNumber ethereum/hex->int))) + :confirmations (str (- current-block-number (-> transfer :blockNumber ethereum/hex->int))) - :gas-price nil - :nonce nil - :data nil + :gas-price nil + :nonce nil + :data nil - :gas-limit nil - :timestamp (-> block-info :timestamp (* 1000) str) + :gas-limit nil + :timestamp (-> block-info :timestamp (* 1000) str) - :gas-used nil + :gas-used nil - ;; NOTE(goranjovic) - metadata on the type of token: contains name, symbol, decimas, address. - :token token + ;; NOTE(goranjovic) - metadata on the type of token: contains name, symbol, decimas, address. + :token token - ;; NOTE(goranjovic) - if an event has been emitted, we can say there was no error - :error? false + ;; NOTE(goranjovic) - if an event has been emitted, we can say there was no error + :error? false - ;; NOTE(goranjovic) - just a flag we need when we merge this entry with the existing entry in - ;; the app, e.g. transaction info with gas details, or a previous transfer entry with old - ;; confirmations count. - :transfer true}]))))) + ;; NOTE(goranjovic) - just a flag we need when we merge this entry with the existing entry in + ;; the app, e.g. transaction info with gas details, or a previous transfer entry with old + ;; confirmations count. + :transfer true}])))))) (defn add-block-info [web3 current-block-number chain direction result success-fn] (let [transfers-by-block (group-by :blockNumber result)]