Skip to content

Commit

Permalink
chore: rename opt to oeth (#19974)
Browse files Browse the repository at this point in the history
chore: rename opt to oeth (#19974)
  • Loading branch information
OmarBasem authored May 17, 2024
1 parent 9d302d8 commit 624593e
Show file tree
Hide file tree
Showing 20 changed files with 47 additions and 47 deletions.
2 changes: 1 addition & 1 deletion src/quo/components/wallet/keypair/component_spec.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
:name "Trip to Vegas"
:address "0x0ah...71a"}
:networks [{:network-name :ethereum :short-name "eth"}
{:network-name :optimism :short-name "opt"}]
{:network-name :optimism :short-name "oeth"}]
:action :none}])

(def default-details
Expand Down
2 changes: 1 addition & 1 deletion src/quo/components/wallet/summary_info/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
(when show-optimism?
[network-amount
{:network :optimism
:amount (str (:amount optimism) " " (or (:token-symbol optimism) "OPT"))
:amount (str (:amount optimism) " " (or (:token-symbol optimism) "OETH"))
:divider? show-arbitrum?
:theme theme}])
(when show-arbitrum?
Expand Down
2 changes: 1 addition & 1 deletion src/quo/foundations/colors.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@

(def ^:private get-network-full-name
{:eth :ethereum
:opt :optimism
:oeth :optimism
:arb1 :arbitrum})

(def ^:private networks-short-name
Expand Down
8 changes: 4 additions & 4 deletions src/status_im/constants.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
(def regx-community-universal-link #"((^https?://status.app/)|(^status-app://))c/([\x00-\x7F]+)$")
(def regx-deep-link #"((^ethereum:.*)|(^status-app://[\x00-\x7F]+$))")
(def regx-ens #"^(?=.{5,255}$)([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.[a-zA-Z]{2,}$")
(def regx-multichain-address #"^(?:(?:eth:|arb1:|opt:)(?=:|))*0x[0-9a-fA-F]{40}$")
(def regx-multichain-address #"^(?:(?:eth:|arb1:|oeth:)(?=:|))*0x[0-9a-fA-F]{40}$")

(def regx-address-contains #"(?i)0x[a-fA-F0-9]{40}")
(def regx-starts-with-uuid #"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}")
Expand Down Expand Up @@ -468,13 +468,13 @@

(def ^:const mainnet-short-name "eth")
(def ^:const ethereum-short-name "eth")
(def ^:const optimism-short-name "opt")
(def ^:const optimism-short-name "oeth")
(def ^:const arbitrum-short-name "arb1")

(def ^:const default-multichain-address-prefix "eth:opt:arb1:")
(def ^:const default-multichain-address-prefix "eth:oeth:arb1:")

(def ^:const mainnet-abbreviated-name "Eth.")
(def ^:const optimism-abbreviated-name "Opt.")
(def ^:const optimism-abbreviated-name "Oeth.")
(def ^:const arbitrum-abbreviated-name "Arb1.")

(def ^:const mainnet-network-name :mainnet)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
:blur? false
:title "Collectibles vault"
:networks [{:network-name :ethereum :short-name "eth"}
{:network-name :optimism :short-name "opt"}]
{:network-name :optimism :short-name "oeth"}]
:description "0x0ah...78b"
:account-avatar-emoji "🍿"
:customization-color (or customization-color :blue)}]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
:name "Trip to Vegas"
:address "0x0ah...78b"}
:networks [{:network-name :ethereum :short-name "eth"}
{:network-name :optimism :short-name "opt"}]
{:network-name :optimism :short-name "oeth"}]
:action :none
:on-press (fn [] (js/alert "Item pressed"))
:on-options-press (fn [] (js/alert "Options pressed"))
Expand Down
2 changes: 1 addition & 1 deletion src/status_im/contexts/preview/quo/list_items/address.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
[]
(let [state (reagent/atom {:address "0x0ah...78b"
:networks [{:network-name :ethereum :short-name "eth"}
{:network-name :optimism :short-name "opt"}]})]
{:network-name :optimism :short-name "oeth"}]})]
(fn []
[preview/preview-container
{:state state
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
[network]
(case network
:ethereum "eth:"
:optimism "opt:"
:optimism "oeth:"
:arbitrum "arb1:"
(str (name network) ":")))

Expand Down
10 changes: 5 additions & 5 deletions src/status_im/contexts/preview/quo/wallet/keypair.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
:name "Trip to Vegas"
:address "0x0ah...71a"}
:networks [{:network-name :ethereum :short-name "eth"}
{:network-name :optimism :short-name "opt"}]
{:network-name :optimism :short-name "oeth"}]
:state :default
:action :none}
{:account-props {:customization-color :purple
Expand All @@ -23,7 +23,7 @@
:name "My savings"
:address "0x0ah...72b"}
:networks [{:network-name :ethereum :short-name "eth"}
{:network-name :optimism :short-name "opt"}]
{:network-name :optimism :short-name "oeth"}]
:state :default
:action :none}
{:account-props {:customization-color :army
Expand All @@ -33,7 +33,7 @@
:name "Coin vault"
:address "0x0ah...73c"}
:networks [{:network-name :ethereum :short-name "eth"}
{:network-name :optimism :short-name "opt"}]
{:network-name :optimism :short-name "oeth"}]
:state :default
:action :none}
{:account-props {:customization-color :orange
Expand All @@ -43,7 +43,7 @@
:name "Crypto fortress"
:address "0x0ah...74e"}
:networks [{:network-name :ethereum :short-name "eth"}
{:network-name :optimism :short-name "opt"}]
{:network-name :optimism :short-name "oeth"}]
:state :default
:action :none}
{:account-props {:customization-color :yellow
Expand All @@ -53,7 +53,7 @@
:name "Block treasure"
:address "0x0ah...75f"}
:networks [{:network-name :ethereum :short-name "eth"}
{:network-name :optimism :short-name "opt"}]
{:network-name :optimism :short-name "oeth"}]
:state :default
:action :none}])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@
(-> (h/wait-for #(h/get-by-label-text :share-qr-code-settings))
(.then (fn []
(h/is-truthy (h/get-by-text "eth:"))
(h/is-truthy (h/get-by-text "opt:"))
(h/is-truthy (h/get-by-text "oeth:"))
(h/is-truthy (h/get-by-text "arb1:"))))))))))
4 changes: 2 additions & 2 deletions src/status_im/contexts/wallet/account/tabs/about/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
config/mainnet-chain-explorer-link
address])}
{:icon :i/link
:accessibility-label :view-on-opt
:label (i18n/label :t/view-on-opt)
:accessibility-label :view-on-oeth
:label (i18n/label :t/view-on-oeth)
:right-icon :i/external
:on-press #(rf/dispatch
[:wallet/navigate-to-chain-explorer-from-bottom-sheet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
:name name
:address address}
:networks [{:network-name :ethereum :short-name "eth"}
{:network-name :optimism :short-name "opt"}
{:network-name :optimism :short-name "oeth"}
{:network-name :arbitrum :short-name "arb1"}]
:state :default
:action :none}))))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[utils.i18n :as i18n]
[utils.re-frame :as rf]))

