From b13864d0521637bca0af2f85ebf133db1f7935a7 Mon Sep 17 00:00:00 2001 From: yenda Date: Wed, 22 May 2019 17:00:34 +0200 Subject: [PATCH] [refactor] move utils.ethereum to ethereum move utils.ethereum.tokens to ethereum.tokens move utils.ethereum.abi-spec to ethereum.abi-spec move utils.ethereum.core to ethereum.core move utils.ethereum.eip165 to ethereum.eip165 move utils.ethereum.eip55 to ethereum.eip55 move utils.ethereum.eip681 to ethereum.eip681 move utils.ethereum.ens to ethereum.ens move utils.ethereum.erc721 to ethereum.erc721 move utils.ethereum.mnemonics to ethereum.mnemonics move utils.ethereum.resolver to ethereum.resolver move utils.ethereum.macros to ethereum.macros Signed-off-by: yenda --- src/status_im/accounts/recover/core.cljs | 13 +- src/status_im/browser/core.cljs | 34 ++- src/status_im/browser/permissions.cljs | 10 +- .../chat/commands/impl/transactions.cljs | 6 +- src/status_im/chat/models/message.cljs | 41 ++-- src/status_im/constants.cljs | 5 +- src/status_im/contact/db.cljs | 4 +- src/status_im/data_store/chats.cljs | 11 +- src/status_im/data_store/realm/core.cljs | 23 +- .../{utils => }/ethereum/abi_spec.cljs | 2 +- src/status_im/ethereum/contracts.cljs | 2 +- src/status_im/{utils => }/ethereum/core.cljs | 4 +- src/status_im/ethereum/decode.cljs | 2 +- .../{utils => }/ethereum/eip165.cljs | 6 +- src/status_im/{utils => }/ethereum/eip55.cljs | 4 +- .../{utils => }/ethereum/eip681.cljs | 9 +- src/status_im/{utils => }/ethereum/ens.cljs | 6 +- .../{utils => }/ethereum/erc721.cljs | 2 +- src/status_im/ethereum/json_rpc.cljs | 2 +- src/status_im/{utils => }/ethereum/macros.clj | 4 +- .../{utils => }/ethereum/mnemonic.cljs | 2 +- .../{utils => }/ethereum/resolver.cljs | 6 +- src/status_im/ethereum/subscriptions.cljs | 13 +- .../{utils => }/ethereum/tokens.cljs | 8 +- .../ethereum/transactions/etherscan.cljs | 4 +- .../extensions/capacities/ethereum.cljs | 6 +- src/status_im/hardwallet/core.cljs | 4 +- src/status_im/init/core.cljs | 2 +- src/status_im/network/core.cljs | 12 +- src/status_im/protocol/core.cljs | 8 +- src/status_im/stickers/core.cljs | 4 +- src/status_im/subs.cljs | 4 +- src/status_im/tribute_to_talk/core.cljs | 2 +- src/status_im/tribute_to_talk/db.cljs | 4 +- .../ui/components/common/common.cljs | 2 +- .../ui/screens/add_new/new_chat/events.cljs | 12 +- src/status_im/ui/screens/browser/views.cljs | 6 +- src/status_im/ui/screens/stickers/views.cljs | 17 +- .../wallet/choose_recipient/events.cljs | 8 +- .../screens/wallet/collectibles/events.cljs | 12 +- .../wallet/collectibles/kudos/events.cljs | 14 +- .../wallet/collectibles/superrare/events.cljs | 4 +- .../ui/screens/wallet/components/views.cljs | 46 ++-- .../ui/screens/wallet/navigation.cljs | 6 +- .../ui/screens/wallet/request/views.cljs | 51 ++--- .../ui/screens/wallet/send/events.cljs | 6 +- .../ui/screens/wallet/send/views.cljs | 57 ++--- .../ui/screens/wallet/settings/views.cljs | 21 +- .../screens/wallet/transaction_fee/views.cljs | 13 +- .../ui/screens/wallet/transactions/views.cljs | 6 +- src/status_im/utils/db.cljs | 6 +- src/status_im/utils/universal_links/core.cljs | 9 +- src/status_im/utils/varint.cljs | 2 +- src/status_im/wallet/core.cljs | 6 +- src/status_im/wallet/custom_tokens/core.cljs | 4 +- src/status_im/web3/core.cljs | 2 +- test/appium/tests/test_api.py | 2 +- .../test/{utils => }/ethereum/abi_spec.cljs | 4 +- .../test/{utils => }/ethereum/core.cljs | 4 +- .../test/{utils => }/ethereum/eip55.cljs | 8 +- .../test/{utils => }/ethereum/eip681.cljs | 4 +- .../test/{utils => }/ethereum/ens.cljs | 4 +- .../test/{utils => }/ethereum/mnemonic.cljs | 4 +- test/cljs/status_im/test/runner.cljs | 208 +++++++++--------- 64 files changed, 395 insertions(+), 422 deletions(-) rename src/status_im/{utils => }/ethereum/abi_spec.cljs (99%) rename src/status_im/{utils => }/ethereum/core.cljs (96%) rename src/status_im/{utils => }/ethereum/eip165.cljs (83%) rename src/status_im/{utils => }/ethereum/eip55.cljs (89%) rename src/status_im/{utils => }/ethereum/eip681.cljs (95%) rename src/status_im/{utils => }/ethereum/ens.cljs (96%) rename src/status_im/{utils => }/ethereum/erc721.cljs (94%) rename src/status_im/{utils => }/ethereum/macros.clj (96%) rename src/status_im/{utils => }/ethereum/mnemonic.cljs (99%) rename src/status_im/{utils => }/ethereum/resolver.cljs (84%) rename src/status_im/{utils => }/ethereum/tokens.cljs (99%) rename test/cljs/status_im/test/{utils => }/ethereum/abi_spec.cljs (98%) rename test/cljs/status_im/test/{utils => }/ethereum/core.cljs (76%) rename test/cljs/status_im/test/{utils => }/ethereum/eip55.cljs (84%) rename test/cljs/status_im/test/{utils => }/ethereum/eip681.cljs (99%) rename test/cljs/status_im/test/{utils => }/ethereum/ens.cljs (82%) rename test/cljs/status_im/test/{utils => }/ethereum/mnemonic.cljs (92%) diff --git a/src/status_im/accounts/recover/core.cljs b/src/status_im/accounts/recover/core.cljs index 5171246210..4151cb6cb6 100644 --- a/src/status_im/accounts/recover/core.cljs +++ b/src/status_im/accounts/recover/core.cljs @@ -3,16 +3,15 @@ [re-frame.core :as re-frame] [status-im.accounts.create.core :as accounts.create] [status-im.accounts.db :as db] + [status-im.ethereum.mnemonic :as mnemonic] [status-im.i18n :as i18n] [status-im.native-module.core :as status] + [status-im.node.core :as node] [status-im.ui.screens.navigation :as navigation] - [status-im.utils.ethereum.mnemonic :as mnemonic] + [status-im.utils.fx :as fx] [status-im.utils.identicon :as identicon] [status-im.utils.security :as security] - [status-im.utils.types :as types] - [status-im.utils.fx :as fx] - [status-im.node.core :as node] - [clojure.string :as str])) + [status-im.utils.types :as types])) (defn check-password-errors [password] (cond (string/blank? password) :required-field @@ -69,8 +68,8 @@ [{:keys [db] :as cofx} {:keys [error pubkey address]} password] (if (empty? error) (let [account-address (-> address - (str/lower-case) - (str/replace-first "0x" "")) + (string/lower-case) + (string/replace-first "0x" "")) keycard-account? (boolean (get-in db [:accounts/accounts account-address :keycard-instance-uid]))] (if keycard-account? ;; trying to recover account created with keycard diff --git a/src/status_im/browser/core.cljs b/src/status_im/browser/core.cljs index 0a91852601..ca0f7f73a1 100644 --- a/src/status_im/browser/core.cljs +++ b/src/status_im/browser/core.cljs @@ -4,14 +4,14 @@ [status-im.browser.permissions :as browser.permissions] [status-im.constants :as constants] [status-im.data-store.browser :as browser-store] + [status-im.ethereum.core :as ethereum] + [status-im.ethereum.ens :as ens] + [status-im.ethereum.resolver :as resolver] [status-im.i18n :as i18n] - [status-im.js-dependencies :as dependencies] + [status-im.js-dependencies :as js-dependencies] [status-im.native-module.core :as status] [status-im.ui.components.list-selection :as list-selection] [status-im.ui.screens.navigation :as navigation] - [status-im.utils.ethereum.core :as ethereum] - [status-im.utils.ethereum.ens :as ens] - [status-im.utils.ethereum.resolver :as resolver] [status-im.utils.contenthash :as contenthash] [status-im.utils.fx :as fx] [status-im.utils.http :as http] @@ -19,10 +19,8 @@ [status-im.utils.platform :as platform] [status-im.utils.random :as random] [status-im.utils.types :as types] - [status-im.utils.universal-links.core :as utils.universal-links] - [taoensso.timbre :as log] - [status-im.js-dependencies :as js-dependencies] - [status-im.utils.universal-links.core :as universal-links])) + [status-im.utils.universal-links.core :as universal-links] + [taoensso.timbre :as log])) (fx/defn initialize-browsers [{:keys [db all-stored-browsers]}] @@ -65,7 +63,7 @@ (defn check-if-phishing-url [{:keys [history history-index] :as browser}] (let [history-host (http/url-host (try (nth history history-index) (catch js/Error _)))] - (cond-> browser history-host (assoc :unsafe? (dependencies/phishing-detect history-host))))) + (cond-> browser history-host (assoc :unsafe? (js-dependencies/phishing-detect history-host))))) (defn- content->hash [hex] (when (and hex (not= hex "0x")) @@ -198,8 +196,8 @@ (fx/defn handle-message-link [cofx link] - (if (utils.universal-links/universal-link? link) - (utils.universal-links/handle-url cofx link) + (if (universal-links/universal-link? link) + (universal-links/handle-url cofx link) {:browser/show-browser-selection link})) (fx/defn update-browser-on-nav-change @@ -224,10 +222,10 @@ (fx/defn navigation-state-changed [cofx event error?] (let [{:strs [url loading title]} (js->clj event) - deep-link? (utils.universal-links/deep-link? url)] - (if (utils.universal-links/universal-link? url) + deep-link? (universal-links/deep-link? url)] + (if (universal-links/universal-link? url) (when-not (and deep-link? platform/ios?) ;; ios webview handles this - (utils.universal-links/handle-url cofx url)) + (universal-links/handle-url cofx url)) (fx/merge cofx (update-browser-option :loading? loading) (update-browser-name title) @@ -240,8 +238,8 @@ [cofx url] (let [browser (get-current-browser (:db cofx)) normalized-url (http/normalize-and-decode-url url)] - (if (utils.universal-links/universal-link? normalized-url) - (utils.universal-links/handle-url cofx normalized-url) + (if (universal-links/universal-link? normalized-url) + (universal-links/handle-url cofx normalized-url) (fx/merge cofx (update-browser-option :url-editing? false) (update-browser-history browser normalized-url) @@ -256,8 +254,8 @@ browser {:browser-id (random/id) :history-index 0 :history [normalized-url]}] - (if (utils.universal-links/universal-link? normalized-url) - (utils.universal-links/handle-url cofx normalized-url) + (if (universal-links/universal-link? normalized-url) + (universal-links/handle-url cofx normalized-url) (fx/merge cofx {:db (assoc db :browser/options {:browser-id (:browser-id browser)})} diff --git a/src/status_im/browser/permissions.cljs b/src/status_im/browser/permissions.cljs index 2d091db09b..4f4c2ab829 100644 --- a/src/status_im/browser/permissions.cljs +++ b/src/status_im/browser/permissions.cljs @@ -1,12 +1,12 @@ (ns status-im.browser.permissions (:require [status-im.constants :as constants] [status-im.data-store.dapp-permissions :as dapp-permissions] - [status-im.i18n :as i18n] - [status-im.utils.ethereum.core :as ethereum] - [status-im.utils.fx :as fx] - [status-im.qr-scanner.core :as qr-scanner] + [status-im.ethereum.core :as ethereum] [status-im.extensions.registry :as extensions.registry] - [status-im.ui.screens.navigation :as navigation])) + [status-im.i18n :as i18n] + [status-im.qr-scanner.core :as qr-scanner] + [status-im.ui.screens.navigation :as navigation] + [status-im.utils.fx :as fx])) (declare process-next-permission) (declare send-response-to-bridge) diff --git a/src/status_im/chat/commands/impl/transactions.cljs b/src/status_im/chat/commands/impl/transactions.cljs index 160fefe469..1c31f7e32a 100644 --- a/src/status_im/chat/commands/impl/transactions.cljs +++ b/src/status_im/chat/commands/impl/transactions.cljs @@ -8,8 +8,11 @@ [status-im.chat.commands.protocol :as protocol] [status-im.contact.db :as db.contact] [status-im.data-store.messages :as messages-store] + [status-im.ethereum.core :as ethereum] + [status-im.ethereum.tokens :as tokens] [status-im.i18n :as i18n] [status-im.ui.components.animation :as animation] + [status-im.ui.components.chat-icon.screen :as chat-icon] [status-im.ui.components.colors :as colors] [status-im.ui.components.icons.vector-icons :as vector-icons] [status-im.ui.components.list.views :as list] @@ -21,12 +24,9 @@ choose-recipient.events] [status-im.ui.screens.wallet.utils :as wallet.utils] [status-im.utils.datetime :as datetime] - [status-im.utils.ethereum.core :as ethereum] - [status-im.utils.ethereum.tokens :as tokens] [status-im.utils.fx :as fx] [status-im.utils.money :as money] [status-im.utils.platform :as platform] - [status-im.ui.components.chat-icon.screen :as chat-icon] [status-im.wallet.db :as wallet.db]) (:require-macros [status-im.utils.views :refer [defview letsubs]])) diff --git a/src/status_im/chat/models/message.cljs b/src/status_im/chat/models/message.cljs index c64af9f578..0b1e067613 100644 --- a/src/status_im/chat/models/message.cljs +++ b/src/status_im/chat/models/message.cljs @@ -1,36 +1,29 @@ (ns status-im.chat.models.message - (:require [clojure.string :as string] - [re-frame.core :as re-frame] + (:require [re-frame.core :as re-frame] [status-im.accounts.db :as accounts.db] - [status-im.native-module.core :as status] - [status-im.constants :as constants] - [status-im.i18n :as i18n] - [status-im.utils.core :as utils] - [status-im.utils.config :as config] - [status-im.contact.db :as contact.db] - [status-im.utils.ethereum.core :as ethereum] - [status-im.utils.datetime :as time] - [status-im.transport.message.group-chat :as message.group-chat] + [status-im.chat.commands.receiving :as commands-receiving] + [status-im.chat.db :as chat.db] [status-im.chat.models :as chat-model] [status-im.chat.models.loading :as chat-loading] [status-im.chat.models.message-content :as message-content] - [status-im.chat.commands.receiving :as commands-receiving] - [status-im.chat.db :as chat.db] - [status-im.mailserver.core :as mailserver] - [status-im.utils.clocks :as utils.clocks] - [status-im.utils.money :as money] - [status-im.utils.types :as types] - [status-im.notifications.core :as notifications] - [status-im.transport.utils :as transport.utils] - [status-im.transport.message.protocol :as protocol] + [status-im.constants :as constants] + [status-im.contact.db :as contact.db] [status-im.data-store.messages :as messages-store] [status-im.data-store.user-statuses :as user-statuses-store] - [status-im.utils.platform :as platform] + [status-im.mailserver.core :as mailserver] + [status-im.native-module.core :as status] + [status-im.notifications.core :as notifications] + [status-im.transport.message.group-chat :as message.group-chat] + [status-im.transport.message.protocol :as protocol] + [status-im.transport.message.transit :as transit] + [status-im.transport.utils :as transport.utils] [status-im.ui.components.react :as react] + [status-im.utils.clocks :as utils.clocks] + [status-im.utils.datetime :as time] [status-im.utils.fx :as fx] - [taoensso.timbre :as log] - [status-im.data-store.messages :as messages-store] - [status-im.transport.message.transit :as transit])) + [status-im.utils.platform :as platform] + [status-im.utils.types :as types] + [taoensso.timbre :as log])) (defn- wrap-group-message "Wrap a group message in a membership update" diff --git a/src/status_im/constants.cljs b/src/status_im/constants.cljs index 57f31d4259..be7433df80 100644 --- a/src/status_im/constants.cljs +++ b/src/status_im/constants.cljs @@ -1,7 +1,6 @@ (ns status-im.constants - (:require [status-im.i18n :as i18n] - [status-im.utils.ethereum.core :as ethereum] - [status-im.utils.types :as types] + (:require [status-im.ethereum.core :as ethereum] + [status-im.i18n :as i18n] [status-im.utils.config :as config])) (def ethereum-rpc-url "http://localhost:8545") diff --git a/src/status_im/contact/db.cljs b/src/status_im/contact/db.cljs index 93f9ea8bf2..cc2fcf9026 100644 --- a/src/status_im/contact/db.cljs +++ b/src/status_im/contact/db.cljs @@ -1,9 +1,9 @@ (ns status-im.contact.db (:require [cljs.spec.alpha :as spec] + [status-im.ethereum.core :as ethereum] [status-im.js-dependencies :as js-dependencies] - [status-im.utils.identicon :as identicon] [status-im.utils.gfycat.core :as gfycat] - [status-im.utils.ethereum.core :as ethereum] + [status-im.utils.identicon :as identicon] status-im.utils.db)) ;;;; DB diff --git a/src/status_im/data_store/chats.cljs b/src/status_im/data_store/chats.cljs index 392dcf06b8..d2b8147437 100644 --- a/src/status_im/data_store/chats.cljs +++ b/src/status_im/data_store/chats.cljs @@ -1,12 +1,11 @@ (ns status-im.data-store.chats (:require [goog.object :as object] [re-frame.core :as re-frame] - [status-im.utils.ethereum.core :as utils.ethereum] - [status-im.utils.clocks :as utils.clocks] - [status-im.data-store.realm.core :as core] [status-im.data-store.messages :as messages] - [status-im.utils.core :as utils] - [cljs.tools.reader.edn :as edn])) + [status-im.data-store.realm.core :as core] + [status-im.ethereum.core :as ethereum] + [status-im.utils.clocks :as utils.clocks] + [status-im.utils.core :as utils])) (defn remove-empty-vals "Remove key/value when empty seq or nil" @@ -27,7 +26,7 @@ (sort (keys event)))))) ; Build an event id from a message -(def event-id (comp utils.ethereum/sha3 event->string)) +(def event-id (comp ethereum/sha3 event->string)) (defn marshal-membership-updates [updates] (mapcat (fn [{:keys [signature events from]}] diff --git a/src/status_im/data_store/realm/core.cljs b/src/status_im/data_store/realm/core.cljs index 3fadff6d95..4c434fb484 100644 --- a/src/status_im/data_store/realm/core.cljs +++ b/src/status_im/data_store/realm/core.cljs @@ -1,18 +1,17 @@ (ns status-im.data-store.realm.core - (:require [goog.object :as object] - [goog.string :as gstr] - [clojure.string :as string] + (:require [clojure.string :as string] + [cognitect.transit :as transit] + [goog.object :as object] [re-frame.core :as re-frame] [status-im.data-store.realm.schemas.account.core :as account] [status-im.data-store.realm.schemas.base.core :as base] - [taoensso.timbre :as log] - [status-im.utils.fs :as fs] - [status-im.utils.async :as utils.async] - [status-im.utils.platform :as utils.platform] - [status-im.utils.ethereum.core :as utils.ethereum] - [cognitect.transit :as transit] + [status-im.ethereum.core :as ethereum] + [status-im.js-dependencies :as js-dependencies] [status-im.react-native.js-dependencies :as rn-dependencies] - [status-im.js-dependencies :as js-dependencies])) + [status-im.utils.async :as utils.async] + [status-im.utils.fs :as fs] + [status-im.utils.platform :as utils.platform] + [taoensso.timbre :as log])) (defn to-buffer [key] (when-not (nil? key) @@ -90,7 +89,7 @@ (defn get-account-db-path [address] - (str (accounts-realm-dir) (utils.ethereum/sha3 address))) + (str (accounts-realm-dir) (ethereum/sha3 address))) (defn delete-realms [] (log/warn "realm: deleting all realms") @@ -98,7 +97,7 @@ (defn delete-account-realm [address] - (log/warn "realm: deleting account db " (utils.ethereum/sha3 address)) + (log/warn "realm: deleting account db " (ethereum/sha3 address)) (let [file (get-account-db-path address)] (.. (fs/unlink file) (then #(fs/unlink (str file ".lock"))) diff --git a/src/status_im/utils/ethereum/abi_spec.cljs b/src/status_im/ethereum/abi_spec.cljs similarity index 99% rename from src/status_im/utils/ethereum/abi_spec.cljs rename to src/status_im/ethereum/abi_spec.cljs index 2fe587909e..562d636dc6 100644 --- a/src/status_im/utils/ethereum/abi_spec.cljs +++ b/src/status_im/ethereum/abi_spec.cljs @@ -1,4 +1,4 @@ -(ns status-im.utils.ethereum.abi-spec +(ns status-im.ethereum.abi-spec (:require [cljs.spec.alpha :as spec] [clojure.string :as string] [status-im.js-dependencies :as dependencies])) diff --git a/src/status_im/ethereum/contracts.cljs b/src/status_im/ethereum/contracts.cljs index ae93b16f33..d79c93a1bd 100644 --- a/src/status_im/ethereum/contracts.cljs +++ b/src/status_im/ethereum/contracts.cljs @@ -1,5 +1,5 @@ (ns status-im.ethereum.contracts - (:require [status-im.utils.ethereum.core :as ethereum])) + (:require [status-im.ethereum.core :as ethereum])) (def contracts {:status/snt diff --git a/src/status_im/utils/ethereum/core.cljs b/src/status_im/ethereum/core.cljs similarity index 96% rename from src/status_im/utils/ethereum/core.cljs rename to src/status_im/ethereum/core.cljs index 4549189667..8b7007b599 100644 --- a/src/status_im/utils/ethereum/core.cljs +++ b/src/status_im/ethereum/core.cljs @@ -1,7 +1,7 @@ -(ns status-im.utils.ethereum.core +(ns status-im.ethereum.core (:require [clojure.string :as string] + [status-im.ethereum.tokens :as tokens] [status-im.js-dependencies :as dependencies] - [status-im.utils.ethereum.tokens :as tokens] [status-im.utils.money :as money])) ;; IDs standardized in https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md#list-of-chain-ids diff --git a/src/status_im/ethereum/decode.cljs b/src/status_im/ethereum/decode.cljs index 219f7289c7..b9300be306 100644 --- a/src/status_im/ethereum/decode.cljs +++ b/src/status_im/ethereum/decode.cljs @@ -1,5 +1,5 @@ (ns status-im.ethereum.decode - (:require [status-im.utils.ethereum.abi-spec :as abi-spec])) + (:require [status-im.ethereum.abi-spec :as abi-spec])) (defn uint [hex] diff --git a/src/status_im/utils/ethereum/eip165.cljs b/src/status_im/ethereum/eip165.cljs similarity index 83% rename from src/status_im/utils/ethereum/eip165.cljs rename to src/status_im/ethereum/eip165.cljs index 4286ffddde..1009b32d4e 100644 --- a/src/status_im/utils/ethereum/eip165.cljs +++ b/src/status_im/ethereum/eip165.cljs @@ -1,7 +1,7 @@ -(ns status-im.utils.ethereum.eip165 +(ns status-im.ethereum.eip165 "Utility function related to [EIP165](https://eips.ethereum.org/EIPS/eip-165)" - (:require [status-im.ethereum.json-rpc :as json-rpc] - [status-im.utils.ethereum.abi-spec :as abi-spec])) + (:require [status-im.ethereum.abi-spec :as abi-spec] + [status-im.ethereum.json-rpc :as json-rpc])) (def supports-interface-hash "0x01ffc9a7") (def marker-hash "0xffffffff") diff --git a/src/status_im/utils/ethereum/eip55.cljs b/src/status_im/ethereum/eip55.cljs similarity index 89% rename from src/status_im/utils/ethereum/eip55.cljs rename to src/status_im/ethereum/eip55.cljs index 27bc7d05e1..ca27a39306 100644 --- a/src/status_im/utils/ethereum/eip55.cljs +++ b/src/status_im/ethereum/eip55.cljs @@ -1,4 +1,4 @@ -(ns status-im.utils.ethereum.eip55 +(ns status-im.ethereum.eip55 "Utility function related to [EIP55](https://eips.ethereum.org/EIPS/eip-55) This EIP standardize how ethereum addresses should be printed as strings to validate checksum. @@ -18,4 +18,4 @@ (defn valid-address-checksum? "Checks address checksum validity." [address] - (.checkAddressChecksum utils address)) \ No newline at end of file + (.checkAddressChecksum utils address)) diff --git a/src/status_im/utils/ethereum/eip681.cljs b/src/status_im/ethereum/eip681.cljs similarity index 95% rename from src/status_im/utils/ethereum/eip681.cljs rename to src/status_im/ethereum/eip681.cljs index 86bf1a8c54..2f6cf95b10 100644 --- a/src/status_im/utils/ethereum/eip681.cljs +++ b/src/status_im/ethereum/eip681.cljs @@ -1,13 +1,12 @@ -(ns status-im.utils.ethereum.eip681 +(ns status-im.ethereum.eip681 "Utility function related to [EIP681](https://eips.ethereum.org/EIPS/eip-681) This EIP standardize how ethereum payment request can be represented as URI (say to embed them in a QR code). e.g. ethereum:0x1234@1/transfer?to=0x5678&value=1e18&gas=5000" - (:require [clojure.set :as set] - [clojure.string :as string] - [status-im.utils.ethereum.core :as ethereum] - [status-im.utils.ethereum.tokens :as tokens] + (:require [clojure.string :as string] + [status-im.ethereum.core :as ethereum] + [status-im.ethereum.tokens :as tokens] [status-im.utils.money :as money])) (def scheme "ethereum") diff --git a/src/status_im/utils/ethereum/ens.cljs b/src/status_im/ethereum/ens.cljs similarity index 96% rename from src/status_im/utils/ethereum/ens.cljs rename to src/status_im/ethereum/ens.cljs index e008d443ca..0fed931683 100644 --- a/src/status_im/utils/ethereum/ens.cljs +++ b/src/status_im/ethereum/ens.cljs @@ -1,4 +1,4 @@ -(ns status-im.utils.ethereum.ens +(ns status-im.ethereum.ens " https://docs.ens.domains/en/latest/index.html https://eips.ethereum.org/EIPS/eip-137 @@ -6,8 +6,8 @@ " (:refer-clojure :exclude [name]) (:require [clojure.string :as string] - [status-im.ethereum.json-rpc :as json-rpc] - [status-im.utils.ethereum.core :as ethereum])) + [status-im.ethereum.core :as ethereum] + [status-im.ethereum.json-rpc :as json-rpc])) ;; this is the addresses of ens registries for the different networks (def ens-registries diff --git a/src/status_im/utils/ethereum/erc721.cljs b/src/status_im/ethereum/erc721.cljs similarity index 94% rename from src/status_im/utils/ethereum/erc721.cljs rename to src/status_im/ethereum/erc721.cljs index 3e05685c3f..9077dfffb1 100644 --- a/src/status_im/utils/ethereum/erc721.cljs +++ b/src/status_im/ethereum/erc721.cljs @@ -1,4 +1,4 @@ -(ns status-im.utils.ethereum.erc721 +(ns status-im.ethereum.erc721 " Helper functions to interact with [ERC721](https://eips.ethereum.org/EIPS/eip-721) smart contract " diff --git a/src/status_im/ethereum/json_rpc.cljs b/src/status_im/ethereum/json_rpc.cljs index 250ae942f3..ebd10ee2ef 100644 --- a/src/status_im/ethereum/json_rpc.cljs +++ b/src/status_im/ethereum/json_rpc.cljs @@ -1,9 +1,9 @@ (ns status-im.ethereum.json-rpc (:require [clojure.string :as string] [re-frame.core :as re-frame] + [status-im.ethereum.abi-spec :as abi-spec] [status-im.ethereum.decode :as decode] [status-im.native-module.core :as status] - [status-im.utils.ethereum.abi-spec :as abi-spec] [status-im.utils.money :as money] [status-im.utils.types :as types] [taoensso.timbre :as log])) diff --git a/src/status_im/utils/ethereum/macros.clj b/src/status_im/ethereum/macros.clj similarity index 96% rename from src/status_im/utils/ethereum/macros.clj rename to src/status_im/ethereum/macros.clj index 64de746e3b..d3d13989f7 100644 --- a/src/status_im/utils/ethereum/macros.clj +++ b/src/status_im/ethereum/macros.clj @@ -1,4 +1,4 @@ -(ns status-im.utils.ethereum.macros +(ns status-im.ethereum.macros (:require [clojure.string :as string] [clojure.java.io :as io])) @@ -34,4 +34,4 @@ (map (fn [[network native-currency]] [network (assoc-in native-currency [:icon :source] - (network->icon network))]) all-native-currencies))) \ No newline at end of file + (network->icon network))]) all-native-currencies))) diff --git a/src/status_im/utils/ethereum/mnemonic.cljs b/src/status_im/ethereum/mnemonic.cljs similarity index 99% rename from src/status_im/utils/ethereum/mnemonic.cljs rename to src/status_im/ethereum/mnemonic.cljs index efc19aa4fe..94d62038e8 100644 --- a/src/status_im/utils/ethereum/mnemonic.cljs +++ b/src/status_im/ethereum/mnemonic.cljs @@ -1,4 +1,4 @@ -(ns status-im.utils.ethereum.mnemonic +(ns status-im.ethereum.mnemonic (:require [clojure.string :as string])) (def dictionary diff --git a/src/status_im/utils/ethereum/resolver.cljs b/src/status_im/ethereum/resolver.cljs similarity index 84% rename from src/status_im/utils/ethereum/resolver.cljs rename to src/status_im/ethereum/resolver.cljs index 18357ed845..c00c75637f 100644 --- a/src/status_im/utils/ethereum/resolver.cljs +++ b/src/status_im/ethereum/resolver.cljs @@ -1,6 +1,6 @@ -(ns status-im.utils.ethereum.resolver - (:require [status-im.utils.ethereum.ens :as ens]) - (:refer-clojure :exclude [name])) +(ns status-im.ethereum.resolver + (:refer-clojure :exclude [name]) + (:require [status-im.ethereum.ens :as ens])) (def default-hash "0x0000000000000000000000000000000000000000000000000000000000000000") (defn contenthash [registry ens-name cb] diff --git a/src/status_im/ethereum/subscriptions.cljs b/src/status_im/ethereum/subscriptions.cljs index 9ad16caac7..277fd6768f 100644 --- a/src/status_im/ethereum/subscriptions.cljs +++ b/src/status_im/ethereum/subscriptions.cljs @@ -1,15 +1,12 @@ (ns status-im.ethereum.subscriptions - (:require [clojure.string :as string] - [re-frame.core :as re-frame] + (:require [re-frame.core :as re-frame] [status-im.constants :as constants] + [status-im.ethereum.core :as ethereum] + [status-im.ethereum.json-rpc :as json-rpc] + [status-im.ethereum.tokens :as tokens] [status-im.ethereum.transactions.core :as transactions] - [status-im.native-module.core :as status] - [status-im.utils.ethereum.core :as ethereum] - [status-im.utils.ethereum.tokens :as tokens] [status-im.utils.fx :as fx] - [status-im.utils.types :as types] - [taoensso.timbre :as log] - [status-im.ethereum.json-rpc :as json-rpc])) + [taoensso.timbre :as log])) (fx/defn handle-signal [cofx {:keys [subscription_id data] :as event}] diff --git a/src/status_im/utils/ethereum/tokens.cljs b/src/status_im/ethereum/tokens.cljs similarity index 99% rename from src/status_im/utils/ethereum/tokens.cljs rename to src/status_im/ethereum/tokens.cljs index f868567ede..0e57a69fa5 100644 --- a/src/status_im/utils/ethereum/tokens.cljs +++ b/src/status_im/ethereum/tokens.cljs @@ -1,7 +1,7 @@ -(ns status-im.utils.ethereum.tokens - (:require-macros [status-im.utils.ethereum.macros :refer [resolve-icons] :as ethereum.macros]) - (:require [clojure.string :as string] - [status-im.utils.config :as config])) +(ns status-im.ethereum.tokens + (:require [clojure.string :as string]) + (:require-macros + [status-im.ethereum.macros :as ethereum.macros :refer [resolve-icons]])) (defn- asset-border [color] {:border-color color :border-width 1 :border-radius 32}) diff --git a/src/status_im/ethereum/transactions/etherscan.cljs b/src/status_im/ethereum/transactions/etherscan.cljs index 5dc9fc185f..7446e8e480 100644 --- a/src/status_im/ethereum/transactions/etherscan.cljs +++ b/src/status_im/ethereum/transactions/etherscan.cljs @@ -1,7 +1,7 @@ (ns status-im.ethereum.transactions.etherscan (:require [re-frame.core :as re-frame] - [status-im.utils.ethereum.core :as ethereum] - [status-im.utils.ethereum.tokens :as tokens] + [status-im.ethereum.core :as ethereum] + [status-im.ethereum.tokens :as tokens] [status-im.utils.fx :as fx] [status-im.utils.http :as http] [status-im.utils.types :as types] diff --git a/src/status_im/extensions/capacities/ethereum.cljs b/src/status_im/extensions/capacities/ethereum.cljs index 34d8a2d924..c0a3698111 100644 --- a/src/status_im/extensions/capacities/ethereum.cljs +++ b/src/status_im/extensions/capacities/ethereum.cljs @@ -1,12 +1,12 @@ (ns status-im.extensions.capacities.ethereum (:require [clojure.string :as string] [status-im.constants :as constants] + [status-im.ethereum.abi-spec :as abi-spec] + [status-im.ethereum.core :as ethereum] + [status-im.ethereum.ens :as ens] [status-im.i18n :as i18n] [status-im.native-module.core :as status] [status-im.ui.screens.navigation :as navigation] - [status-im.utils.ethereum.abi-spec :as abi-spec] - [status-im.utils.ethereum.core :as ethereum] - [status-im.utils.ethereum.ens :as ens] [status-im.utils.fx :as fx] [status-im.utils.handlers :as handlers] [status-im.utils.hex :as hex] diff --git a/src/status_im/hardwallet/core.cljs b/src/status_im/hardwallet/core.cljs index 47120b6919..0be258013f 100644 --- a/src/status_im/hardwallet/core.cljs +++ b/src/status_im/hardwallet/core.cljs @@ -6,13 +6,13 @@ [status-im.accounts.logout.core :as accounts.logout] [status-im.accounts.recover.core :as accounts.recover] [status-im.data-store.accounts :as accounts-store] + [status-im.ethereum.core :as ethereum] + [status-im.ethereum.mnemonic :as mnemonic] [status-im.i18n :as i18n] [status-im.node.core :as node] [status-im.ui.screens.navigation :as navigation] [status-im.utils.config :as config] [status-im.utils.datetime :as utils.datetime] - [status-im.utils.ethereum.core :as ethereum] - [status-im.utils.ethereum.mnemonic :as mnemonic] [status-im.utils.fx :as fx] [status-im.utils.platform :as platform] [status-im.utils.types :as types] diff --git a/src/status_im/init/core.cljs b/src/status_im/init/core.cljs index b717262dc7..9d381809cd 100644 --- a/src/status_im/init/core.cljs +++ b/src/status_im/init/core.cljs @@ -7,6 +7,7 @@ [status-im.contact.core :as contact] [status-im.data-store.core :as data-store] [status-im.data-store.realm.core :as realm] + [status-im.ethereum.core :as ethereum] [status-im.extensions.registry :as extensions.registry] [status-im.i18n :as i18n] [status-im.models.dev-server :as models.dev-server] @@ -18,7 +19,6 @@ [status-im.stickers.core :as stickers] [status-im.ui.screens.db :refer [app-db]] [status-im.ui.screens.navigation :as navigation] - [status-im.utils.ethereum.core :as ethereum] [status-im.utils.fx :as fx] [status-im.utils.keychain.core :as keychain] [status-im.utils.platform :as platform] diff --git a/src/status_im/network/core.cljs b/src/status_im/network/core.cljs index fb3c0b9d03..7fef86ee16 100644 --- a/src/status_im/network/core.cljs +++ b/src/status_im/network/core.cljs @@ -2,19 +2,19 @@ (:require [clojure.string :as string] [re-frame.core :as re-frame] [status-im.accounts.update.core :as accounts.update] + [status-im.chaos-mode.core :as chaos-mode] + [status-im.ethereum.core :as ethereum] + [status-im.fleet.core :as fleet-core] [status-im.i18n :as i18n] + [status-im.mailserver.core :as mailserver] [status-im.native-module.core :as status] [status-im.network.net-info :as net-info] - [status-im.mailserver.core :as mailserver] - [status-im.utils.ethereum.core :as ethereum] + [status-im.ui.screens.mobile-network-settings.events :as mobile-network] [status-im.ui.screens.navigation :as navigation] - [status-im.fleet.core :as fleet-core] [status-im.utils.fx :as fx] [status-im.utils.handlers :as handlers] [status-im.utils.http :as http] - [status-im.utils.types :as types] - [status-im.ui.screens.mobile-network-settings.events :as mobile-network] - [status-im.chaos-mode.core :as chaos-mode])) + [status-im.utils.types :as types])) (def url-regex #"https?://(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}(\.[a-z]{2,6})?\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)") diff --git a/src/status_im/protocol/core.cljs b/src/status_im/protocol/core.cljs index 35f6630383..3a6aa7e345 100644 --- a/src/status_im/protocol/core.cljs +++ b/src/status_im/protocol/core.cljs @@ -1,13 +1,13 @@ (ns status-im.protocol.core (:require [re-frame.core :as re-frame] [status-im.constants :as constants] - [status-im.transport.core :as transport] + [status-im.ethereum.core :as ethereum] + [status-im.i18n :as i18n] [status-im.mailserver.core :as mailserver] - [status-im.utils.ethereum.core :as ethereum] + [status-im.transport.core :as transport] [status-im.utils.fx :as fx] [status-im.utils.semaphores :as semaphores] - [status-im.utils.utils :as utils] - [status-im.i18n :as i18n])) + [status-im.utils.utils :as utils])) (fx/defn update-sync-state [{{:keys [sync-state sync-data] :as db} :db} error sync] diff --git a/src/status_im/stickers/core.cljs b/src/status_im/stickers/core.cljs index 8a7ec3ee01..828cb20ddb 100644 --- a/src/status_im/stickers/core.cljs +++ b/src/status_im/stickers/core.cljs @@ -3,11 +3,11 @@ [re-frame.core :as re-frame] [status-im.accounts.core :as accounts] [status-im.constants :as constants] + [status-im.ethereum.abi-spec :as abi-spec] [status-im.ethereum.contracts :as contracts] + [status-im.ethereum.core :as ethereum] [status-im.ethereum.json-rpc :as json-rpc] [status-im.ui.screens.navigation :as navigation] - [status-im.utils.ethereum.abi-spec :as abi-spec] - [status-im.utils.ethereum.core :as ethereum] [status-im.utils.fx :as fx] [status-im.utils.multihash :as multihash] [status-im.utils.utils :as utils] diff --git a/src/status_im/subs.cljs b/src/status_im/subs.cljs index 0d3be935f6..be64ca373c 100644 --- a/src/status_im/subs.cljs +++ b/src/status_im/subs.cljs @@ -10,8 +10,10 @@ [status-im.chat.db :as chat.db] [status-im.constants :as constants] [status-im.contact.db :as contact.db] + [status-im.ethereum.tokens :as tokens] [status-im.ethereum.transactions.core :as transactions] [status-im.ethereum.transactions.etherscan :as transactions.etherscan] + [status-im.ethereum.core :as ethereum] [status-im.fleet.core :as fleet] [status-im.i18n :as i18n] [status-im.ui.components.bottom-bar.styles :as tabs.styles] @@ -25,8 +27,6 @@ [status-im.utils.build :as build] [status-im.utils.config :as config] [status-im.utils.datetime :as datetime] - [status-im.utils.ethereum.core :as ethereum] - [status-im.utils.ethereum.tokens :as tokens] [status-im.utils.identicon :as identicon] [status-im.utils.money :as money] [status-im.utils.platform :as platform] diff --git a/src/status_im/tribute_to_talk/core.cljs b/src/status_im/tribute_to_talk/core.cljs index cdf82f467b..42a1308435 100644 --- a/src/status_im/tribute_to_talk/core.cljs +++ b/src/status_im/tribute_to_talk/core.cljs @@ -5,12 +5,12 @@ [status-im.accounts.update.core :as accounts.update] [status-im.contact.db :as contact.db] [status-im.ethereum.contracts :as contracts] + [status-im.ethereum.core :as ethereum] [status-im.ethereum.json-rpc :as json-rpc] [status-im.ipfs.core :as ipfs] [status-im.tribute-to-talk.db :as tribute-to-talk.db] [status-im.ui.screens.navigation :as navigation] [status-im.utils.contenthash :as contenthash] - [status-im.utils.ethereum.core :as ethereum] [status-im.utils.fx :as fx] [status-im.wallet.core :as wallet] [taoensso.timbre :as log])) diff --git a/src/status_im/tribute_to_talk/db.cljs b/src/status_im/tribute_to_talk/db.cljs index 4b3e46e9c4..c17887dfb8 100644 --- a/src/status_im/tribute_to_talk/db.cljs +++ b/src/status_im/tribute_to_talk/db.cljs @@ -1,6 +1,6 @@ (ns status-im.tribute-to-talk.db - (:require [status-im.js-dependencies :as dependencies] - [status-im.utils.ethereum.core :as ethereum])) + (:require [status-im.ethereum.core :as ethereum] + [status-im.js-dependencies :as dependencies])) (def utils dependencies/web3-utils) diff --git a/src/status_im/ui/components/common/common.cljs b/src/status_im/ui/components/common/common.cljs index fc291bfa68..a4b906ac38 100644 --- a/src/status_im/ui/components/common/common.cljs +++ b/src/status_im/ui/components/common/common.cljs @@ -1,11 +1,11 @@ (ns status-im.ui.components.common.common (:require [reagent.core :as reagent] + [status-im.ethereum.core :as ethereum] [status-im.i18n :as i18n] [status-im.ui.components.colors :as colors] [status-im.ui.components.common.styles :as styles] [status-im.ui.components.icons.vector-icons :as vector-icons] [status-im.ui.components.react :as react] - [status-im.utils.ethereum.core :as ethereum] [status-im.utils.platform :as platform]) (:require-macros [status-im.utils.views :refer [defview letsubs]])) diff --git a/src/status_im/ui/screens/add_new/new_chat/events.cljs b/src/status_im/ui/screens/add_new/new_chat/events.cljs index c2c4edc6c4..834745109e 100644 --- a/src/status_im/ui/screens/add_new/new_chat/events.cljs +++ b/src/status_im/ui/screens/add_new/new_chat/events.cljs @@ -1,11 +1,11 @@ (ns status-im.ui.screens.add-new.new-chat.events - (:require [re-frame.core :as re-frame] + (:require [clojure.string :as string] + [re-frame.core :as re-frame] + [status-im.ethereum.core :as ethereum] + [status-im.ethereum.ens :as ens] + [status-im.ethereum.resolver :as resolver] [status-im.ui.screens.add-new.new-chat.db :as db] - [status-im.utils.ethereum.core :as ethereum] - [status-im.utils.ethereum.ens :as ens] - [status-im.utils.ethereum.resolver :as resolver] - [status-im.utils.handlers :as handlers] - [clojure.string :as string])) + [status-im.utils.handlers :as handlers])) (re-frame/reg-fx :resolve-public-key diff --git a/src/status_im/ui/screens/browser/views.cljs b/src/status_im/ui/screens/browser/views.cljs index 4effccbc07..f4e513e394 100644 --- a/src/status_im/ui/screens/browser/views.cljs +++ b/src/status_im/ui/screens/browser/views.cljs @@ -3,8 +3,10 @@ [re-frame.core :as re-frame] [reagent.core :as reagent] [status-im.browser.core :as browser] + [status-im.ethereum.core :as ethereum] [status-im.i18n :as i18n] [status-im.ui.components.colors :as colors] + [status-im.ui.components.connectivity.view :as connectivity] [status-im.ui.components.icons.vector-icons :as icons] [status-im.ui.components.react :as react] [status-im.ui.components.status-bar.view :as status-bar] @@ -16,10 +18,8 @@ [status-im.ui.screens.browser.permissions.views :as permissions.views] [status-im.ui.screens.browser.site-blocked.views :as site-blocked.views] [status-im.ui.screens.browser.styles :as styles] - [status-im.utils.ethereum.core :as ethereum] [status-im.utils.http :as http] - [status-im.utils.js-resources :as js-res] - [status-im.ui.components.connectivity.view :as connectivity]) + [status-im.utils.js-resources :as js-res]) (:require-macros [status-im.utils.slurp :refer [slurp]] [status-im.utils.views :as views])) diff --git a/src/status_im/ui/screens/stickers/views.cljs b/src/status_im/ui/screens/stickers/views.cljs index 4f7e8e61ee..3fba805620 100644 --- a/src/status_im/ui/screens/stickers/views.cljs +++ b/src/status_im/ui/screens/stickers/views.cljs @@ -1,17 +1,16 @@ (ns status-im.ui.screens.stickers.views - (:require-macros [status-im.utils.views :refer [defview letsubs]]) (:require [re-frame.core :as re-frame] + [status-im.ethereum.core :as ethereum] [status-im.i18n :as i18n] + [status-im.ui.components.colors :as colors] + [status-im.ui.components.icons.vector-icons :as icons] [status-im.ui.components.react :as react] - [status-im.ui.screens.stickers.styles :as styles] [status-im.ui.components.status-bar.view :as status-bar] [status-im.ui.components.styles :as components.styles] [status-im.ui.components.toolbar.view :as toolbar] - [status-im.ui.components.colors :as colors] - [status-im.ui.components.icons.vector-icons :as icons] - [status-im.utils.money :as money] - [status-im.utils.ethereum.core :as ethereum] - [status-im.ui.components.react :as components])) + [status-im.ui.screens.stickers.styles :as styles] + [status-im.utils.money :as money]) + (:require-macros [status-im.utils.views :refer [defview letsubs]])) (defn- thumbnail-icon [uri size] [react/image {:style {:width size :height size :border-radius (/ size 2)} @@ -36,8 +35,8 @@ (when (and (not (zero? price))) ;(not no-snt?)) [icons/icon :icons/logo {:color colors/white :width 12 :height 12 :container-style {:margin-right 8}}]) (if pending - [components/activity-indicator {:animating true - :color colors/white}] + [react/activity-indicator {:animating true + :color colors/white}] [react/text {:style {:color colors/white} :accessibility-label :sticker-pack-price} (cond (or owned (zero? price)) diff --git a/src/status_im/ui/screens/wallet/choose_recipient/events.cljs b/src/status_im/ui/screens/wallet/choose_recipient/events.cljs index 94e62529f7..d7ad04f2da 100644 --- a/src/status_im/ui/screens/wallet/choose_recipient/events.cljs +++ b/src/status_im/ui/screens/wallet/choose_recipient/events.cljs @@ -2,11 +2,11 @@ (:require [re-frame.core :as re-frame] [status-im.constants :as constants] [status-im.contact.db :as contact.db] + [status-im.ethereum.core :as ethereum] + [status-im.ethereum.eip55 :as eip55] + [status-im.ethereum.eip681 :as eip681] + [status-im.ethereum.ens :as ens] [status-im.i18n :as i18n] - [status-im.utils.ethereum.core :as ethereum] - [status-im.utils.ethereum.eip55 :as eip55] - [status-im.utils.ethereum.eip681 :as eip681] - [status-im.utils.ethereum.ens :as ens] [status-im.utils.handlers :as handlers] [status-im.utils.money :as money])) diff --git a/src/status_im/ui/screens/wallet/collectibles/events.cljs b/src/status_im/ui/screens/wallet/collectibles/events.cljs index fcaf6ace3b..03a3b6af36 100644 --- a/src/status_im/ui/screens/wallet/collectibles/events.cljs +++ b/src/status_im/ui/screens/wallet/collectibles/events.cljs @@ -1,12 +1,12 @@ (ns status-im.ui.screens.wallet.collectibles.events (:require [re-frame.core :as re-frame] - [status-im.utils.handlers :as handlers] - [status-im.utils.ethereum.erc721 :as erc721] - [status-im.utils.ethereum.tokens :as tokens] - [status-im.utils.money :as money] [status-im.browser.core :as browser] - [status-im.utils.ethereum.core :as ethereum] - [status-im.constants :as constants])) + [status-im.constants :as constants] + [status-im.ethereum.core :as ethereum] + [status-im.ethereum.erc721 :as erc721] + [status-im.ethereum.tokens :as tokens] + [status-im.utils.handlers :as handlers] + [status-im.utils.money :as money])) (defmulti load-collectible-fx (fn [_ symbol _] symbol)) diff --git a/src/status_im/ui/screens/wallet/collectibles/kudos/events.cljs b/src/status_im/ui/screens/wallet/collectibles/kudos/events.cljs index ccc43407b9..c7f980765b 100644 --- a/src/status_im/ui/screens/wallet/collectibles/kudos/events.cljs +++ b/src/status_im/ui/screens/wallet/collectibles/kudos/events.cljs @@ -1,13 +1,13 @@ (ns status-im.ui.screens.wallet.collectibles.kudos.events - (:require [status-im.ui.screens.wallet.collectibles.events :as collectibles] - [status-im.utils.http :as http] - [status-im.utils.ethereum.erc721 :as erc721] - [status-im.utils.ethereum.tokens :as tokens] + (:require [clojure.string :as string] [re-frame.core :as re-frame] - [status-im.utils.handlers :as handlers] [status-im.constants :as constants] - [status-im.utils.ethereum.core :as ethereum] - [clojure.string :as string])) + [status-im.ethereum.core :as ethereum] + [status-im.ethereum.erc721 :as erc721] + [status-im.ethereum.tokens :as tokens] + [status-im.ui.screens.wallet.collectibles.events :as collectibles] + [status-im.utils.handlers :as handlers] + [status-im.utils.http :as http])) (def kudos :KDO) diff --git a/src/status_im/ui/screens/wallet/collectibles/superrare/events.cljs b/src/status_im/ui/screens/wallet/collectibles/superrare/events.cljs index d6c9e40f74..383562b881 100644 --- a/src/status_im/ui/screens/wallet/collectibles/superrare/events.cljs +++ b/src/status_im/ui/screens/wallet/collectibles/superrare/events.cljs @@ -1,6 +1,6 @@ (ns status-im.ui.screens.wallet.collectibles.superrare.events - (:require [status-im.ui.screens.wallet.collectibles.events :as collectibles] - [status-im.utils.ethereum.core :as ethereum] + (:require [status-im.ethereum.core :as ethereum] + [status-im.ui.screens.wallet.collectibles.events :as collectibles] [status-im.utils.http :as http] [status-im.utils.types :as types])) diff --git a/src/status_im/ui/screens/wallet/components/views.cljs b/src/status_im/ui/screens/wallet/components/views.cljs index 4dc19b2f8a..6f4af222fa 100644 --- a/src/status_im/ui/screens/wallet/components/views.cljs +++ b/src/status_im/ui/screens/wallet/components/views.cljs @@ -1,35 +1,35 @@ (ns status-im.ui.screens.wallet.components.views - (:require-macros [status-im.utils.views :as views]) (:require [clojure.string :as string] - [reagent.core :as reagent] [re-frame.core :as re-frame] + [reagent.core :as reagent] + [status-im.ethereum.core :as ethereum] + [status-im.ethereum.eip55 :as eip55] + [status-im.ethereum.tokens :as tokens] [status-im.i18n :as i18n] [status-im.ui.components.bottom-buttons.view :as bottom-buttons] [status-im.ui.components.button.view :as button] - [status-im.ui.screens.chat.photos :as photos] - [status-im.ui.components.list.views :as list] - [status-im.ui.components.list.styles :as list.styles] - [status-im.ui.components.list-selection :as list-selection] - [status-im.ui.components.react :as react] - [status-im.ui.components.styles :as components.styles] - [status-im.ui.screens.wallet.components.styles :as styles] - [status-im.ui.screens.wallet.choose-recipient.views :as choose-recipient] - [status-im.ui.screens.wallet.styles :as wallet.styles] - [status-im.ui.screens.wallet.utils :as wallet.utils] - [status-im.utils.ethereum.core :as ethereum] - [status-im.utils.ethereum.tokens :as tokens] - [status-im.utils.money :as money] - [status-im.utils.platform :as platform] - [status-im.ui.components.tooltip.views :as tooltip] + [status-im.ui.components.chat-icon.screen :as chat-icon] [status-im.ui.components.colors :as colors] - [status-im.utils.core :as utils.core] - [status-im.utils.utils :as utils.utils] + [status-im.ui.components.icons.vector-icons :as vector-icons] + [status-im.ui.components.list-selection :as list-selection] + [status-im.ui.components.list.styles :as list.styles] + [status-im.ui.components.list.views :as list] + [status-im.ui.components.react :as react] + [status-im.ui.components.status-bar.view :as status-bar] + [status-im.ui.components.styles :as components.styles] [status-im.ui.components.toolbar.actions :as actions] [status-im.ui.components.toolbar.view :as toolbar] - [status-im.ui.components.status-bar.view :as status-bar] - [status-im.ui.components.icons.vector-icons :as vector-icons] - [status-im.utils.ethereum.eip55 :as eip55] - [status-im.ui.components.chat-icon.screen :as chat-icon])) + [status-im.ui.components.tooltip.views :as tooltip] + [status-im.ui.screens.chat.photos :as photos] + [status-im.ui.screens.wallet.choose-recipient.views + :as + choose-recipient] + [status-im.ui.screens.wallet.components.styles :as styles] + [status-im.ui.screens.wallet.utils :as wallet.utils] + [status-im.utils.core :as utils.core] + [status-im.utils.money :as money] + [status-im.utils.utils :as utils.utils]) + (:require-macros [status-im.utils.views :as views])) ;; Wallet tab has a different coloring scheme (dark) that forces color changes (background, text) ;; It might be replaced by some theme mechanism diff --git a/src/status_im/ui/screens/wallet/navigation.cljs b/src/status_im/ui/screens/wallet/navigation.cljs index ea606f14bb..9f7a42e976 100644 --- a/src/status_im/ui/screens/wallet/navigation.cljs +++ b/src/status_im/ui/screens/wallet/navigation.cljs @@ -1,8 +1,8 @@ (ns status-im.ui.screens.wallet.navigation (:require [re-frame.core :as re-frame] [status-im.constants :as constants] - [status-im.ui.screens.navigation :as navigation] - [status-im.utils.ethereum.core :as ethereum])) + [status-im.ethereum.core :as ethereum] + [status-im.ui.screens.navigation :as navigation])) (def transaction-send-default (let [symbol :ETH] @@ -31,4 +31,4 @@ (defmethod navigation/preload-data! :wallet-add-custom-token [db [event]] - (dissoc db :wallet/custom-token-screen)) \ No newline at end of file + (dissoc db :wallet/custom-token-screen)) diff --git a/src/status_im/ui/screens/wallet/request/views.cljs b/src/status_im/ui/screens/wallet/request/views.cljs index 5673fd6cd3..1f7cf0ece2 100644 --- a/src/status_im/ui/screens/wallet/request/views.cljs +++ b/src/status_im/ui/screens/wallet/request/views.cljs @@ -1,6 +1,9 @@ (ns status-im.ui.screens.wallet.request.views - (:require-macros [status-im.utils.views :as views]) (:require [re-frame.core :as re-frame] + [status-im.ethereum.core :as ethereum] + [status-im.ethereum.eip55 :as eip55] + [status-im.ethereum.eip681 :as eip681] + [status-im.ethereum.tokens :as tokens] [status-im.i18n :as i18n] [status-im.ui.components.bottom-buttons.view :as bottom-buttons] [status-im.ui.components.button.view :as button] @@ -9,22 +12,13 @@ [status-im.ui.components.list-selection :as list-selection] [status-im.ui.components.qr-code-viewer.views :as qr-code-viewer] [status-im.ui.components.react :as react] - [status-im.ui.components.status-bar.view :as status-bar] - [status-im.ui.components.toolbar.actions :as actions] - [status-im.ui.components.toolbar.view :as toolbar] - [status-im.ui.screens.wallet.request.styles :as styles] - [status-im.ui.screens.wallet.styles :as wallet.styles] [status-im.ui.components.styles :as components.styles] + [status-im.ui.components.toolbar.view :as toolbar] [status-im.ui.screens.wallet.components.views :as wallet.components] - [status-im.ui.screens.wallet.components.views :as components] - [status-im.utils.ethereum.core :as ethereum] - [status-im.utils.ethereum.eip681 :as eip681] - [status-im.utils.utils :as utils] - [status-im.utils.ethereum.tokens :as tokens] + [status-im.ui.screens.wallet.request.styles :as styles] [status-im.ui.screens.wallet.utils :as wallet.utils] - [status-im.ui.screens.chat.photos :as photos] - [status-im.ui.components.list.styles :as list.styles] - [status-im.utils.ethereum.eip55 :as eip55])) + [status-im.utils.utils :as utils]) + (:require-macros [status-im.utils.views :as views])) ;; Request screen @@ -44,19 +38,22 @@ [common/network-info {:text-color :white}] [react/scroll-view {:ref #(reset! scroll %) :keyboardShouldPersistTaps :always} [react/view styles/request-details-wrapper - [components/recipient-selector {:contact-only? true - :address to - :name to-name - :request? true}] - [components/asset-selector {:disabled? false - :type :request - :symbol symbol}] - [components/amount-selector {:error amount-error - :disabled? (= :offline network-status) - :amount amount - :amount-text amount-text - :input-options {:on-focus (fn [] (when @scroll (utils/set-timeout #(.scrollToEnd @scroll) 100))) - :on-change-text #(re-frame/dispatch [:wallet.request/set-and-validate-amount % symbol decimals])}} + [wallet.components/recipient-selector + {:contact-only? true + :address to + :name to-name + :request? true}] + [wallet.components/asset-selector + {:disabled? false + :type :request + :symbol symbol}] + [wallet.components/amount-selector + {:error amount-error + :disabled? (= :offline network-status) + :amount amount + :amount-text amount-text + :input-options {:on-focus (fn [] (when @scroll (utils/set-timeout #(.scrollToEnd @scroll) 100))) + :on-change-text #(re-frame/dispatch [:wallet.request/set-and-validate-amount % symbol decimals])}} token]]] [bottom-buttons/bottom-buttons styles/bottom-buttons nil ;; Force a phantom button to ensure consistency with other transaction screens which define 2 buttons diff --git a/src/status_im/ui/screens/wallet/send/events.cljs b/src/status_im/ui/screens/wallet/send/events.cljs index cec87137a7..83a1f76d9e 100644 --- a/src/status_im/ui/screens/wallet/send/events.cljs +++ b/src/status_im/ui/screens/wallet/send/events.cljs @@ -2,13 +2,13 @@ (:require [re-frame.core :as re-frame] [status-im.chat.commands.sending :as commands-sending] [status-im.constants :as constants] + [status-im.ethereum.abi-spec :as abi-spec] + [status-im.ethereum.core :as ethereum] + [status-im.ethereum.tokens :as tokens] [status-im.i18n :as i18n] [status-im.native-module.core :as status] [status-im.transport.utils :as transport.utils] [status-im.ui.screens.navigation :as navigation] - [status-im.utils.ethereum.abi-spec :as abi-spec] - [status-im.utils.ethereum.core :as ethereum] - [status-im.utils.ethereum.tokens :as tokens] [status-im.utils.fx :as fx] [status-im.utils.handlers :as handlers] [status-im.utils.money :as money] diff --git a/src/status_im/ui/screens/wallet/send/views.cljs b/src/status_im/ui/screens/wallet/send/views.cljs index 3cf7f30053..48d30acb1f 100644 --- a/src/status_im/ui/screens/wallet/send/views.cljs +++ b/src/status_im/ui/screens/wallet/send/views.cljs @@ -1,10 +1,13 @@ (ns status-im.ui.screens.wallet.send.views - (:require-macros [status-im.utils.views :refer [defview letsubs]]) (:require [re-frame.core :as re-frame] + [reagent.core :as reagent] + [status-im.ethereum.core :as ethereum] + [status-im.ethereum.tokens :as tokens] [status-im.i18n :as i18n] [status-im.ui.components.animation :as animation] [status-im.ui.components.bottom-buttons.view :as bottom-buttons] [status-im.ui.components.button.view :as button] + [status-im.ui.components.colors :as colors] [status-im.ui.components.common.common :as common] [status-im.ui.components.icons.vector-icons :as vector-icons] [status-im.ui.components.react :as react] @@ -13,23 +16,20 @@ [status-im.ui.components.toolbar.actions :as actions] [status-im.ui.components.toolbar.view :as toolbar] [status-im.ui.components.tooltip.views :as tooltip] - [status-im.ui.screens.wallet.components.styles :as wallet.components.styles] - [status-im.ui.screens.wallet.components.views :as components] + [status-im.ui.screens.wallet.components.styles + :as + wallet.components.styles] [status-im.ui.screens.wallet.components.views :as wallet.components] + [status-im.ui.screens.wallet.main.views :as wallet.main.views] [status-im.ui.screens.wallet.send.animations :as send.animations] [status-im.ui.screens.wallet.send.styles :as styles] [status-im.ui.screens.wallet.styles :as wallet.styles] - [status-im.ui.screens.wallet.main.views :as wallet.main.views] + [status-im.ui.screens.wallet.utils :as wallet.utils] [status-im.utils.money :as money] [status-im.utils.security :as security] [status-im.utils.utils :as utils] - [status-im.utils.ethereum.tokens :as tokens] - [status-im.utils.ethereum.core :as ethereum] - [status-im.transport.utils :as transport.utils] - [taoensso.timbre :as log] - [reagent.core :as reagent] - [status-im.ui.components.colors :as colors] - [status-im.ui.screens.wallet.utils :as wallet.utils])) + [taoensso.timbre :as log]) + (:require-macros [status-im.utils.views :refer [defview letsubs]])) (defn- toolbar [modal? title] (let [action (if modal? actions/close-white actions/back-white)] @@ -168,22 +168,25 @@ (when-not online? [wallet.main.views/snackbar :t/error-cant-send-transaction-offline]) [react/view styles/send-transaction-form - [components/recipient-selector {:disabled? (or from-chat? modal? show-password-input?) - :address to - :name to-name - :modal? modal?}] - [components/asset-selector {:disabled? (or from-chat? modal? show-password-input?) - :error asset-error - :type :send - :symbol symbol}] - [components/amount-selector {:disabled? (or from-chat? modal? show-password-input?) - :error (or amount-error - (when-not sufficient-funds? (i18n/label :t/wallet-insufficient-funds)) - (when-not sufficient-gas? (i18n/label :t/wallet-insufficient-gas))) - :amount amount - :amount-text amount-text - :input-options {:on-change-text #(re-frame/dispatch [:wallet.send/set-and-validate-amount % symbol decimals]) - :ref (partial reset! amount-input)}} token] + [wallet.components/recipient-selector + {:disabled? (or from-chat? modal? show-password-input?) + :address to + :name to-name + :modal? modal?}] + [wallet.components/asset-selector + {:disabled? (or from-chat? modal? show-password-input?) + :error asset-error + :type :send + :symbol symbol}] + [wallet.components/amount-selector + {:disabled? (or from-chat? modal? show-password-input?) + :error (or amount-error + (when-not sufficient-funds? (i18n/label :t/wallet-insufficient-funds)) + (when-not sufficient-gas? (i18n/label :t/wallet-insufficient-gas))) + :amount amount + :amount-text amount-text + :input-options {:on-change-text #(re-frame/dispatch [:wallet.send/set-and-validate-amount % symbol decimals]) + :ref (partial reset! amount-input)}} token] [advanced-options advanced? native-currency transaction scroll] (when keycard? [signing-phrase-view signing-phrase])]] diff --git a/src/status_im/ui/screens/wallet/settings/views.cljs b/src/status_im/ui/screens/wallet/settings/views.cljs index bbccf7a861..ab0b893a0f 100644 --- a/src/status_im/ui/screens/wallet/settings/views.cljs +++ b/src/status_im/ui/screens/wallet/settings/views.cljs @@ -1,26 +1,25 @@ (ns status-im.ui.screens.wallet.settings.views - (:require-macros [status-im.utils.views :refer [defview letsubs]]) (:require [re-frame.core :as re-frame] + [status-im.ethereum.core :as ethereum] + [status-im.ethereum.tokens :as tokens] [status-im.i18n :as i18n] + [status-im.ui.components.action-button.action-button :as action-button] + [status-im.ui.components.chat-icon.screen :as chat-icon] [status-im.ui.components.colors :as colors] + [status-im.ui.components.list-header.views :as list-header] [status-im.ui.components.list.views :as list] [status-im.ui.components.react :as react] - [status-im.ui.components.styles :as components.styles] - [status-im.ui.components.toolbar.view :as toolbar] - [status-im.ui.components.toolbar.actions :as toolbar.actions] [status-im.ui.components.status-bar.view :as status-bar] - [status-im.utils.ethereum.core :as ethereum] - [status-im.utils.ethereum.tokens :as tokens] + [status-im.ui.components.styles :as components.styles] [status-im.ui.components.toolbar.actions :as actions] - [status-im.ui.components.action-button.action-button :as action-button] - [status-im.ui.components.list-header.views :as list-header] - [status-im.ui.components.chat-icon.screen :as chat-icon])) + [status-im.ui.components.toolbar.view :as toolbar]) + (:require-macros [status-im.utils.views :refer [defview letsubs]])) (defn toolbar [] [toolbar/toolbar nil [toolbar/nav-button - (toolbar.actions/back #(re-frame/dispatch - [:wallet.settings.ui/navigate-back-pressed]))] + (actions/back #(re-frame/dispatch + [:wallet.settings.ui/navigate-back-pressed]))] [toolbar/content-title (i18n/label :t/wallet-assets)]]) diff --git a/src/status_im/ui/screens/wallet/transaction_fee/views.cljs b/src/status_im/ui/screens/wallet/transaction_fee/views.cljs index 9d6bd84069..100c5df75c 100644 --- a/src/status_im/ui/screens/wallet/transaction_fee/views.cljs +++ b/src/status_im/ui/screens/wallet/transaction_fee/views.cljs @@ -1,9 +1,11 @@ (ns status-im.ui.screens.wallet.transaction-fee.views - (:require-macros [status-im.utils.views :refer [defview letsubs]]) (:require [re-frame.core :as re-frame] + [status-im.ethereum.core :as ethereum] + [status-im.ethereum.tokens :as tokens] [status-im.i18n :as i18n] [status-im.ui.components.bottom-buttons.view :as bottom-buttons] [status-im.ui.components.button.view :as button] + [status-im.ui.components.colors :as colors] [status-im.ui.components.react :as react] [status-im.ui.components.styles :as components.styles] [status-im.ui.components.toolbar.actions :as act] @@ -11,12 +13,9 @@ [status-im.ui.components.tooltip.views :as tooltip] [status-im.ui.screens.wallet.components.views :as components] [status-im.ui.screens.wallet.send.styles :as styles] - [status-im.ui.screens.wallet.styles :as wallet.styles] - [status-im.utils.money :as money] - [status-im.utils.ethereum.tokens :as tokens] - [status-im.utils.ethereum.core :as ethereum] - [status-im.ui.components.colors :as colors] - [status-im.ui.screens.wallet.utils :as wallet.utils])) + [status-im.ui.screens.wallet.utils :as wallet.utils] + [status-im.utils.money :as money]) + (:require-macros [status-im.utils.views :refer [defview letsubs]])) (defn- toolbar [title] [toolbar/toolbar diff --git a/src/status_im/ui/screens/wallet/transactions/views.cljs b/src/status_im/ui/screens/wallet/transactions/views.cljs index dc1aeba6bc..ed6acac44e 100644 --- a/src/status_im/ui/screens/wallet/transactions/views.cljs +++ b/src/status_im/ui/screens/wallet/transactions/views.cljs @@ -8,11 +8,7 @@ [status-im.ui.components.styles :as components.styles] [status-im.ui.components.toolbar.actions :as actions] [status-im.ui.components.toolbar.view :as toolbar] - [status-im.ui.screens.wallet.transactions.styles :as styles] - [status-im.ui.screens.wallet.utils :as wallet.utils] - [status-im.utils.ethereum.core :as ethereum] - [status-im.utils.ethereum.tokens :as tokens] - [status-im.utils.money :as money]) + [status-im.ui.screens.wallet.transactions.styles :as styles]) (:require-macros [status-im.utils.views :refer [defview letsubs]])) ;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/src/status_im/utils/db.cljs b/src/status_im/utils/db.cljs index a96953e009..4584dca092 100644 --- a/src/status_im/utils/db.cljs +++ b/src/status_im/utils/db.cljs @@ -1,8 +1,6 @@ (ns status-im.utils.db - (:require [clojure.string :as string] - [cljs.spec.alpha :as spec] - [status-im.js-dependencies :as dependencies] - [status-im.utils.ethereum.core :as ethereum])) + (:require [cljs.spec.alpha :as spec] + [status-im.ethereum.core :as ethereum])) (defn valid-public-key? [s] (boolean (re-matches #"0x04[0-9a-f]{128}" s))) diff --git a/src/status_im/utils/universal_links/core.cljs b/src/status_im/utils/universal_links/core.cljs index e3ebb6d249..52008f1dea 100644 --- a/src/status_im/utils/universal_links/core.cljs +++ b/src/status_im/utils/universal_links/core.cljs @@ -1,12 +1,13 @@ (ns status-im.utils.universal-links.core (:require [cljs.spec.alpha :as spec] [goog.string :as gstring] - [goog.string.format] [re-frame.core :as re-frame] [status-im.accounts.db :as accounts.db] [status-im.chat.models :as chat] - [status-im.pairing.core :as pairing] + [status-im.constants :as constants] + [status-im.ethereum.eip681 :as eip681] [status-im.extensions.registry :as extensions.registry] + [status-im.pairing.core :as pairing] [status-im.ui.components.list-selection :as list-selection] [status-im.ui.components.react :as react] [status-im.ui.screens.add-new.new-chat.db :as new-chat.db] @@ -14,10 +15,8 @@ [status-im.ui.screens.navigation :as navigation] [status-im.utils.config :as config] [status-im.utils.fx :as fx] - [status-im.utils.ethereum.eip681 :as eip681] - [taoensso.timbre :as log] [status-im.utils.platform :as platform] - [status-im.constants :as constants])) + [taoensso.timbre :as log])) ;; TODO(yenda) investigate why `handle-universal-link` event is ;; dispatched 7 times for the same link diff --git a/src/status_im/utils/varint.cljs b/src/status_im/utils/varint.cljs index 9c4d099c03..9c863f95fb 100644 --- a/src/status_im/utils/varint.cljs +++ b/src/status_im/utils/varint.cljs @@ -1,6 +1,6 @@ (ns ^{:doc "Implementation of varint based on https://github.com/chrisdickinson/varint"} status-im.utils.varint - (:require [status-im.utils.ethereum.abi-spec :as abi-spec] + (:require [status-im.ethereum.abi-spec :as abi-spec] [status-im.js-dependencies :as dependencies])) (def utils dependencies/web3-utils) diff --git a/src/status_im/wallet/core.cljs b/src/status_im/wallet/core.cljs index 2a3580310b..e638b40968 100644 --- a/src/status_im/wallet/core.cljs +++ b/src/status_im/wallet/core.cljs @@ -3,15 +3,15 @@ [re-frame.core :as re-frame] [status-im.accounts.update.core :as accounts.update] [status-im.constants :as constants] + [status-im.ethereum.abi-spec :as abi-spec] + [status-im.ethereum.core :as ethereum] [status-im.ethereum.json-rpc :as json-rpc] + [status-im.ethereum.tokens :as tokens] [status-im.i18n :as i18n] [status-im.ui.screens.navigation :as navigation] [status-im.ui.screens.wallet.utils :as wallet.utils] [status-im.utils.config :as config] [status-im.utils.core :as utils.core] - [status-im.utils.ethereum.abi-spec :as abi-spec] - [status-im.utils.ethereum.core :as ethereum] - [status-im.utils.ethereum.tokens :as tokens] [status-im.utils.fx :as fx] [status-im.utils.hex :as utils.hex] [status-im.utils.money :as money] diff --git a/src/status_im/wallet/custom_tokens/core.cljs b/src/status_im/wallet/custom_tokens/core.cljs index b2235e5bf4..25ff80bda3 100644 --- a/src/status_im/wallet/custom_tokens/core.cljs +++ b/src/status_im/wallet/custom_tokens/core.cljs @@ -1,14 +1,14 @@ (ns status-im.wallet.custom-tokens.core (:require [clojure.string :as string] [re-frame.core :as re-frame] + [status-im.ethereum.core :as ethereum] [status-im.ethereum.decode :as decode] [status-im.ethereum.json-rpc :as json-rpc] [status-im.i18n :as i18n] [status-im.ui.components.colors :as colors] [status-im.ui.components.react :as react] - [status-im.utils.ethereum.core :as ethereum] - [status-im.utils.money :as money] [status-im.utils.fx :as fx] + [status-im.utils.money :as money] [status-im.wallet.core :as wallet])) (re-frame/reg-fx diff --git a/src/status_im/web3/core.cljs b/src/status_im/web3/core.cljs index 514e81ac98..39d49ca32e 100644 --- a/src/status_im/web3/core.cljs +++ b/src/status_im/web3/core.cljs @@ -2,7 +2,7 @@ (:require [re-frame.core :as re-frame] [status-im.utils.fx :as fx] [status-im.js-dependencies :as dependencies] - [status-im.utils.ethereum.core :as ethereum] + [status-im.ethereum.core :as ethereum] [status-im.node.core :as node] [status-im.protocol.core :as protocol] [taoensso.timbre :as log] diff --git a/test/appium/tests/test_api.py b/test/appium/tests/test_api.py index aee9df9b9c..e9ff8f9ba6 100644 --- a/test/appium/tests/test_api.py +++ b/test/appium/tests/test_api.py @@ -11,7 +11,7 @@ from tests import marks def get_parameters(): directory = os.sep.join(__file__.split(os.sep)[:-4]) - file_path = path.join(directory, 'src/status_im/utils/ethereum/tokens.cljs') + file_path = path.join(directory, 'src/status_im/ethereum/tokens.cljs') with open(file_path, 'r') as f: data = f.read() return re.findall('{:symbol\s*:(.*)\n\s*:name\s*"(.*)"\n\s*:address\s*"(.*)"\n\s*:decimals\s*(.*)}', data) diff --git a/test/cljs/status_im/test/utils/ethereum/abi_spec.cljs b/test/cljs/status_im/test/ethereum/abi_spec.cljs similarity index 98% rename from test/cljs/status_im/test/utils/ethereum/abi_spec.cljs rename to test/cljs/status_im/test/ethereum/abi_spec.cljs index 080a3dda95..403c7bfa02 100644 --- a/test/cljs/status_im/test/utils/ethereum/abi_spec.cljs +++ b/test/cljs/status_im/test/ethereum/abi_spec.cljs @@ -1,6 +1,6 @@ -(ns status-im.test.utils.ethereum.abi-spec +(ns status-im.test.ethereum.abi-spec (:require [cljs.test :refer-macros [deftest is testing]] - [status-im.utils.ethereum.abi-spec :as abi-spec])) + [status-im.ethereum.abi-spec :as abi-spec])) (deftest hex-to-number (testing "hex number is less than 53 bits, it returns a number") diff --git a/test/cljs/status_im/test/utils/ethereum/core.cljs b/test/cljs/status_im/test/ethereum/core.cljs similarity index 76% rename from test/cljs/status_im/test/utils/ethereum/core.cljs rename to test/cljs/status_im/test/ethereum/core.cljs index 629ceb6070..969edc3ecc 100644 --- a/test/cljs/status_im/test/utils/ethereum/core.cljs +++ b/test/cljs/status_im/test/ethereum/core.cljs @@ -1,6 +1,6 @@ -(ns status-im.test.utils.ethereum.core +(ns status-im.test.ethereum.core (:require [cljs.test :refer-macros [deftest is]] - [status-im.utils.ethereum.core :as ethereum])) + [status-im.ethereum.core :as ethereum])) (deftest chain-id->chain-keyword (is (= (ethereum/chain-id->chain-keyword 1) :mainnet)) diff --git a/test/cljs/status_im/test/utils/ethereum/eip55.cljs b/test/cljs/status_im/test/ethereum/eip55.cljs similarity index 84% rename from test/cljs/status_im/test/utils/ethereum/eip55.cljs rename to test/cljs/status_im/test/ethereum/eip55.cljs index 4b53068bed..6ee9eef4bf 100644 --- a/test/cljs/status_im/test/utils/ethereum/eip55.cljs +++ b/test/cljs/status_im/test/ethereum/eip55.cljs @@ -1,6 +1,6 @@ -(ns status-im.test.utils.ethereum.eip55 - (:require [cljs.test :refer-macros [deftest is testing]] - [status-im.utils.ethereum.eip55 :as eip55])) +(ns status-im.test.ethereum.eip55 + (:require [cljs.test :refer-macros [deftest is]] + [status-im.ethereum.eip55 :as eip55])) (deftest valid-address-checksum? (is (= true (eip55/valid-address-checksum? "0x52908400098527886E0F7030069857D2E4169EE7"))) @@ -13,4 +13,4 @@ (is (= true (eip55/valid-address-checksum? "0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb"))) (is (= false (eip55/valid-address-checksum? "0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9adB"))) (is (= false (eip55/valid-address-checksum? "0x8617e340b3d01fa5f11f306f4090fd50e238070d"))) - (is (= false (eip55/valid-address-checksum? "0xDE709F2102306220921060314715629080E2fB77")))) \ No newline at end of file + (is (= false (eip55/valid-address-checksum? "0xDE709F2102306220921060314715629080E2fB77")))) diff --git a/test/cljs/status_im/test/utils/ethereum/eip681.cljs b/test/cljs/status_im/test/ethereum/eip681.cljs similarity index 99% rename from test/cljs/status_im/test/utils/ethereum/eip681.cljs rename to test/cljs/status_im/test/ethereum/eip681.cljs index 10001db883..2103251237 100644 --- a/test/cljs/status_im/test/utils/ethereum/eip681.cljs +++ b/test/cljs/status_im/test/ethereum/eip681.cljs @@ -1,6 +1,6 @@ -(ns status-im.test.utils.ethereum.eip681 +(ns status-im.test.ethereum.eip681 (:require [cljs.test :refer-macros [deftest is testing]] - [status-im.utils.ethereum.eip681 :as eip681] + [status-im.ethereum.eip681 :as eip681] [status-im.utils.money :as money])) (deftest parse-uri diff --git a/test/cljs/status_im/test/utils/ethereum/ens.cljs b/test/cljs/status_im/test/ethereum/ens.cljs similarity index 82% rename from test/cljs/status_im/test/utils/ethereum/ens.cljs rename to test/cljs/status_im/test/ethereum/ens.cljs index 779ad11aa5..3c0d03aef7 100644 --- a/test/cljs/status_im/test/utils/ethereum/ens.cljs +++ b/test/cljs/status_im/test/ethereum/ens.cljs @@ -1,6 +1,6 @@ -(ns status-im.test.utils.ethereum.ens +(ns status-im.test.ethereum.ens (:require [cljs.test :refer-macros [deftest is testing]] - [status-im.utils.ethereum.ens :as ens])) + [status-im.ethereum.ens :as ens])) (deftest namehash (is (= (str "0x" ens/default-namehash) (ens/namehash nil))) diff --git a/test/cljs/status_im/test/utils/ethereum/mnemonic.cljs b/test/cljs/status_im/test/ethereum/mnemonic.cljs similarity index 92% rename from test/cljs/status_im/test/utils/ethereum/mnemonic.cljs rename to test/cljs/status_im/test/ethereum/mnemonic.cljs index 90b0ee65b1..7a4601329f 100644 --- a/test/cljs/status_im/test/utils/ethereum/mnemonic.cljs +++ b/test/cljs/status_im/test/ethereum/mnemonic.cljs @@ -1,6 +1,6 @@ -(ns status-im.test.utils.ethereum.mnemonic +(ns status-im.test.ethereum.mnemonic (:require [cljs.test :refer-macros [deftest is testing]] - [status-im.utils.ethereum.mnemonic :as mnemonic])) + [status-im.ethereum.mnemonic :as mnemonic])) (deftest valid-words? (is (not (mnemonic/valid-words? ["rate" "rate"]))) diff --git a/test/cljs/status_im/test/runner.cljs b/test/cljs/status_im/test/runner.cljs index 4d7bb92f8e..083ac3c3de 100644 --- a/test/cljs/status_im/test/runner.cljs +++ b/test/cljs/status_im/test/runner.cljs @@ -1,70 +1,70 @@ (ns status-im.test.runner (:require [doo.runner :refer-macros [doo-tests]] - [status-im.test.contacts.db] + [status-im.test.accounts.recover.core] + [status-im.test.browser.core] + [status-im.test.browser.permissions] + [status-im.test.chat.commands.core] + [status-im.test.chat.commands.impl.transactions] + [status-im.test.chat.commands.input] + [status-im.test.chat.db] + [status-im.test.chat.models.input] + [status-im.test.chat.models.loading] + [status-im.test.chat.models.message-content] + [status-im.test.chat.models.message] + [status-im.test.chat.models] + [status-im.test.chat.views.photos] + [status-im.test.contact-code.core] + [status-im.test.contact-recovery.core] [status-im.test.contacts.device-info] [status-im.test.data-store.chats] [status-im.test.data-store.core] [status-im.test.data-store.realm.core] + [status-im.test.ethereum.abi-spec] + [status-im.test.ethereum.core] + [status-im.test.ethereum.eip55] + [status-im.test.ethereum.eip681] + [status-im.test.ethereum.ens] + [status-im.test.ethereum.mnemonic] [status-im.test.extensions.core] [status-im.test.extensions.ethereum] - [status-im.test.browser.core] - [status-im.test.browser.permissions] - [status-im.test.wallet.subs] - [status-im.test.wallet.transactions] - [status-im.test.wallet.transactions.subs] - [status-im.test.mailserver.core] [status-im.test.fleet.core] [status-im.test.group-chats.core] - [status-im.test.pairing.core] - [status-im.test.node.core] - [status-im.test.models.bootnode] + [status-im.test.hardwallet.core] + [status-im.test.i18n] + [status-im.test.init.core] + [status-im.test.mailserver.core] [status-im.test.models.account] + [status-im.test.models.bootnode] [status-im.test.models.contact] [status-im.test.models.network] [status-im.test.models.wallet] + [status-im.test.node.core] + [status-im.test.pairing.core] [status-im.test.search.core] + [status-im.test.sign-in.flow] [status-im.test.transport.core] - [status-im.test.chat.models] - [status-im.test.chat.models.input] - [status-im.test.chat.models.loading] - [status-im.test.chat.models.message] - [status-im.test.chat.models.message-content] - [status-im.test.chat.db] - [status-im.test.chat.views.photos] - [status-im.test.chat.commands.core] - [status-im.test.chat.commands.input] - [status-im.test.chat.commands.impl.transactions] - [status-im.test.i18n] - [status-im.test.utils.utils] - [status-im.test.utils.money] - [status-im.test.utils.clocks] - [status-im.test.utils.contenthash] - [status-im.test.utils.ethereum.eip55] - [status-im.test.utils.ethereum.eip681] - [status-im.test.utils.ethereum.core] - [status-im.test.utils.ethereum.abi-spec] - [status-im.test.utils.ethereum.ens] - [status-im.test.utils.ethereum.mnemonic] - [status-im.test.utils.random] - [status-im.test.utils.gfycat.core] - [status-im.test.utils.signing-phrase.core] - [status-im.test.utils.transducers] - [status-im.test.utils.async] - [status-im.test.utils.datetime] - [status-im.test.utils.prices] - [status-im.test.utils.keychain.core] - [status-im.test.utils.universal-links.core] - [status-im.test.utils.http] - [status-im.test.init.core] [status-im.test.ui.screens.add-new.models] - [status-im.test.utils.fx] - [status-im.test.accounts.recover.core] - [status-im.test.hardwallet.core] - [status-im.test.contact-recovery.core] - [status-im.test.contact-code.core] [status-im.test.ui.screens.currency-settings.models] [status-im.test.ui.screens.wallet.db] - [status-im.test.sign-in.flow])) + [status-im.test.utils.async] + [status-im.test.utils.clocks] + [status-im.test.utils.contenthash] + [status-im.test.utils.datetime] + [status-im.test.utils.fx] + [status-im.test.utils.gfycat.core] + [status-im.test.utils.http] + [status-im.test.utils.keychain.core] + [status-im.test.utils.money] + [status-im.test.utils.prices] + [status-im.test.utils.random] + [status-im.test.utils.signing-phrase.core] + [status-im.test.utils.transducers] + [status-im.test.utils.universal-links.core] + [status-im.test.utils.utils] + [status-im.test.wallet.subs] + [status-im.test.wallet.transactions.subs] + [status-im.test.wallet.transactions] + [status-im.test.contacts.db])) (enable-console-print!) @@ -75,68 +75,68 @@ (set! goog.DEBUG false) (doo-tests - 'status-im.test.utils.async + 'status-im.test.accounts.recover.core + 'status-im.test.browser.core + 'status-im.test.browser.permissions + 'status-im.test.chat.commands.core + 'status-im.test.chat.commands.impl.transactions + 'status-im.test.chat.commands.input 'status-im.test.chat.db - 'status-im.test.contacts.db - 'status-im.test.contacts.device-info 'status-im.test.chat.models - 'status-im.test.init.core - 'status-im.test.data-store.chats - 'status-im.test.data-store.core - 'status-im.test.data-store.realm.core - 'status-im.test.extensions.core - 'status-im.test.mailserver.core - 'status-im.test.fleet.core - 'status-im.test.group-chats.core - 'status-im.test.pairing.core - 'status-im.test.node.core - 'status-im.test.models.bootnode - 'status-im.test.models.account - 'status-im.test.models.contact - 'status-im.test.models.network - 'status-im.test.models.wallet - 'status-im.test.wallet.subs - 'status-im.test.wallet.transactions - 'status-im.test.wallet.transactions.subs - 'status-im.test.chat.models.loading 'status-im.test.chat.models.input + 'status-im.test.chat.models.loading 'status-im.test.chat.models.message 'status-im.test.chat.models.message-content 'status-im.test.chat.views.photos - 'status-im.test.chat.commands.core - 'status-im.test.chat.commands.input - 'status-im.test.chat.commands.impl.transactions - 'status-im.test.i18n - 'status-im.test.search.core - 'status-im.test.transport.core - 'status-im.test.utils.utils - 'status-im.test.utils.money - 'status-im.test.utils.clocks - 'status-im.test.utils.contenthash - 'status-im.test.utils.ethereum.eip55 - 'status-im.test.utils.ethereum.eip681 - 'status-im.test.utils.ethereum.core - 'status-im.test.utils.ethereum.mnemonic - 'status-im.test.utils.ethereum.abi-spec - 'status-im.test.utils.ethereum.ens - 'status-im.test.utils.random - 'status-im.test.utils.gfycat.core - 'status-im.test.utils.signing-phrase.core - 'status-im.test.utils.transducers - 'status-im.test.utils.datetime - 'status-im.test.utils.prices - 'status-im.test.utils.keychain.core - 'status-im.test.utils.universal-links.core - 'status-im.test.utils.http - 'status-im.test.utils.fx - 'status-im.test.ui.screens.add-new.models - 'status-im.test.accounts.recover.core + 'status-im.test.contact-code.core + 'status-im.test.contact-recovery.core + 'status-im.test.contacts.db + 'status-im.test.contacts.device-info + 'status-im.test.data-store.chats + 'status-im.test.data-store.core + 'status-im.test.data-store.realm.core + 'status-im.test.ethereum.abi-spec + 'status-im.test.ethereum.core + 'status-im.test.ethereum.eip55 + 'status-im.test.ethereum.eip681 + 'status-im.test.ethereum.ens + 'status-im.test.ethereum.mnemonic + 'status-im.test.extensions.core + 'status-im.test.extensions.ethereum + 'status-im.test.fleet.core + 'status-im.test.group-chats.core 'status-im.test.hardwallet.core + 'status-im.test.i18n + 'status-im.test.init.core + 'status-im.test.mailserver.core + 'status-im.test.models.account + 'status-im.test.models.bootnode + 'status-im.test.models.contact + 'status-im.test.models.network + 'status-im.test.models.wallet + 'status-im.test.node.core + 'status-im.test.pairing.core + 'status-im.test.search.core + 'status-im.test.sign-in.flow + 'status-im.test.transport.core + 'status-im.test.ui.screens.add-new.models 'status-im.test.ui.screens.currency-settings.models 'status-im.test.ui.screens.wallet.db - 'status-im.test.browser.core - 'status-im.test.contact-recovery.core - 'status-im.test.contact-code.core - 'status-im.test.extensions.ethereum - 'status-im.test.browser.permissions - 'status-im.test.sign-in.flow) + 'status-im.test.utils.async + 'status-im.test.utils.clocks + 'status-im.test.utils.contenthash + 'status-im.test.utils.datetime + 'status-im.test.utils.fx + 'status-im.test.utils.gfycat.core + 'status-im.test.utils.http + 'status-im.test.utils.keychain.core + 'status-im.test.utils.money + 'status-im.test.utils.prices + 'status-im.test.utils.random + 'status-im.test.utils.signing-phrase.core + 'status-im.test.utils.transducers + 'status-im.test.utils.universal-links.core + 'status-im.test.utils.utils + 'status-im.test.wallet.subs + 'status-im.test.wallet.transactions + 'status-im.test.wallet.transactions.subs)