Skip to content

Commit

Permalink
remove flag
Browse files Browse the repository at this point in the history
  • Loading branch information
mmilad75 committed Apr 26, 2024
1 parent 1a3d4b9 commit 118c94b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
2 changes: 0 additions & 2 deletions src/status_im/config.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -133,5 +133,3 @@
(def community-accounts-selection-enabled? true)
(def fetch-messages-enabled? (enabled? (get-config :FETCH_MESSAGES_ENABLED "1")))
(def test-networks-enabled? (enabled? (get-config :TEST_NETWORKS_ENABLED "0")))

(def include-watch-only-balance-in-total? false)
7 changes: 2 additions & 5 deletions src/status_im/subs/wallet/wallet.cljs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
(ns status-im.subs.wallet.wallet
(:require [clojure.string :as string]
[re-frame.core :as rf]
[status-im.config :as config]
[status-im.contexts.wallet.common.utils :as utils]
[status-im.subs.wallet.add-account.address-to-watch]
[utils.number]))
Expand Down Expand Up @@ -291,11 +290,9 @@

(rf/reg-sub
:wallet/aggregated-tokens
:<- [:wallet/accounts]
:<- [:wallet/accounts-without-watched-accounts]
(fn [[all-accounts owned-accounts]]
(let [accounts (if config/include-watch-only-balance-in-total? all-accounts owned-accounts)]
(utils/aggregate-tokens-for-all-accounts accounts))))
(fn [accounts]
(utils/aggregate-tokens-for-all-accounts accounts)))

(rf/reg-sub
:wallet/aggregated-tokens-in-selected-networks
Expand Down
10 changes: 3 additions & 7 deletions src/status_im/subs/wallet/wallet_test.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
(:require
[cljs.test :refer [is testing use-fixtures]]
[re-frame.db :as rf-db]
[status-im.config :as config]
[status-im.constants :as constants]
[status-im.contexts.wallet.db :as db]
[status-im.subs.root]
Expand Down Expand Up @@ -506,8 +505,7 @@
(assoc-in [:wallet :accounts] accounts)))
(let [{:keys [formatted-balance tokens]} (rf/sub [sub-name])]
(is (match? 2 (count tokens)))
(is (match? (if config/include-watch-only-balance-in-total? "$4506.00" "$2106.00")
formatted-balance)))))
(is (match? "$2106.00" formatted-balance)))))

(h/deftest-sub :wallet/accounts-with-customization-color
[sub-name]
Expand Down Expand Up @@ -658,10 +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)
(if config/include-watch-only-balance-in-total? "$3504.00" "$1504.00")))
(is (match? (get result constants/optimism-mainnet-chain-id)
(if config/include-watch-only-balance-in-total? "$1002.00" "$602.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]
Expand Down

0 comments on commit 118c94b

Please sign in to comment.