(def ^:private supported-networks #{:eth :arb1 :opt})
(def ^:private supported-networks #{:eth :arb1 :oeth})

(defn- contains-supported-address?
[s]
Expand Down
18 changes: 9 additions & 9 deletions src/status_im/contexts/wallet/common/utils/networks_test.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
constants/ethereum-sepolia-chain-id))
(is (= (utils/network->chain-id {:network "optimism" :testnet-enabled? true :goerli-enabled? false})
constants/optimism-sepolia-chain-id))
(is (= (utils/network->chain-id {:network "opt" :testnet-enabled? false :goerli-enabled? true})
(is (= (utils/network->chain-id {:network "oeth" :testnet-enabled? false :goerli-enabled? true})
constants/optimism-mainnet-chain-id))
(is (= (utils/network->chain-id {:network :opt :testnet-enabled? true :goerli-enabled? true})
(is (= (utils/network->chain-id {:network :oeth :testnet-enabled? true :goerli-enabled? true})
constants/optimism-goerli-chain-id))
(is (= (utils/network->chain-id {:network :arb1 :testnet-enabled? false :goerli-enabled? false})
constants/arbitrum-mainnet-chain-id))
Expand All @@ -25,24 +25,24 @@
(testing "network-preference-prefix->network-names function"
(is (= (utils/network-preference-prefix->network-names "eth")
(seq [:mainnet])))
(is (= (utils/network-preference-prefix->network-names "eth:opt")
(is (= (utils/network-preference-prefix->network-names "eth:oeth")
(seq [:mainnet :optimism])))
(is (= (utils/network-preference-prefix->network-names "eth:opt:arb1")
(is (= (utils/network-preference-prefix->network-names "eth:oeth:arb1")
(seq [:mainnet :optimism :arbitrum])))))

(deftest short-names->network-preference-prefix-test
(are [expected short-names]
(= expected (utils/short-names->network-preference-prefix short-names))
"eth:" ["eth"]
"eth:opt:" ["eth" "opt"]
"eth:opt:arb1:" ["eth" "opt" "arb1"]))
"eth:" ["eth"]
"eth:oeth:" ["eth" "oeth"]
"eth:oeth:arb1:" ["eth" "oeth" "arb1"]))

(deftest network-preference-prefix->network-names-test
(are [expected short-names]
(= expected (utils/network-preference-prefix->network-names short-names))
(seq [:mainnet]) "eth"
(seq [:mainnet :optimism]) "eth:opt"
(seq [:mainnet :optimism :arbitrum]) "eth:opt:arb1"))
(seq [:mainnet :optimism]) "eth:oeth"
(seq [:mainnet :optimism :arbitrum]) "eth:oeth:arb1"))

(deftest test-network-ids->formatted-text
(testing "Empty network-ids should return an empty string"
Expand Down
2 changes: 1 addition & 1 deletion src/status_im/contexts/wallet/common/utils_test.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
:address "x000"}]

(is (= (utils/get-wallet-qr wallet-multichain)
"eth:opt:x000"))
"eth:oeth:x000"))

(is (= (utils/get-wallet-qr wallet-singlechain)
"x000")))))
Expand Down
2 changes: 1 addition & 1 deletion src/status_im/contexts/wallet/save_address/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
name ""
ens ""
test? false
;; the chain short names should be a string like eth: or eth:arb:opt:
;; the chain short names should be a string like eth: or eth:arb:oeth:
chain-short-names (str constants/mainnet-short-name ":")}}]]
(let [address-to-save {:address address
:name name
Expand Down
12 changes: 6 additions & 6 deletions src/status_im/subs/wallet/networks_test.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
:chain-id 4
:layer 2}
{:test? true
:short-name "opt"
:short-name "oeth"
:related-chain-id 10
:chain-id 5
:layer 2}]
Expand All @@ -34,7 +34,7 @@
:chain-id 42161
:layer 2}
{:test? false
:short-name "opt"
:short-name "oeth"
:chain-id 10
:layer 2}]})

