From 71186c8a8fbcd4e32f3a16af06c3ff544ba08740 Mon Sep 17 00:00:00 2001 From: Volodymyr Kozieiev Date: Fri, 6 Dec 2024 18:17:32 +0000 Subject: [PATCH] cleanup --- .carve_ignore | 1 - .../status_im/react_native/resources.cljs | 8 +- src/legacy/status_im/subs/ens.cljs | 94 +------------------ .../status_im/ui/components/action_sheet.cljs | 2 +- .../ui/screens/browser/eip3085/sheet.cljs | 57 ----------- .../ui/screens/browser/eip3326/sheet.cljs | 68 -------------- src/legacy/status_im/utils/core.cljc | 15 --- src/legacy/status_im/utils/utils_test.cljs | 8 -- .../components/settings/category/style.cljs | 16 ---- .../contexts/chat/group/common/style.cljs | 7 -- .../chat/messenger/composer/events.cljs | 42 --------- .../messenger/composer/mentions/style.cljs | 12 --- src/status_im/subs/wallet/buy.cljs | 10 -- src/utils/collection.cljs | 5 - src/utils/collection_test.cljs | 12 +++ src/utils/money.cljs | 79 ---------------- src/utils/number.cljs | 3 +- 17 files changed, 16 insertions(+), 423 deletions(-) delete mode 100644 src/legacy/status_im/ui/screens/browser/eip3085/sheet.cljs delete mode 100644 src/legacy/status_im/ui/screens/browser/eip3326/sheet.cljs create mode 100644 src/utils/collection_test.cljs diff --git a/.carve_ignore b/.carve_ignore index 4c31c0d303..8a92d91567 100644 --- a/.carve_ignore +++ b/.carve_ignore @@ -149,7 +149,6 @@ legacy.status-im.desktop.core/app-root legacy.status-im.desktop.core/init legacy.status-im.chat.models-test/test-db legacy.status-im.ui.components.spacing/padding-vertical -legacy.status-im.utils.money/percent-change utils.debounce/clear-all legacy.status-im.transport.db/create-chat legacy.status-im.utils.priority-map/priority-map diff --git a/src/legacy/status_im/react_native/resources.cljs b/src/legacy/status_im/react_native/resources.cljs index 111f5be215..bd4d7c20ab 100644 --- a/src/legacy/status_im/react_native/resources.cljs +++ b/src/legacy/status_im/react_native/resources.cljs @@ -1,6 +1,4 @@ -(ns legacy.status-im.react-native.resources - (:require - [legacy.status-im.ui.components.colors :as colors])) +(ns legacy.status-im.react-native.resources) (def ui {:empty-chats-header (js/require "../resources/images/ui/empty-chats-header.png") @@ -52,10 +50,6 @@ :no-contacts (js/require "../resources/images/ui/no-contacts.png") :no-contacts-dark (js/require "../resources/images/ui/no-contacts-dark.png")}) -(defn get-theme-image - [k] - (get ui (when (colors/dark?) (keyword (str (name k) "-dark"))) (get ui k))) - (def loaded-images (atom {})) (defn get-image diff --git a/src/legacy/status_im/subs/ens.cljs b/src/legacy/status_im/subs/ens.cljs index 842fd1704d..23ed8d09fe 100644 --- a/src/legacy/status_im/subs/ens.cljs +++ b/src/legacy/status_im/subs/ens.cljs @@ -1,64 +1,6 @@ (ns legacy.status-im.subs.ens (:require - [clojure.string :as string] - [legacy.status-im.ens.core :as ens] - [re-frame.core :as re-frame] - [utils.address :as address] - [utils.ethereum.chain :as chain] - [utils.money :as money])) - -(re-frame/reg-sub - :ens/preferred-name - :<- [:profile/profile] - (fn [multiaccount] - (:preferred-name multiaccount))) - -(re-frame/reg-sub - :ens/search-screen - :<- [:ens/registration] - (fn [{:keys [custom-domain? username state]}] - {:state state - :username username - :custom-domain? custom-domain?})) - -(defn- ens-amount-label - [chain-id] - (str (ens/registration-cost chain-id) - (case chain-id - 3 " STT" - 1 " SNT" - ""))) - -(re-frame/reg-sub - :ens/checkout-screen - :<- [:ens/registration] - :<- [:chain-keyword] - :<- [:multiaccount/default-account] - :<- [:multiaccount/public-key] - :<- [:chain-id] - :<- [:wallet-legacy] - (fn [[{:keys [custom-domain? username address]} - chain default-account public-key chain-id wallet]] - (let [address (or address (address/normalized-hex (:address default-account))) - balance (get-in wallet [:accounts address :balance])] - {:address address - :username username - :public-key public-key - :custom-domain? custom-domain? - :chain chain - :amount-label (ens-amount-label chain-id) - :sufficient-funds? (money/sufficient-funds? - (money/formatted->internal (money/bignumber 10) - (chain/chain-keyword->snt-symbol chain) - 18) - (get balance (chain/chain-keyword->snt-symbol chain)))}))) - -(re-frame/reg-sub - :ens/confirmation-screen - :<- [:ens/registration] - (fn [{:keys [username state]}] - {:state state - :username username})) + [re-frame.core :as re-frame])) (re-frame/reg-sub :ens/current-names @@ -66,37 +8,3 @@ :<- [:chain-id] (fn [[all-names chain-id]] (get all-names chain-id))) - -(re-frame/reg-sub - :ens.name/screen - :<- [:get-screen-params :ens-name-details] - :<- [:ens/current-names] - (fn [[name ens]] - (let [{:keys [address public-key expiration-date releasable?]} (get ens name) - pending? (nil? address)] - (cond-> {:name name - :custom-domain? (not (string/ends-with? name ".stateofus.eth"))} - pending? - (assoc :pending? true) - (not pending?) - (assoc :address address - :public-key public-key - :releasable? releasable? - :expiration-date expiration-date))))) - -(re-frame/reg-sub - :ens.main/screen - :<- [:ens/current-names] - :<- [:profile/profile] - :<- [:ens/preferred-name] - :<- [:ens/registrations] - (fn [[names multiaccount preferred-name registrations]] - (let [not-in-progress-names (reduce (fn [acc {:keys [username custom-domain?]}] - (let [full-name (ens/fullname custom-domain? username)] - (remove #(= % full-name) acc))) - (keys names) - (vals registrations))] - {:names not-in-progress-names - :profile/profile multiaccount - :preferred-name preferred-name - :registrations registrations}))) diff --git a/src/legacy/status_im/ui/components/action_sheet.cljs b/src/legacy/status_im/ui/components/action_sheet.cljs index 76ae3c3313..9e792750cd 100644 --- a/src/legacy/status_im/ui/components/action_sheet.cljs +++ b/src/legacy/status_im/ui/components/action_sheet.cljs @@ -1,7 +1,7 @@ (ns legacy.status-im.ui.components.action-sheet (:require ["react-native" :refer (ActionSheetIOS)] - [legacy.status-im.utils.core :as utils] + [utils.collection :as utils] [utils.i18n :as i18n])) (defn- callback diff --git a/src/legacy/status_im/ui/screens/browser/eip3085/sheet.cljs b/src/legacy/status_im/ui/screens/browser/eip3085/sheet.cljs deleted file mode 100644 index 0b7dcf0647..0000000000 --- a/src/legacy/status_im/ui/screens/browser/eip3085/sheet.cljs +++ /dev/null @@ -1,57 +0,0 @@ -(ns legacy.status-im.ui.screens.browser.eip3085.sheet - (:require - [legacy.status-im.ui.components.chat-icon.screen :as chat-icon.screen] - [legacy.status-im.ui.components.colors :as colors] - [legacy.status-im.ui.components.core :as quo] - [legacy.status-im.ui.components.icons.icons :as icons] - [legacy.status-im.ui.components.react :as react] - [legacy.status-im.ui.screens.browser.styles :as styles] - [re-frame.core :as re-frame] - [utils.i18n :as i18n]) - (:require-macros [legacy.status-im.utils.views :as views])) - -(views/defview permissions-panel - [_dapp-name message-id params] - (views/letsubs [{:keys [dapp? dapp]} [:get-current-browser]] - [react/view {} - [react/view styles/permissions-panel-icons-container - (if dapp? - [chat-icon.screen/dapp-icon-permission dapp 40] - [react/view styles/permissions-panel-dapp-icon-container - [icons/icon :main-icons/dapp {:color colors/gray}]]) - [react/view {:margin-left 8 :margin-right 4} - [react/view styles/dot]] - [react/view {:margin-right 4} - [react/view styles/dot]] - [react/view {:margin-right 8} - [react/view styles/dot]] - [react/view styles/permissions-panel-ok-icon-container - [icons/icon :tiny-icons/tiny-check styles/permissions-panel-ok-ico]] - [react/view {:margin-left 8 :margin-right 4} - [react/view styles/dot]] - [react/view {:margin-right 4} - [react/view styles/dot]] - [react/view {:margin-right 8} - [react/view styles/dot]] - [react/view styles/permissions-panel-wallet-icon-container - [icons/icon :main-icons/wallet {:color colors/white}]]] - [react/view - {:style {:flex-direction :row - :justify-content :center - :margin-horizontal 8 - :margin-top 24}} - [react/view - {:flex 1 - :margin-horizontal 8} - [quo/button - {:theme :negative - :on-press #(re-frame/dispatch [:eip3085.ui/dapp-permission-denied message-id params])} - (i18n/label :t/deny)]] - [react/view - {:flex 1 - :margin-horizontal 8} - [quo/button - {:theme :positive - :style {:margin-horizontal 8} - :on-press #(re-frame/dispatch [:eip3085.ui/dapp-permission-allowed message-id params])} - (i18n/label :t/allow)]]]])) diff --git a/src/legacy/status_im/ui/screens/browser/eip3326/sheet.cljs b/src/legacy/status_im/ui/screens/browser/eip3326/sheet.cljs deleted file mode 100644 index cc26237573..0000000000 --- a/src/legacy/status_im/ui/screens/browser/eip3326/sheet.cljs +++ /dev/null @@ -1,68 +0,0 @@ -(ns legacy.status-im.ui.screens.browser.eip3326.sheet - (:require - [legacy.status-im.network.core :as network] - [legacy.status-im.ui.components.chat-icon.screen :as chat-icon.screen] - [legacy.status-im.ui.components.colors :as colors] - [legacy.status-im.ui.components.core :as quo] - [legacy.status-im.ui.components.icons.icons :as icons] - [legacy.status-im.ui.components.react :as react] - [legacy.status-im.ui.screens.browser.styles :as styles] - [re-frame.core :as re-frame] - [utils.debounce :as debounce] - [utils.i18n :as i18n]) - (:require-macros [legacy.status-im.utils.views :as views])) - -(views/defview permissions-panel - [dapp-name message-id {:keys [network-from network-to target-network-id] :as params}] - (views/letsubs [{:keys [dapp? dapp]} [:get-current-browser]] - [react/view {} - [react/view styles/permissions-panel-icons-container - (if dapp? - [chat-icon.screen/dapp-icon-permission dapp 40] - [react/view styles/permissions-panel-dapp-icon-container - [icons/icon :main-icons/dapp {:color colors/gray}]]) - [react/view {:margin-left 8 :margin-right 4} - [react/view styles/dot]] - [react/view {:margin-right 4} - [react/view styles/dot]] - [react/view {:margin-right 8} - [react/view styles/dot]] - [react/view styles/permissions-panel-ok-icon-container - [icons/icon :tiny-icons/tiny-check styles/permissions-panel-ok-ico]] - [react/view {:margin-left 8 :margin-right 4} - [react/view styles/dot]] - [react/view {:margin-right 4} - [react/view styles/dot]] - [react/view {:margin-right 8} - [react/view styles/dot]] - [react/view styles/permissions-panel-wallet-icon-container - [icons/icon :main-icons/wallet {:color colors/white}]]] - [react/text {:style styles/permissions-panel-title-label :number-of-lines 2} - (str "\"" dapp-name "\" Allow this site to switch the network?")] - [react/text {:style styles/permissions-panel-description-label :number-of-lines 5} - (str "This will switch the selected network within Status to a previously added network:\n" - network-from - " -> " - network-to - "\nit will require login/logout")] - [react/view - {:style {:flex-direction :row - :justify-content :center - :margin-horizontal 8 - :margin-top 24}} - [react/view - {:flex 1 - :margin-horizontal 8} - [quo/button - {:theme :negative - :on-press #(re-frame/dispatch [:eip3326.ui/dapp-permission-denied message-id params])} - (i18n/label :t/deny)]] - [react/view - {:flex 1 - :margin-horizontal 8} - [quo/button - {:theme :positive - :style {:margin-horizontal 8} - :on-press #(debounce/throttle-and-dispatch [::network/connect-network-pressed target-network-id] - 1000)} - (i18n/label :t/allow)]]]])) diff --git a/src/legacy/status_im/utils/core.cljc b/src/legacy/status_im/utils/core.cljc index 4a7d7abc38..60f00bb30d 100644 --- a/src/legacy/status_im/utils/core.cljc +++ b/src/legacy/status_im/utils/core.cljc @@ -18,18 +18,3 @@ s)) (def truncate-str (memoize truncate-str-memo)) - -(defn first-index - "Returns first index in coll where predicate on coll element is truthy" - [pred coll] - (->> coll - (keep-indexed (fn [idx e] - (when (pred e) - idx))) - first)) - -(defn index-by - "Given a collection and a unique key function, returns a map that indexes the collection. - Similar to group-by except that the map values are single objects (depends on key uniqueness)." - [k coll] - (into {} (map #(vector (k %) %) coll))) diff --git a/src/legacy/status_im/utils/utils_test.cljs b/src/legacy/status_im/utils/utils_test.cljs index 6e51140cc9..59e4adf85a 100644 --- a/src/legacy/status_im/utils/utils_test.cljs +++ b/src/legacy/status_im/utils/utils_test.cljs @@ -11,14 +11,6 @@ (is (= (u/truncate-str "Long string" 11) "Long string")) ; threshold is the same as string length (is (= (u/truncate-str "Long string" 20) "Long string"))) ; threshold is more then string length -(deftest first-index-test - (is (= 2 - (u/first-index (partial = :test) - '(:a :b :test :c :test)))) - (is (= nil - (u/first-index (partial = :test) - '(:a :b :c))))) - (deftest format-decimals-test (is (= "1" (uu/format-decimals 1 5))) (is (= "1.1" (uu/format-decimals 1.1 5))) diff --git a/src/quo/components/settings/category/style.cljs b/src/quo/components/settings/category/style.cljs index ee59a5f51b..002acc9af5 100644 --- a/src/quo/components/settings/category/style.cljs +++ b/src/quo/components/settings/category/style.cljs @@ -44,19 +44,3 @@ :background-color (if blur? :transparent (colors/theme-colors colors/neutral-5 colors/neutral-95 theme))}) - -(defn blur-container - [] - {:position :absolute - :left 0 - :right 0 - :bottom 0 - :top 0 - :overflow :hidden}) - -(defn blur-view - [theme] - {:style {:flex 1} - :blur-radius 10 - :blur-type theme - :blur-amount 20}) diff --git a/src/status_im/contexts/chat/group/common/style.cljs b/src/status_im/contexts/chat/group/common/style.cljs index 5f5a5a75bc..3e4d4af94e 100644 --- a/src/status_im/contexts/chat/group/common/style.cljs +++ b/src/status_im/contexts/chat/group/common/style.cljs @@ -3,13 +3,6 @@ (def avatar {:width 88 :margin-top 12 :margin-left 20}) -(def hole - {:y (- 80 32) - :x (+ (- 80 32) 8) - :width 32 - :height 32 - :borderRadius 10}) - (def camera {:position :absolute :right 0 :bottom 0}) (defn color-label diff --git a/src/status_im/contexts/chat/messenger/composer/events.cljs b/src/status_im/contexts/chat/messenger/composer/events.cljs index e10e89fd5c..8eae7d5bca 100644 --- a/src/status_im/contexts/chat/messenger/composer/events.cljs +++ b/src/status_im/contexts/chat/messenger/composer/events.cljs @@ -28,35 +28,12 @@ (let [current-chat-id (:current-chat-id db)] {:db (assoc-in db [:chat/inputs current-chat-id :input-ref] input-ref)})) -(rf/defn set-input-content-height - {:events [:chat.ui/set-input-content-height]} - [{db :db} content-height chat-id] - (let [current-chat-id (or chat-id (:current-chat-id db))] - {:db (assoc-in db [:chat/inputs current-chat-id :input-content-height] content-height)})) - -(rf/defn set-input-maximized - {:events [:chat.ui/set-input-maximized]} - [{db :db} maximized? chat-id] - (let [current-chat-id (or chat-id (:current-chat-id db))] - {:db (assoc-in db [:chat/inputs current-chat-id :input-maximized?] maximized?)})) - (rf/defn set-input-focused {:events [:chat.ui/set-input-focused]} [{db :db} focused? chat-id] (let [current-chat-id (or chat-id (:current-chat-id db))] {:db (assoc-in db [:chat/inputs current-chat-id :focused?] focused?)})) -(rf/defn set-input-audio - {:events [:chat.ui/set-input-audio]} - [{db :db} audio chat-id] - (let [current-chat-id (or chat-id (:current-chat-id db))] - {:db (assoc-in db [:chat/inputs current-chat-id :audio] audio)})) - -(rf/defn set-recording - {:events [:chat.ui/set-recording]} - [{db :db} recording?] - {:db (assoc db :chats/recording? recording?)}) - (rf/defn reply-to-message "Sets reference to previous chat message and focuses on input" {:events [:chat.ui/reply-to-message]} @@ -200,25 +177,6 @@ (link-preview/reset-unfurled) (messages.transport/send-chat-messages messages))))) -(rf/defn send-audio-message - {:events [:chat/send-audio]} - [{:keys [db] :as cofx} audio-path duration] - (let [{:keys [current-chat-id]} db - {:keys [message-id]} - (get-in db [:chat/inputs current-chat-id :metadata :responding-to-message])] - (when-not (string/blank? audio-path) - (rf/merge - {:db (assoc-in db [:chat/inputs current-chat-id :metadata :responding-to-message] nil)} - (messages.transport/send-chat-messages - [(merge - {:chat-id current-chat-id - :content-type constants/content-type-audio - :audio-path audio-path - :audio-duration-ms duration - :text (i18n/label :t/update-to-listen-audio {"locale" "en"})} - (when message-id - {:response-to message-id}))]))))) - (defn- process-link-previews [link-previews] (->> link-previews diff --git a/src/status_im/contexts/chat/messenger/composer/mentions/style.cljs b/src/status_im/contexts/chat/messenger/composer/mentions/style.cljs index 1639d2b1b8..158aa2e254 100644 --- a/src/status_im/contexts/chat/messenger/composer/mentions/style.cljs +++ b/src/status_im/contexts/chat/messenger/composer/mentions/style.cljs @@ -14,18 +14,6 @@ :shadow-offset {:width 0 :height (colors/theme-colors 8 12 theme)}) (assoc styles :elevation 10))) -(defn inner - [top theme] - (add-shadow theme - {:position :absolute - :top (- (+ 8 top)) - :left 8 - :right 8 - :border-radius 16 - :z-index 4 - :max-height constants/mentions-max-height - :background-color (colors/theme-colors colors/white colors/neutral-95 theme)})) - (defn container [opacity top theme] [{:opacity opacity} diff --git a/src/status_im/subs/wallet/buy.cljs b/src/status_im/subs/wallet/buy.cljs index 5adf82ba00..93b794ced3 100644 --- a/src/status_im/subs/wallet/buy.cljs +++ b/src/status_im/subs/wallet/buy.cljs @@ -20,13 +20,3 @@ :wallet/wallet-buy-crypto-provider :<- [:wallet/wallet-buy-crypto] :-> :provider) - -(rf/reg-sub - :wallet/wallet-buy-crypto-recurrent? - :<- [:wallet/wallet-buy-crypto] - :-> :recurrent?) - -(rf/reg-sub - :wallet/wallet-buy-crypto-network - :<- [:wallet/wallet-buy-crypto] - :-> :network) diff --git a/src/utils/collection.cljs b/src/utils/collection.cljs index d7c34186a5..4e556d0d25 100644 --- a/src/utils/collection.cljs +++ b/src/utils/collection.cljs @@ -20,8 +20,3 @@ [k coll] (let [groups (group-by k coll)] (map #(first (groups %)) (distinct (map k coll))))) - -(defn map-keys - [f m] - (->> (map (fn [[k v]] [(f k) v]) m) - (into {}))) diff --git a/src/utils/collection_test.cljs b/src/utils/collection_test.cljs new file mode 100644 index 0000000000..8d7c60b6a4 --- /dev/null +++ b/src/utils/collection_test.cljs @@ -0,0 +1,12 @@ +(ns utils.collection-test + (:require + [cljs.test :refer-macros [deftest is]] + [utils.collection :as c])) + +(deftest first-index-test + (is (= 2 + (c/first-index (partial = :test) + '(:a :b :test :c :test)))) + (is (= nil + (c/first-index (partial = :test) + '(:a :b :c))))) diff --git a/src/utils/money.cljs b/src/utils/money.cljs index 033ff7d370..5351ad31b8 100644 --- a/src/utils/money.cljs +++ b/src/utils/money.cljs @@ -134,11 +134,6 @@ (when bn (.toFixed bn b)))) -(defn to-number - [^js bn] - (when (bignumber? bn) - (.toNumber bn))) - (defn to-string ([^js bn] (to-string bn 10)) @@ -156,11 +151,6 @@ (new BigNumber hex-str 16) (catch :default _ nil))) -(defn wei->str - ([unit n display-unit] - (str (to-fixed (wei-> unit n)) " " display-unit)) - ([unit n] (wei->str unit n (string/upper-case (name unit))))) - (defn wei->ether [n] (wei-> :eth n)) @@ -173,64 +163,12 @@ [n] (->wei :gwei n)) -(defn ether->wei - [^js bn] - (when (bignumber? bn) - (.times bn ^js (bignumber 1e18)))) - (defn token->unit [n decimals] (when-let [^js bn (bignumber n)] (when-let [d (from-decimal decimals)] (.dividedBy bn ^js (bignumber d))))) -(defn unit->token - [n decimals] - (when-let [^js bn (bignumber n)] - (when-let [d (from-decimal decimals)] - (.times bn ^js (bignumber d))))) - -;;NOTE(goranjovic) - We have two basic representations of values that refer to cryptocurrency amounts: -;;formatted and -;; internal. Formatted representation is the one we show on screens and include in reports, whereas -;; internal -;; representation is the one that we pass on to ethereum network for execution, transfer, etc. -;; The difference between the two depends on the number of decimals, i.e. internal representation is -;; expressed in terms -;; of a whole number of smallest divisible parts of the formatted value. -;; -;; E.g. for Ether, it's smallest part is wei or 10^(-18) of 1 ether -;; for arbitrary ERC20 token the smallest part is 10^(-decimals) of 1 token -;; -;; Different tokens can have different number of allowed decimals, so it's necessary to include the -;; decimals parameter -;; to get the amount scale right. - -(defn formatted->internal - [n sym decimals] - (if (= :ETH sym) - (ether->wei n) - (unit->token n decimals))) - -(defn internal->formatted - [n sym decimals] - (if (= :ETH sym) - (wei->ether n) - (token->unit n decimals))) - -(defn fee-value - [gas gas-price] - (.times ^js (bignumber gas) ^js (bignumber gas-price))) - -(defn percent-change - [from to] - (let [^js bnf (bignumber from) - ^js bnt (bignumber to)] - (when (and bnf bnt) - (-> ^js (.dividedBy bnf bnt) - ^js (.minus 1) - ^js (.times 100))))) - (defn with-precision [n decimals] (when-let [^js bn (bignumber n)] @@ -256,15 +194,6 @@ (when (and amount balance) (greater-than-or-equals balance amount))) -(defn fiat-amount-value - [amount-str from to prices] - (-> amount-str - (js/parseFloat) - bignumber - (crypto->fiat (get-in prices [from to] ^js (bignumber 0))) - (with-precision 2) - str)) - (defn- add* [bn1 n2] (.add ^js bn1 n2)) @@ -281,10 +210,6 @@ "Multiply with defaults, this version is able to receive `nil` and takes them as 0." (fnil mul* (bignumber 0) (bignumber 0))) -(defn mul-and-round - [bn1 bn2] - (.round (.mul ^js bn1 bn2) 0)) - (defn- div* [bn1 bn2] (.dividedBy ^js bn1 bn2)) @@ -293,10 +218,6 @@ "Divides with defaults, this version is able to receive `nil` and takes them as 0." (fnil div* (bignumber 0) (bignumber 1))) -(defn div-and-round - [bn1 bn2] - (.round (.dividedBy ^js bn1 bn2) 0)) - (defn fiat->crypto [crypto fiat-price] (when-let [crypto-bn (bignumber crypto)] diff --git a/src/utils/number.cljs b/src/utils/number.cljs index 1499e74fb6..14df6d1daf 100644 --- a/src/utils/number.cljs +++ b/src/utils/number.cljs @@ -2,7 +2,6 @@ (:require [clojure.string :as string] [native-module.core :as native-module] [utils.hex :as utils.hex] - [utils.money :as utils.money] [utils.money :as money])) (defn naive-round @@ -80,7 +79,7 @@ (defn to-fixed [num decimals] (-> num - (utils.money/to-fixed decimals) + (money/to-fixed decimals) remove-trailing-zeroes)) (defn small-number-threshold