From 42e407fbcfbd64c67ca6bb4f35dcbd6b7cf8b1cc Mon Sep 17 00:00:00 2001 From: mmilad75 <55688834+mmilad75@users.noreply.github.com> Date: Mon, 29 Apr 2024 15:34:39 +0100 Subject: [PATCH] Watch-only address balance should not be included in the overall balance by default #19657 (#19716) --- src/status_im/subs/wallet/wallet.cljs | 2 +- src/status_im/subs/wallet/wallet_test.cljs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/status_im/subs/wallet/wallet.cljs b/src/status_im/subs/wallet/wallet.cljs index 8852bea5d3..fa9932d910 100644 --- a/src/status_im/subs/wallet/wallet.cljs +++ b/src/status_im/subs/wallet/wallet.cljs @@ -290,7 +290,7 @@ (rf/reg-sub :wallet/aggregated-tokens - :<- [:wallet/accounts] + :<- [:wallet/accounts-without-watched-accounts] (fn [accounts] (utils/aggregate-tokens-for-all-accounts accounts))) diff --git a/src/status_im/subs/wallet/wallet_test.cljs b/src/status_im/subs/wallet/wallet_test.cljs index 05ec3b45cf..53696705ff 100644 --- a/src/status_im/subs/wallet/wallet_test.cljs +++ b/src/status_im/subs/wallet/wallet_test.cljs @@ -495,7 +495,7 @@ eth-token (some #(when (= (:symbol %) "ETH") %) result) eth-mainnet-raw-balance (get-in eth-token [:balances-per-chain 1 :raw-balance])] (is (match? 2 (count result))) - (is (money/equal-to (money/bignumber 7520) eth-mainnet-raw-balance))))) + (is (money/equal-to (money/bignumber 2520) eth-mainnet-raw-balance))))) (h/deftest-sub :wallet/aggregated-token-values-and-balance [sub-name] @@ -505,7 +505,7 @@ (assoc-in [:wallet :accounts] accounts))) (let [{:keys [formatted-balance tokens]} (rf/sub [sub-name])] (is (match? 2 (count tokens))) - (is (match? "$4506.00" formatted-balance))))) + (is (match? "$2106.00" formatted-balance))))) (h/deftest-sub :wallet/accounts-with-customization-color [sub-name] @@ -656,8 +656,8 @@ (let [result (rf/sub [sub-name]) chains (keys result)] (is (match? (count chains) 3)) - (is (match? (get result constants/ethereum-mainnet-chain-id) "$3504.00")) - (is (match? (get result constants/optimism-mainnet-chain-id) "$1002.00"))))) + (is (match? (get result constants/ethereum-mainnet-chain-id) "$1504.00")) + (is (match? (get result constants/optimism-mainnet-chain-id) "$602.00"))))) (h/deftest-sub :wallet/current-viewing-account-fiat-balance-per-chain [sub-name]