Expand All @@ -54,8 +54,8 @@
:chain-id 42161
:layer 2}
{:network-name :optimism
:short-name "opt"
:abbreviated-name "Opt."
:short-name "oeth"
:abbreviated-name "Oeth."
:chain-id 10
:layer 2}]
(map #(dissoc % :source :related-chain-id) (rf/sub [sub-name]))))))
Expand All @@ -77,8 +77,8 @@
:chain-id 42161
:layer 2}
:optimism {:network-name :optimism
:short-name "opt"
:abbreviated-name "Opt."
:short-name "oeth"
:abbreviated-name "Oeth."
:chain-id 10
:layer 2}}
(rf/sub [sub-name])))))
10 changes: 5 additions & 5 deletions src/status_im/subs/wallet/wallet_test.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
:related-chain-id 42161
:layer 2}
{:test? true
:short-name "opt"
:short-name "oeth"
:related-chain-id 10
:layer 2}]
:prod [{:test? false
Expand All @@ -175,7 +175,7 @@
:chain-id 42161
:layer 2}
{:test? false
:short-name "opt"
:short-name "oeth"
:chain-id 10
:layer 2}]})

Expand Down Expand Up @@ -477,9 +477,9 @@
:chain-id 42161
:related-chain-id nil
:layer 2}
{:short-name "opt"
{:short-name "oeth"
:network-name :optimism
:abbreviated-name "Opt."
:abbreviated-name "Oeth."
:chain-id 10
:related-chain-id nil
:layer 2}]
Expand Down Expand Up @@ -625,7 +625,7 @@
address
emoji]} wallet-account
network-options [{:network-name :ethereum :short-name "eth"}
{:network-name :optimism :short-name "opt"}
{:network-name :optimism :short-name "oeth"}
{:network-name :arbitrum :short-name "arb1"}]
size-option 20]
(is
Expand Down
6 changes: 3 additions & 3 deletions status-go-version.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
"owner": "status-im",
"repo": "status-go",
"version": "v0.179.17",
"commit-sha1": "0dbbf7c641691b3b5b6f4eb241d133aa7d42bf82",
"src-sha256": "0fp6zwb35pwmgb88xyqilw5dj8007cq9m186s915glnf94a45b7x"
"version": "v0.179.19",
"commit-sha1": "3103c298015483cb4d1ee90c8f432fcefe21927d",
"src-sha256": "0ks0ks1fxfn1vdnl5j1pygvyv8gbiixihxrc1ac39yi5q61hwccb"
}
2 changes: 1 addition & 1 deletion translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2447,7 +2447,7 @@
"opensea": "OpenSea",
"mainnet": "Mainnet",
"view-on-eth": "View on Etherscan",
"view-on-opt": "View on Optimism Explorer",
"view-on-oeth": "View on Optimism Explorer",
"view-on-arb": "View on Arbiscan",
"copy-address": "Copy address",
"show-address-qr": "Show address QR",
Expand Down

0 comments on commit 624593e

Please sign in to comment.