Compare commits

..
Author SHA1 Message Date
Volodymyr Kozieiev 4db2f93faf Fixed issue when incorrect address details where on the edit page
Data to screen was passed via rf-db and acquired in the screen via
sbuscription. But sometimes subscription wasnt calculated yet and
returned nil value. That nil value was captured by use-state and never
updated after subscription updated.
2025-02-25 10:02:40 +00:00
60 changed files with 364 additions and 568 deletions
+2 -2
View File
@@ -2,7 +2,7 @@ DEBUG_WEBVIEW=0
ETHEREUM_DEV_CLUSTER=0
EXTENSIONS=0
GROUP_CHATS_ENABLED=1
LOG_LEVEL=debug
LOG_LEVEL=
MAILSERVER_CONFIRMATIONS_ENABLED=1
MAINNET_WARNING_ENABLED=1
PFS_ENCRYPTION_ENABLED=1
@@ -20,6 +20,6 @@ FAST_CREATE_COMMUNITY_ENABLED=0
TEST_NETWORKS_ENABLED=0
STATUS_PROXY_STAGE_NAME=prod
FLAG_WALLET_CONNECT_ENABLED=1
API_LOGGING_ENABLED=1
API_LOGGING_ENABLED=0
SENTRY_ENABLED=1
SENTRY_ENVIRONMENT=production
+1 -1
View File
@@ -1 +1 @@
2.33.0
2.32.0
+1 -1
View File
@@ -71,7 +71,7 @@ in stdenv.mkDerivation rec {
};
};
buildInputs = with pkgs; [ nodejs openjdk_headless ];
buildInputs = with pkgs; [ nodejs openjdk ];
nativeBuildInputs = with pkgs; [ bash gradle unzip ]
++ lib.optionals stdenv.isDarwin [ file gnumake ];
+1 -1
View File
@@ -8,7 +8,7 @@ rec {
shell = mkShell {
buildInputs = with pkgs; [
openjdk_headless
openjdk
gradle
lsof # used in start-react-native.sh
flock # used in nix/scripts/node_modules.sh
+1 -1
View File
@@ -38,7 +38,7 @@ stdenv.mkDerivation {
];
};
};
buildInputs = with pkgs; [ clojure nodejs bash git openjdk_headless ];
buildInputs = with pkgs; [ clojure nodejs bash git openjdk];
phases = [
"unpackPhase" "secretsPhase" "patchPhase"
"configurePhase" "buildPhase" "installPhase"
+1 -1
View File
@@ -49,7 +49,7 @@ in {
nodejs = super.nodejs_20;
ruby = super.ruby_3_1;
yarn = super.yarn.override { nodejs = super.nodejs_20; };
openjdk_headless = super.openjdk17_headless;
openjdk = super.openjdk17_headless;
xcodeWrapper = callPackage ./pkgs/xcodeenv/compose-xcodewrapper.nix { } {
versions = ["16.0" "16.1" "16.2"];
};
+2 -2
View File
@@ -1,8 +1,8 @@
{ mkShell, openjdk_headless, androidPkgs }:
{ mkShell, openjdk, androidPkgs }:
mkShell {
name = "android-sdk-shell";
buildInputs = [ openjdk_headless ];
buildInputs = [ openjdk ];
shellHook = ''
export ANDROID_HOME="${androidPkgs.sdk}"
+2 -2
View File
@@ -19,7 +19,7 @@ let
# for calling clojure targets in CI or Makefile
clojure = mkShell {
buildInputs = with pkgs; [
clojure flock maven openjdk_headless
clojure flock maven openjdk
# lint specific utilities
babashka clj-kondo clojure-lsp ripgrep zprint
];
@@ -61,7 +61,7 @@ let
# for 'scripts/generate-keystore.sh'
keytool = mkShell {
buildInputs = with pkgs; [ openjdk_headless apksigner ];
buildInputs = with pkgs; [ openjdk apksigner ];
};
# for targets needing 'adb', 'apkanalyzer' and other SDK/NDK tools
+2 -2
View File
@@ -1,5 +1,5 @@
{ callPackage, lib, buildGoPackage, pkgs
, androidPkgs, openjdk_headless, gomobile, xcodeWrapper, removeReferencesTo
, androidPkgs, openjdk, gomobile, xcodeWrapper, removeReferencesTo
, go-bindata, mockgen, protobuf3_20, protoc-gen-go
, meta
, source
@@ -32,7 +32,7 @@ in buildGoPackage rec {
extraSrcPaths = [ gomobile ];
nativeBuildInputs = [
gomobile removeReferencesTo go-bindata mockgen protoc-gen-go protobuf3_20 fakeGit
] ++ optional isAndroid openjdk_headless
] ++ optional isAndroid openjdk
++ optional isIOS xcodeWrapper;
ldflags = goBuildLdFlags;
+6 -28
View File
@@ -2,41 +2,19 @@
(:require
[legacy.status-im.multiaccounts.update.core :as multiaccounts.update]
[re-frame.core :as re-frame]
[taoensso.timbre :as log]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))
(rf/defn save-log-level
{:events [:log-level.ui/change-log-level-confirmed]}
[{:keys [db]} log-level]
[{:keys [db] :as cofx} log-level]
(let [old-log-level (get-in db [:profile/profile :log-level])]
(when (not= old-log-level log-level)
(let [need-set-log-enabled? (or (empty? old-log-level) (empty? log-level))
log-enabled? (boolean (seq log-level))
rpc-calls (cond-> []
log-enabled?
(conj {:method "wakuext_setLogLevel"
:params [{:logLevel log-level}]
:on-error #(log/error "Failed to set log level" %)})
need-set-log-enabled?
(conj {:method "wakuext_setLogEnabled"
:params [log-enabled?]
:on-error #(log/error "Failed to set log enabled" %)}))]
{:fx [[:json-rpc/call
(conj (vec (map #(assoc % :on-success nil) (butlast rpc-calls)))
(assoc (last rpc-calls)
:on-success
#(rf/dispatch [:log-level/update-multiaccount log-level])))]]}))))
(rf/defn update-multiaccount
{:events [:log-level/update-multiaccount]}
[cofx log-level]
(multiaccounts.update/multiaccount-update
cofx
:log-level
log-level
{:on-success #(rf/dispatch [:profile/logout])}))
(multiaccounts.update/multiaccount-update
cofx
:log-level
log-level
{:on-success #(re-frame/dispatch [:profile/logout])}))))
(rf/defn show-change-log-level-confirmation
{:events [:log-level.ui/log-level-selected]}
@@ -33,9 +33,6 @@
name]]]]))
(def log-levels
"The status-go log library (zap) doesn't support the trace level, so we remove
the trace option from the UI. When trace is enabled an error will happen while
trying to login (user will see the error 'wrong password')."
[{:name "DISABLED"
:value ""}
{:name "ERROR"
@@ -45,7 +42,9 @@
{:name "INFO"
:value "INFO"}
{:name "DEBUG"
:value "DEBUG"}])
:value "DEBUG"}
{:name "TRACE"
:value "TRACE"}])
(views/defview log-level-settings
[]
@@ -1,15 +1,15 @@
(ns quo.components.buttons.slide-button.constants)
(def ^:constant small-dimensions
(def track-padding 4)
(def small-dimensions
{:track-height 40
:thumb 32})
(def ^:constant large-dimensions
(def large-dimensions
{:track-height 48
:thumb 40})
(def ^:constant track-padding 4)
(def ^:constant disable-opacity 0.3)
(def ^:constant default-width 300)
(def disable-opacity 0.3)
(def ^:constant reset-timeout-ms 500)
(def default-width 300)
@@ -27,8 +27,7 @@
(when (and reached-end? (not sliding-complete?))
(set-sliding-complete true)
(when on-complete
(js/setTimeout reset-fn constants/reset-timeout-ms)
(on-complete))))))
(on-complete reset-fn))))))
(gesture/on-end (fn [event]
(let [x-translation (oops/oget event "translationX")
reached-end? (>= x-translation track-width)]
@@ -56,9 +55,10 @@
on-track-layout (rn/use-callback
#(set-track-width (oops/oget % "nativeEvent.layout.width")))
reset-fn (rn/use-callback
(fn []
(fn [keep-at-end-after-slide?]
(set-sliding-complete false)
(animations/reset-track-position x-pos)))
(when-not keep-at-end-after-slide?
(animations/reset-track-position x-pos))))
dimensions (rn/use-callback
(partial utils/get-dimensions
(or track-width constants/default-width)
@@ -1,13 +0,0 @@
(ns quo.components.common.new-feature-dot
(:require [quo.components.common.new-feature-gradient :as new-feature-gradient]))
(def ^:const size 8)
(defn view
[{:keys [style accessibility-label]}]
[new-feature-gradient/view
{:style (merge {:width size
:height size
:border-radius (/ size 2)}
style)
:accessibility-label accessibility-label}])
@@ -1,16 +0,0 @@
(ns quo.components.common.new-feature-gradient
(:require [quo.foundations.colors :as colors]
[quo.theme]
[react-native.linear-gradient :as linear-gradient]))
(defn view
[{:keys [style accessibility-label]}]
(let [theme (quo.theme/use-theme)]
[linear-gradient/linear-gradient
{:style style
:accessibility-label accessibility-label
:colors [(colors/resolve-color :yellow theme)
colors/new-feature-gradient-pink]
:use-angle true
:angle 78
:angle-center {:x 0.5 :y 0.5}}]))
@@ -33,12 +33,4 @@
networks-list])
(h/is-truthy (h/query-by-label-text :network-dropdown))
(h/fire-event :press (h/query-by-label-text :network-dropdown))
(h/was-not-called on-press)))
(h/test "Should display new chain indicator"
(h/render [network-dropdown/view
{:state :default
:show-new-chain-indicator? true}
networks-list])
(h/is-truthy (h/query-by-label-text :network-dropdown))
(h/is-truthy (h/query-by-label-text :new-chain-indicator))))
(h/was-not-called on-press))))
@@ -23,7 +23,3 @@
:opacity (if (= state :disabled) 0.3 1)
:border-color (container-border-color props)
:align-items :center})
(def new-chain-indicator
{:position :absolute
:right 0})
@@ -1,13 +1,12 @@
(ns quo.components.dropdowns.network-dropdown.view
(:require
[quo.components.common.new-feature-dot :as new-feature-dot]
[quo.components.dropdowns.network-dropdown.style :as style]
[quo.components.list-items.preview-list.view :as preview-list]
[quo.theme :as quo.theme]
[react-native.core :as rn]))
(defn view
[{:keys [on-press state show-new-chain-indicator?] :as props} networks]
[{:keys [on-press state] :as props} networks]
(let [theme (quo.theme/use-theme)
[pressed? set-pressed] (rn/use-state false)
on-press-in (rn/use-callback #(set-pressed true))
@@ -19,10 +18,6 @@
:on-press on-press
:on-press-in on-press-in
:on-press-out on-press-out}
(when show-new-chain-indicator?
[new-feature-dot/view
{:style style/new-chain-indicator
:accessibility-label :new-chain-indicator}])
[preview-list/view
{:type :network
:list-size (count networks)
@@ -200,15 +200,12 @@
shown-name]]))
(defn- wallet-networks-center
[{:keys [networks networks-on-press show-new-chain-indicator? background
center-content-container-style]}]
[{:keys [networks networks-on-press background center-content-container-style]}]
[reanimated/view {:style center-content-container-style}
[network-dropdown/view
{:state :default
:on-press networks-on-press
:blur? (= background :blur)
:show-new-chain-indicator? show-new-chain-indicator?}
networks]])
{:state :default
:on-press networks-on-press
:blur? (= background :blur)} networks]])
(defn page-nav
"Props:
@@ -64,20 +64,3 @@
{:margin-top 7
:margin-bottom 2
:margin-left -1})
(def new-feature-tag-container
{:margin-left 6
:border-radius 12
:justify-content :center})
(def new-feature-tag-gradient
{:border-radius 12
:position :absolute
:left 0
:right 0
:top 0
:bottom 0})
(def new-feature-tag-text
{:color colors/white
:margin-horizontal 5})
@@ -4,7 +4,6 @@
[quo.components.avatars.icon-avatar :as icon-avatar]
[quo.components.avatars.user-avatar.view :as user-avatar]
[quo.components.buttons.button.view :as button]
[quo.components.common.new-feature-gradient :as new-feature-gradient]
[quo.components.icon :as icon]
[quo.components.list-items.preview-list.view :as preview-list]
[quo.components.markdown.text :as text]
@@ -116,9 +115,7 @@
nil)])
(defn view
[{:keys [title show-new-feature-tag? on-press action-props accessibility-label blur? container-style
content]
:as props}]
[{:keys [title on-press action-props accessibility-label blur? container-style content] :as props}]
[rn/pressable
{:style (merge style/container container-style)
:on-press (or on-press (:on-change action-props))
@@ -129,19 +126,10 @@
[rn/view {:style (style/left-sub-container props)}
[image-component props]
[rn/view {:style (style/left-container (:image props))}
[rn/view {:flex-direction :row}
[text/text
{:weight :medium
:style {:color (when blur? colors/white)}}
title]
(when show-new-feature-tag?
[rn/view {:style style/new-feature-tag-container}
[new-feature-gradient/view {:style style/new-feature-tag-gradient}]
[text/text
{:weight :semi-bold
:size :label
:style style/new-feature-tag-text}
(string/upper-case (i18n/label :t/new))]])]
[text/text
{:weight :medium
:style {:color (when blur? colors/white)}}
title]
[description-component props]
[tag-component props]]]
[rn/view {:style (style/sub-container (:alignment action-props))}
@@ -14,43 +14,48 @@
(h/describe "Wallet: Summary Info"
(h/test "Type of `status-account` title renders"
(h/render-with-theme-provider [summary-info/view
{:type :status-account
:networks-to-show {:ethereum 150
:optimism 50
:arbitrum 25}
:account-props status-account-props}])
{:type :status-account
:networks? true
:values {:ethereum 150
:optimism 50
:arbitrum 25}
:account-props status-account-props}])
(h/is-truthy (h/get-by-text "Collectibles vault")))
(h/test "Type of `user` title renders"
(h/render-with-theme-provider [summary-info/view
{:type :user
:networks-to-show {:ethereum 150
:optimism 50
:arbitrum 25}
:account-props {:full-name "M L"
:status-indicator? false
:size :small
:customization-color :blue
:name "Mark Libot"
:address "0x0ah...78b"
:status-account (merge status-account-props
{:size 16})}}])
{:type :user
:networks? true
:values {:ethereum 150
:optimism 50
:arbitrum 25}
:account-props {:full-name "M L"
:status-indicator? false
:size :small
:customization-color :blue
:name "Mark Libot"
:address "0x0ah...78b"
:status-account (merge status-account-props
{:size 16})}}])
(h/is-truthy (h/get-by-text "Mark Libot"))
(h/is-truthy (h/get-by-text "Collectibles vault")))
(h/test "Networks specified render"
(h/test "Networks true render"
(h/render-with-theme-provider [summary-info/view
{:type :status-account
:networks-to-show {:ethereum 150
:optimism 50
:arbitrum 25}
:account-props status-account-props}])
(h/is-truthy (h/get-by-label-text :networks))))
{:type :status-account
:networks? true
:values {:ethereum 150
:optimism 50
:arbitrum 25}
:account-props status-account-props}])
(h/is-truthy (h/get-by-label-text :networks)))
(h/describe "Wallet: network summary info"
(h/test "Type of `network` title renders"
(h/test "Networks false render"
(h/render-with-theme-provider [summary-info/view
{:type :network
:network-props {:full-name "Ethereum"
:network-name :ethereum}}])
(h/is-truthy (h/get-by-text "Ethereum"))))
{:type :status-account
:networks? false
:values {:ethereum 150
:optimism 50
:arbitrum 25}
:account-props status-account-props}])
(h/is-null (h/query-by-label-text :networks))))
@@ -5,9 +5,9 @@
[:catn
[:props
[:map
[:type [:enum :status-account :saved-account :account :user :token :network]]
[:type [:enum :status-account :saved-account :account :user :token]]
[:account-props {:optional true} [:maybe :map]]
[:network-props {:optional true} [:maybe :map]]
[:token-props {:optional true} [:maybe :map]]
[:networks-to-show {:optional true} [:maybe :map]]]]]
[:networks? {:optional true} [:maybe :boolean]]
[:values {:optional true} [:maybe :map]]]]]
:any])
@@ -3,13 +3,13 @@
[quo.foundations.colors :as colors]))
(defn container
[networks-to-show? theme]
[networks? theme]
{:width "100%"
:height (if networks-to-show? 90 56)
:height (if networks? 90 56)
:border-radius 16
:border-width 1
:border-color (colors/theme-colors colors/neutral-10 colors/neutral-80 theme)
:margin-bottom (if networks-to-show? 4 8)})
:margin-bottom (if networks? 4 8)})
(def info-container
{:flex-direction :row
@@ -39,7 +39,3 @@
:height 32
:flex-direction :row
:align-items :center})
(def network-icon
{:width 32
:height 32})
@@ -28,35 +28,50 @@
[rn/view
{:style (style/dot-divider theme)}])])
(def ^:private default-token-symbols
{:ethereum "ETH"
:optimism "OP"
:arbitrum "ARB"
:base "ETH"})
(defn networks
[networks-to-show theme]
(->> networks-to-show
(map-indexed
(fn [i [k {:keys [amount token-symbol]}]]
(when (or (pos? amount)
(= amount "<0.01"))
[network-amount
{:network k
:amount (str amount " " (or token-symbol (get default-token-symbols k)))
:divider? (not= (dec i) (-> networks-to-show keys count))
:theme theme}])))
(remove nil?)
(into [rn/view
{:style style/networks-container
:accessibility-label :networks}])))
[values theme]
(let [{:keys [ethereum optimism arbitrum base]} values
show-optimism? (and optimism
(or (pos? (:amount optimism))
(= (:amount optimism) "<0.01")))
show-arbitrum? (and arbitrum
(or (pos? (:amount arbitrum))
(= (:amount arbitrum) "<0.01")))
show-base? (and base
(or (pos? (:amount base))
(= (:amount base) "<0.01")))]
[rn/view
{:style style/networks-container
:accessibility-label :networks}
(when (and ethereum (pos? (:amount ethereum)))
[network-amount
{:network :ethereum
:amount (str (:amount ethereum) " " (or (:token-symbol ethereum) "ETH"))
:divider? (or show-arbitrum? show-optimism?)
:theme theme}])
(when show-optimism?
[network-amount
{:network :optimism
:amount (str (:amount optimism) " " (or (:token-symbol optimism) "OETH"))
:divider? show-arbitrum?
:theme theme}])
(when show-arbitrum?
[network-amount
{:network :arbitrum
:amount (str (:amount arbitrum) " " (or (:token-symbol arbitrum) "ARB"))
:theme theme}])
(when show-base?
[network-amount
{:network :base
:amount (str (:amount base) " " (or (:token-symbol base) "ETH"))
:theme theme}])]))
(defn- view-internal
[{:keys [type account-props network-props token-props networks-to-show]}]
[{:keys [type account-props token-props networks? values]}]
(let [theme (quo.theme/use-theme)
address (or (:address account-props) (:address token-props))]
[rn/view
{:style (style/container (seq? networks-to-show) theme)}
{:style (style/container networks? theme)}
[rn/view
{:style style/info-container}
(case type
@@ -67,26 +82,16 @@
(assoc account-props
:size :size-32
:neutral? true)]
:network [rn/image
{:source (resources/get-network (:network-name network-props))
:style style/network-icon}]
[user-avatar/user-avatar account-props])
[rn/view {:style {:margin-left 8}}
(when (not (some #{type} [:account :network]))
[text/text
{:weight :semi-bold}
(or (:name account-props) (:label token-props))])
(when (= type :network)
[text/text
{:weight :semi-bold}
(:full-name network-props)])
(when (not= type :account)
[text/text {:weight :semi-bold} (or (:name account-props) (:label token-props))])
[rn/view
{:style {:flex-direction :row
:align-items :center}}
(when (= type :user)
[:<>
[rn/view {:style {:margin-right 4}}
[account-avatar/view (:status-account account-props)]]
[rn/view {:style {:margin-right 4}} [account-avatar/view (:status-account account-props)]]
[text/text
{:size :paragraph-2
:style {:color (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)}}
@@ -100,10 +105,10 @@
:style {:color (when (not= type :account)
(colors/theme-colors colors/neutral-50 colors/neutral-40 theme))}}
address])]]]
(when networks-to-show
(when networks?
[:<>
[rn/view
{:style (style/line-divider theme)}]
[networks networks-to-show theme]])]))
[networks values theme]])]))
(def view (schema/instrument #'view-internal summary-info-schema/?schema))
@@ -18,6 +18,5 @@
[:dropdown-on-press {:optional true} [:maybe fn?]]
[:networks {:optional true}
[:maybe [:sequential [:map [:source [:maybe :schema.common/image-source]]]]]]
[:dropdown-state {:optional true} [:maybe [:enum :default :disabled]]]
[:show-new-chain-indicator? {:optional true} [:maybe :boolean]]]]]
[:dropdown-state {:optional true} [:maybe [:enum :default :disabled]]]]]]
:any])
@@ -25,7 +25,7 @@
bars))
(defn- view-info-top
[{:keys [state balance networks dropdown-on-press dropdown-state show-new-chain-indicator?]}]
[{:keys [state balance networks dropdown-on-press dropdown-state]}]
(let [theme (quo.theme/use-theme)]
[rn/view {:style style/container-info-top}
(if (= state :loading)
@@ -36,10 +36,9 @@
:style (style/style-text-heading theme)}
balance])
[network-dropdown/view
{:state (or dropdown-state :default)
:blur? true
:on-press dropdown-on-press
:show-new-chain-indicator? show-new-chain-indicator?}
{:state (or dropdown-state :default)
:blur? true
:on-press dropdown-on-press}
networks]]))
(defn- view-metrics
-2
View File
@@ -315,8 +315,6 @@
networks-short-name
socials))
(def new-feature-gradient-pink "#FF33A3")
(defn hex-string?
[s]
(and (string? s) (string/starts-with? s "#")))
@@ -26,7 +26,8 @@
:auth-button-label auth-button-label}]))
(vec (conj dependencies on-auth-success on-auth-fail)))
on-slider-complete (rn/use-callback
(fn []
(fn [reset-slider-fn]
(js/setTimeout #(reset-slider-fn false) 500)
(if (fn? on-complete)
(on-complete)
(on-complete-callback)))
+1 -2
View File
@@ -275,8 +275,7 @@
{:events [:chat/unmute-chat-community]}
[{:keys [db]} chat-id]
(let [{:keys [community-id]} (get-in db [:chats chat-id])]
(when community-id
{:db (assoc-in db [:communities community-id :muted] false)})))
{:db (assoc-in db [:communities community-id :muted] false)}))
(rf/defn mute-chat-failed
{:events [:chat/mute-failed]}
+15 -26
View File
@@ -23,7 +23,6 @@
(defn view
[]
(let [error (rf/sub [:keycard/application-info-error])
logged-in? (rf/sub [:multiaccount/logged-in?])
{:keys [title description]} (get titles error)]
[:<>
[quo/page-nav
@@ -38,31 +37,21 @@
[quo/section-label
{:section (i18n/label :t/what-you-can-do) :container-style {:padding-vertical 8}}]
(if (= error :keycard/error.keycard-empty)
(if logged-in?
[quo/settings-item
{:title (i18n/label :t/use-backup-keycard)
:image :icon
:image-props :i/placeholder
:action :arrow
:description :text
:description-props {:text (i18n/label :t/create-backup-profile-keycard)}
:on-press (fn []
(rf/dispatch [:show-bottom-sheet
{:content
(fn []
[backup.view/sheet
{:on-continue
(rf/dispatch
[:keycard/backup.create-or-enter-pin])}])}]))}]
[quo/settings-item
{:title (i18n/label :t/create-new-profile)
:image :icon
:image-props :i/profile
:action :arrow
:description :text
:description-props {:text (i18n/label :t/new-key-pair-keycard)}
:on-press (fn []
(rf/dispatch [:keycard/create.get-phrase]))}])
[quo/settings-item
{:title (i18n/label :t/use-backup-keycard)
:image :icon
:image-props :i/placeholder
:action :arrow
:description :text
:description-props {:text (i18n/label :t/create-backup-profile-keycard)}
:on-press (fn []
(rf/dispatch [:show-bottom-sheet
{:content
(fn []
[backup.view/sheet
{:on-continue
(rf/dispatch
[:keycard/backup.create-or-enter-pin])}])}]))}]
[:<>
(when (or (= error :keycard/error.keycard-frozen)
(= error :keycard/error.keycard-locked))
@@ -18,16 +18,11 @@
:padding-horizontal 36
:padding-vertical 30
:background-color (colors/theme-colors colors/white colors/neutral-95 theme)}}
[rn/text
{:style {:font-size 26
:color (colors/theme-colors "#8F8E94" "#9F9FA5" theme)
:margin-bottom 36}}
[rn/text {:style {:font-size 26 :color "#9F9FA5" :margin-bottom 36}}
(i18n/label :t/ready-to-scan)]
[rn/image {:source (resources/get-image :nfc-prompt)}]
[rn/text
{:style {:font-size 16
:color (colors/theme-colors "#09101C" :white theme)
:margin-vertical 36}}
[rn/image
{:source (resources/get-image :nfc-prompt)}]
[rn/text {:style {:font-size 16 :color :white :margin-vertical 36}}
(if connected?
(i18n/label :t/connected-dont-move)
(i18n/label :t/hold-phone-near-keycard))]
@@ -37,12 +32,6 @@
(rf/dispatch [:keycard/hide-connection-sheet]))
:style {:flex-direction :row}}
[rn/view
{:style {:background-color (colors/theme-colors "#D5D4DB" "#8E8E93" theme)
:flex 1
:align-items :center
:padding 18
:border-radius 10}}
[rn/text
{:style {:color (colors/theme-colors "#09101C" :white theme)
:font-size 16}}
{:style {:background-color "#8E8E93" :flex 1 :align-items :center :padding 18 :border-radius 10}}
[rn/text {:style {:color :white :font-size 16}}
(i18n/label :t/cancel)]]]]]))
@@ -12,15 +12,17 @@
:options [{:key :status-account}
{:key :user}
{:key :saved-account}
{:key :account}]}])
{:key :account}]}
{:key :networks? :type :boolean}])
(defn view
[]
(let [state (reagent/atom {:type :status-account
:networks-to-show {:ethereum {:amount 150}
:optimism {:amount 50}
:arbitrum {:amount 25}}})
(let [state (reagent/atom {:type :status-account
:networks? true
:values {:ethereum {:amount 150}
:optimism {:amount 50}
:arbitrum {:amount 25}}})
status-account-props {:customization-color :purple
:size 32
:emoji "🍑"
@@ -7,7 +7,6 @@
[react-native.safe-area :as safe-area]
[status-im.common.floating-button-page.view :as floating-button-page]
[status-im.contexts.settings.wallet.saved-addresses.add-address-to-save.style :as style]
[status-im.contexts.wallet.common.utils :as utils]
[status-im.contexts.wallet.common.validation :as validation]
[utils.address :as utils-address]
[utils.debounce :as debounce]
@@ -160,20 +159,17 @@
(fn [clipboard-text]
(when-not (string/blank? clipboard-text)
(-> clipboard-text
utils/on-paste-address-or-ens
utils-address/extract-address-without-chains-info
on-change-text)))))
on-press-continue (rn/use-callback
(fn []
(rf/dispatch
[:wallet/set-address-to-save
[:open-modal :screen/settings.save-address
{:address address
:ens (when ens-name? address-or-ens)
:ens? ens-name?}])
(rf/dispatch
[:open-modal :screen/settings.save-address]))
:ens? ens-name?}]))
[address ens-name? address-or-ens])]
(rn/use-unmount #(rf/dispatch [:wallet/clean-scanned-address]))
(rn/use-mount #(rf/dispatch [:wallet/clear-address-to-save]))
[quo/overlay {:type :shell}
[floating-button-page/view
{:footer-container-padding 0
@@ -143,18 +143,6 @@
(rf/reg-event-fx :wallet/add-saved-address-failed add-saved-address-failed)
(defn set-address-to-save
[{:keys [db]} [args]]
{:db (assoc-in db [:wallet :ui :saved-address] args)})
(rf/reg-event-fx :wallet/set-address-to-save set-address-to-save)
(defn clear-address-to-save
[{:keys [db]}]
{:db (update-in db [:wallet :ui] dissoc :saved-address)})
(rf/reg-event-fx :wallet/clear-address-to-save clear-address-to-save)
(defn check-remaining-capacity-for-saved-addresses
[{:keys [db]} [{:keys [on-success on-error]}]]
(let [test-networks-enabled? (boolean (get-in db [:profile/profile :test-networks-enabled?]))]
@@ -17,50 +17,48 @@
(defn view
[]
(let [{:keys [edit?]} (rf/sub [:get-screen-params])
{:keys [address name customization-color ens ens?]}
(rf/sub [:wallet/saved-address])
(let [{:keys [address name customization-color ens
ens? edit?]} (rf/sub [:get-screen-params])
[address-label set-address-label] (rn/use-state (or name ""))
[address-color set-address-color] (rn/use-state (or customization-color
(rand-nth colors/account-colors)))
placeholder (i18n/label :t/address-name)
address-text (rn/use-callback
(fn []
[quo/address-text
{:full-address? true
:address address
:format :long}])
[address])
on-press-save (rn/use-callback
(fn []
(rf/dispatch [:wallet/save-address
{:on-success
(if edit?
[:wallet/edit-saved-address-success]
[:wallet/add-saved-address-success
(i18n/label :t/address-saved)])
:on-error
[:wallet/add-saved-address-failed]
:name address-label
:ens (when ens? ens)
:address address
:customization-color address-color}]))
[address address-label
address-color])
data-item-props (rn/use-memo
#(cond-> {:status :default
:size :default
:subtitle-type :default
:label :none
:blur? true
:card? true
:title (i18n/label :t/address)
:subtitle ens
:custom-subtitle address-text
:container-style style/data-item}
ens?
(dissoc :custom-subtitle))
[ens ens? address-text])]
placeholder (i18n/label :t/address-name)
address-text (rn/use-callback
(fn []
[quo/address-text
{:full-address? true
:address address
:format :long}])
[address])
on-press-save (rn/use-callback
(fn []
(rf/dispatch [:wallet/save-address
{:on-success
(if edit?
[:wallet/edit-saved-address-success]
[:wallet/add-saved-address-success
(i18n/label :t/address-saved)])
:on-error
[:wallet/add-saved-address-failed]
:name address-label
:ens (when ens? ens)
:address address
:customization-color address-color}]))
[address address-label
address-color])
data-item-props (rn/use-memo
#(cond-> {:status :default
:size :default
:subtitle-type :default
:blur? true
:card? true
:title (i18n/label :t/address)
:subtitle ens
:custom-subtitle address-text
:container-style style/data-item}
ens?
(dissoc :custom-subtitle))
[ens ens? address-text])]
[quo/overlay {:type :shell}
[floating-button-page/view
{:footer-container-padding (if edit? (+ (safe-area/get-bottom) 12) 0)
@@ -9,7 +9,7 @@
[utils.re-frame :as rf]))
(defn view
[{:keys [name address customization-color] :as opts}]
[{:keys [name address customization-color] :as address-details}]
(let [open-send-flow (rn/use-callback
(fn []
(rf/dispatch [:wallet/init-send-flow-for-address
@@ -62,19 +62,20 @@
{:theme :dark
:shell? true
:content (fn []
[remove-address/view opts])}])
[opts])
[remove-address/view address-details])}])
[address-details])
open-show-address-qr (rn/use-callback
#(rf/dispatch [:open-modal
:screen/settings.share-saved-address opts])
[opts])
:screen/settings.share-saved-address
address-details])
[address-details])
open-edit-saved-address (rn/use-callback
(fn []
(rf/dispatch [:wallet/set-address-to-save opts])
(rf/dispatch [:open-modal
:screen/settings.edit-saved-address
{:edit? true}]))
[opts])]
(merge {:edit? true}
address-details)]))
[address-details])]
[quo/action-drawer
[[{:icon :i/arrow-up
:label (i18n/label :t/send-to-user {:user name})
@@ -7,7 +7,6 @@
[reagent.core :as reagent]
[status-im.common.floating-button-page.view :as floating-button-page]
[status-im.contexts.wallet.add-account.add-address-to-watch.style :as style]
[status-im.contexts.wallet.common.utils :as utils]
[status-im.contexts.wallet.common.validation :as validation]
[status-im.subs.wallet.add-account.address-to-watch]
[utils.address :as utils-address]
@@ -43,7 +42,7 @@
paste-on-input #(clipboard/get-string
(fn [clipboard-text]
(-> clipboard-text
utils/on-paste-address-or-ens
utils.address/extract-address-without-chains-info
on-change-text)))]
(rn/use-effect (fn []
(when-not (string/blank? scanned-address)
@@ -1,7 +1,6 @@
(ns status-im.contexts.wallet.common.account-switcher.view
(:require
[quo.core :as quo]
[react-native.core :as rn]
[status-im.contexts.wallet.sheets.account-options.view :as account-options]
[status-im.contexts.wallet.sheets.network-filter.view :as network-filter]
[status-im.contexts.wallet.sheets.select-account.view :as select-account]
@@ -31,33 +30,25 @@
type :no-title}}]
(let [{:keys [color emoji watch-only?]} (rf/sub [:wallet/current-viewing-account])
networks (rf/sub [:wallet/selected-network-details])
sending-collectible? (rf/sub [:wallet/sending-collectible?])
show-new-chain-indicator? (rf/sub [:wallet/show-new-chain-indicator?])
on-press-networks (rn/use-callback
(fn []
(rf/dispatch [:wallet/hide-new-chain-indicator])
(rf/dispatch [:show-bottom-sheet
{:content network-filter/view}])))]
sending-collectible? (rf/sub [:wallet/sending-collectible?])]
[quo/page-nav
{:type type
:icon-name icon-name
:margin-top margin-top
:background :blur
:on-press on-press
:accessibility-label accessibility-label
:networks networks
:align-center? true
:networks-on-press on-press-networks
:show-new-chain-indicator? show-new-chain-indicator?
:right-side [(when (and (ff/enabled? ::ff/wallet.wallet-connect)
(not watch-only?)
show-dapps-button?)
{:icon-name :i/dapps
:on-press #(rf/dispatch [:navigate-to
:screen/wallet.connected-dapps])})
(when-not sending-collectible?
{:content-type :account-switcher
:customization-color color
:on-press #(on-switcher-press switcher-type params)
:emoji emoji
:type (when watch-only? :watch-only)})]}]))
{:type type
:icon-name icon-name
:margin-top margin-top
:background :blur
:on-press on-press
:accessibility-label accessibility-label
:networks networks
:align-center? true
:networks-on-press #(rf/dispatch [:show-bottom-sheet {:content network-filter/view}])
:right-side [(when (and (ff/enabled? ::ff/wallet.wallet-connect)
(not watch-only?)
show-dapps-button?)
{:icon-name :i/dapps
:on-press #(rf/dispatch [:navigate-to :screen/wallet.connected-dapps])})
(when-not sending-collectible?
{:content-type :account-switcher
:customization-color color
:on-press #(on-switcher-press switcher-type params)
:emoji emoji
:type (when watch-only? :watch-only)})]}]))
+14 -22
View File
@@ -4,7 +4,6 @@
[status-im.common.qr-codes.view :as qr-codes]
[status-im.constants :as constants]
[status-im.contexts.wallet.common.utils.networks :as network-utils]
[utils.address]
[utils.money :as money]
[utils.number :as number]
[utils.string]))
@@ -325,19 +324,20 @@
(defn make-network-item
"This function generates props for quo/category component item"
[{:keys [network-name color on-change networks label-props type blur?]}]
(cond-> {:title (string/capitalize (name network-name))
:image :icon-avatar
:image-props {:icon (resources/get-network network-name)
:size :size-20}
;; Remove the following line for v2.35
:show-new-feature-tag? (= network-name constants/base-network-name)
:action :selector
:action-props {:type (or type :checkbox)
:blur? blur?
:customization-color color
:checked? (contains? networks network-name)
:on-change on-change}}
[{:keys [network-name color on-change networks state label-props type blur?]}]
(cond-> {:title (string/capitalize (name network-name))
:image :icon-avatar
:image-props {:icon (resources/get-network network-name)
:size :size-20}
:action :selector
:action-props {:type (or type
(if (= :default state)
:filled-checkbox
:checkbox))
:blur? blur?
:customization-color color
:checked? (contains? networks network-name)
:on-change on-change}}
label-props
(assoc :label :text
@@ -480,11 +480,3 @@
(filter (fn [{:keys [tokens]}]
(some positive-balance-in-any-chain? tokens))
operable-account))))
(defn on-paste-address-or-ens
"Check if the clipboard has any valid address and extract the address without any chain info.
If it does not contain an valid address or it is ENS, return the clipboard text as it is"
[clipboard-text]
(if (utils.address/supported-address? clipboard-text)
(utils.address/extract-address-without-chains-info clipboard-text)
clipboard-text))
@@ -3,7 +3,6 @@
[clojure.string :as string]
[native-module.core :as native-module]
[promesa.core :as promesa]
[react-native.async-storage :as async-storage]
[status-im.common.json-rpc.events :as json-rpc]
[status-im.contexts.profile.recover.effects :as profile.recover.effects]
[status-im.contexts.wallet.rpc :as wallet-rpc]
@@ -131,14 +130,3 @@
(-> (wallet-rpc/sign-message message address (security/safe-unmask-data password))
(promesa/then on-success)
(promesa/catch on-error))))
(rf/reg-fx
:effects.wallet/retrieve-base-chain-indicator-shown
(fn []
(async-storage/get-item :base-chain-indicator-shown
#(rf/dispatch [:wallet/retrieve-new-chain-indicator (not %)]))))
(rf/reg-fx
:effects.wallet/set-base-chain-indicator-shown
(fn [flag]
(async-storage/set-item! :base-chain-indicator-shown flag)))
-11
View File
@@ -797,14 +797,3 @@
:wallet.swap/transaction-success
:wallet/transaction-success)
sent-transactions])]]})))
(rf/reg-event-fx
:wallet/retrieve-new-chain-indicator
(fn [{:keys [db]} [flag]]
{:db (assoc-in db [:wallet :ui :show-new-chain-indicator?] flag)}))
(rf/reg-event-fx
:wallet/hide-new-chain-indicator
(fn [{:keys [db]}]
{:db (assoc-in db [:wallet :ui :show-new-chain-indicator?] false)
:fx [[:effects.wallet/set-base-chain-indicator-shown true]]}))
+8 -15
View File
@@ -135,13 +135,7 @@
cards (conj account-cards-data (new-account-card-data))
[init-loaded? set-init-loaded] (rn/use-state false)
{:keys [formatted-balance]} (rf/sub [:wallet/aggregated-token-values-and-balance])
theme (quo.theme/use-theme)
show-new-chain-indicator? (rf/sub [:wallet/show-new-chain-indicator?])
on-press-network-selector (rn/use-callback
(fn []
(rf/dispatch [:wallet/hide-new-chain-indicator])
(rf/dispatch [:show-bottom-sheet
{:content network-filter/view}])))]
theme (quo.theme/use-theme)]
(rn/use-effect (fn []
(when (and @account-list-ref (pos? (count cards)))
(.scrollToOffset ^js @account-list-ref
@@ -163,14 +157,13 @@
:on-refresh #(rf/dispatch [:wallet/get-accounts])}]
:header [rn/view {:style (style/header-container theme)}
[quo/wallet-overview
{:state (if tokens-loading? :loading :default)
:time-frame :none
:metrics :none
:balance formatted-balance
:networks networks
:dropdown-on-press on-press-network-selector
:show-new-chain-indicator? (when (not-empty networks)
show-new-chain-indicator?)}]
{:state (if tokens-loading? :loading :default)
:time-frame :none
:metrics :none
:balance formatted-balance
:networks networks
:dropdown-on-press #(rf/dispatch [:show-bottom-sheet
{:content network-filter/view}])}]
(when (ff/enabled? ::ff/wallet.graph)
[quo/wallet-graph {:time-frame :empty}])
[render-cards cards account-list-ref]
@@ -18,7 +18,6 @@
:network-name :mainnet
:chain-id 1
:related-chain-id 5}]
:wallet/show-new-chain-indicator? false
:wallet/current-viewing-account-address "0x1"
:wallet/current-viewing-account {:path "m/44'/60'/0'/0/1"
:emoji "💎"
@@ -61,7 +61,7 @@
(fn [clipboard]
(when-not (empty? clipboard)
(-> clipboard
utils/on-paste-address-or-ens
utils-address/extract-address-without-chains-info
on-change)))))
:ens-regex constants/regx-ens
:scanned-value (or (when recipient-plain-address? send-address) scanned-address)
@@ -28,7 +28,3 @@
[theme]
{:margin-bottom 8
:color (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)})
(def summary-container
{:padding-horizontal 20
:padding-bottom 16})
@@ -135,7 +135,9 @@
:saved-address :saved-account
:account :status-account
summary-type)]
[rn/view {:style style/summary-container}
[rn/view
{:style {:padding-horizontal 20
:padding-bottom 16}}
[quo/text
{:size :paragraph-2
:weight :medium
@@ -143,32 +145,17 @@
:accessibility-label accessibility-label}
label]
[quo/summary-info
{:type summary-info-type
:networks-to-show (when bridge-tx?
(send-utils/network-values-for-ui network-values))
:account-props (cond-> account-props
(and account-to? (not bridge-tx?))
(assoc
:size 32
:name (:label recipient)
:full-name (:label recipient)
:emoji (:emoji recipient)
:customization-color (:customization-color recipient)))}]]))
(defn- network-summary
[{:keys [theme label accessibility-label]}]
(let [network (rf/sub [:wallet/send-selected-network])]
(when network
[rn/view {:style style/summary-container}
[quo/text
{:size :paragraph-2
:weight :medium
:style (style/section-label theme)
:accessibility-label accessibility-label}
label]
[quo/summary-info
{:type :network
:network-props network}]])))
{:type summary-info-type
:networks? true
:values (send-utils/network-values-for-ui network-values)
:account-props (cond-> account-props
(and account-to? (not bridge-tx?))
(assoc
:size 32
:name (:label recipient)
:full-name (:label recipient)
:emoji (:emoji recipient)
:customization-color (:customization-color recipient)))}]]))
(defn- data-item
[{:keys [title subtitle]}]
@@ -313,7 +300,6 @@
:accessibility-label :summary-from-label
:label (i18n/label :t/from-capitalized)
:account-props from-account-props
:bridge-tx? (= transaction-type :tx/bridge)
:theme theme}]
[user-summary
{:summary-type (if (= transaction-type :tx/bridge)
@@ -327,8 +313,4 @@
:recipient recipient
:bridge-tx? (= transaction-type :tx/bridge)
:account-to? true
:theme theme}]
(when-not (= transaction-type :tx/bridge)
[network-summary
{:label (i18n/label :t/on-capitalized)
:theme theme}])]]]))
:theme theme}]]]]))
@@ -24,7 +24,7 @@
{:size :paragraph-2
:weight :medium
:style style/on}
(i18n/label :t/on-capitalized)]
(i18n/label :t/on-uppercase)]
[quo/context-tag
{:type :network
:network-logo (:logo-url provider)
@@ -8,26 +8,41 @@
(defn view
[]
(let [selected-networks (rf/sub [:wallet/selected-networks])
selector-state (rf/sub [:wallet/network-filter-selector-state])
color (rf/sub [:profile/customization-color])
network-details (rf/sub [:wallet/network-details])]
network-details (rf/sub [:wallet/network-details])
viewing-account? (rf/sub [:wallet/viewing-account?])
balance-per-chain (if viewing-account?
(rf/sub [:wallet/current-viewing-account-fiat-balance-per-chain])
(rf/sub [:wallet/aggregated-fiat-balance-per-chain]))
mainnet (first network-details)
layer-2-networks (rest network-details)]
[:<>
[quo/drawer-top {:title (i18n/label :t/select-networks)}]
[quo/information-box
{:type :informative
:icon :i/info
:blur? false
:style {:margin-horizontal 20
:margin-bottom 4}}
(i18n/label :t/base-chain-available-info)]
[quo/category
{:list-type :settings
:data [(utils/make-network-item
{:state selector-state
:network-name (:network-name mainnet)
:color color
:networks selected-networks
:label-props (get balance-per-chain (:chain-id mainnet))
:on-change #(rf/dispatch
[:wallet/update-selected-networks
(:network-name
mainnet)])})]}]
[quo/category
{:list-type :settings
:label (i18n/label :t/layer-2)
:data (mapv (fn [network]
(utils/make-network-item
{:network-name (:network-name network)
{:state selector-state
:network-name (:network-name network)
:color color
:networks selected-networks
:label-props (get balance-per-chain (:chain-id network))
:on-change #(rf/dispatch
[:wallet/update-selected-networks
(:network-name
network)])}))
network-details)}]]))
layer-2-networks)}]]))
@@ -249,13 +249,15 @@
(rf/reg-event-fx :wallet/stop-get-swap-proposal
(fn [{:keys [db]}]
{:db (update-in db [:wallet :ui :swap] dissoc :last-request-uuid)
:json-rpc/call [{:method "wallet_stopSuggestedRoutesAsyncCalculation"
:params []
:on-error (fn [error]
(log/error "failed to stop fetching swap proposals"
{:event :wallet/stop-get-swap-proposal
:error error}))}]}))
(let [route-request-ongoing? (some? (get-in db [:wallet :ui :swap :last-request-uuid]))]
(when route-request-ongoing?
{:db (update-in db [:wallet :ui :swap] dissoc :last-request-uuid)
:json-rpc/call [{:method "wallet_stopSuggestedRoutesAsyncCalculation"
:params []
:on-error (fn [error]
(log/error "failed to stop fetching swap proposals"
{:event :wallet/stop-get-swap-proposal
:error error}))}]}))))
(rf/reg-event-fx
:wallet/clean-swap-proposal
@@ -75,13 +75,14 @@
:accessibility-label title-accessibility-label}
label]
[quo/summary-info
{:type :token
:token-props {:token token-symbol
:label (str amount " " token-symbol)
:address (when token-address
(address-utils/get-shortened-compressed-key token-address))
:size 32}
:networks-to-show (send-utils/network-values-for-ui network-values)}]]))
{:type :token
:networks? true
:values (send-utils/network-values-for-ui network-values)
:token-props {:token token-symbol
:label (str amount " " token-symbol)
:address (when token-address
(address-utils/get-shortened-compressed-key token-address))
:size 32}}]]))
(defn- pay-section
[]
+1 -3
View File
@@ -78,6 +78,4 @@
;;app starting flow continues in get-profiles-overview
:profile/get-profiles-overview #(rf/dispatch [:profile/get-profiles-overview-success %])
:effects.font/get-font-file-for-initials-avatar
#(rf/dispatch [:font/init-font-file-for-initials-avatar %])
;; show new chain indicator to highlight base chain. This will be be removed in v2.35.
:effects.wallet/retrieve-base-chain-indicator-shown nil}))
#(rf/dispatch [:font/init-font-file-for-initials-avatar %])}))
+3 -3
View File
@@ -164,9 +164,9 @@
theme)})
options
(when sheet?
options/sheet-options))}}]}})))
(state/navigation-state-push {:id component
:type :modal})))
options/sheet-options))}}]}})
(state/navigation-state-push {:id component
:type :modal})))))
(rf/reg-fx :open-modal-fx open-modal)
-9
View File
@@ -71,12 +71,3 @@
{:amount amount-fixed :token-symbol token-symbol})))
{}
network-values))))
(re-frame/reg-sub
:wallet/send-selected-network
:<- [:wallet/wallet-send]
(fn [{:keys [to-values-by-chain]}]
(-> to-values-by-chain
keys
first
network-utils/get-network-details)))
-5
View File
@@ -47,11 +47,6 @@
:<- [:wallet/ui]
:-> :last-updates-per-address)
(rf/reg-sub
:wallet/show-new-chain-indicator?
:<- [:wallet/ui]
:-> :show-new-chain-indicator?)
(rf/reg-sub
:wallet/latest-update
:<- [:wallet/last-updates-per-address]
+3 -3
View File
@@ -3,7 +3,7 @@
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
"owner": "status-im",
"repo": "status-go",
"version": "v10.7.0+hotfix.2",
"commit-sha1": "595dc68e9ff5e6e57364818098616a97b83eabd5",
"src-sha256": "04dsmz70h3i738bj3i3ba8bckpw61vxb56m8sc4qw8agc9pdaxc0"
"version": "v10.6.0",
"commit-sha1": "c5e4eb1a56ea7641efcc7cc677be7fd5d3f92225",
"src-sha256": "0n8x03c4dqxwcl27y8x6hmn6wbfpq3llkj15hhjxc4baaqwrhy8i"
}
@@ -36,12 +36,11 @@ class TestWalletCollectibles(MultipleSharedDeviceTestCase):
'').lower()
self.receiver_short_address = self.receiver['wallet_address'].replace(self.receiver['wallet_address'][6:-3],
'').lower()
self.network_name = 'Base'
@marks.testrail_id(741839)
def test_wallet_collectibles_balance(self):
self.wallet_view.collectibles_tab.click()
self.wallet_view.set_network_in_wallet(self.network_name + ', NEW')
self.wallet_view.set_network_in_wallet('Base')
collectibles = {
"BVL": {"quantity": 2,
"info": {"Account": "Account 1",
@@ -104,17 +103,15 @@ class TestWalletCollectibles(MultipleSharedDeviceTestCase):
self.wallet_view.get_collectible_element('BVL').click()
self.wallet_view.amount_input_increase_button.click()
self.wallet_view.confirm_button.click()
for text in [self.account_name, self.sender_short_address]:
expected_text = '2 BVL #47'
for text in [self.account_name, self.sender_short_address, expected_text]:
if not self.wallet_view.from_data_container.get_child_element_by_text(text).is_element_displayed():
self.errors.append(self.wallet_view,
"Text %s is not shown inside 'From' container on the Review Send page" % text)
if not self.wallet_view.to_data_container.get_child_element_by_text(
self.receiver_short_address).is_element_displayed():
self.errors.append(self.wallet_view,
"Text %s is not shown inside 'To' container on the Review Send page" % text)
if not self.wallet_view.on_data_container.get_child_element_by_text(self.network_name).is_element_displayed():
self.errors.append(self.wallet_view,
"Text %s is not shown inside 'On' container on the Review Send page" % text)
"Text %s is not shown in 'From' container on the Review Send page" % text)
for text in [self.receiver_short_address, expected_text]:
if not self.wallet_view.to_data_container.get_child_element_by_text(text).is_element_displayed():
self.errors.append(self.wallet_view,
"Text %s is not shown in 'To' container on the Review Send page" % text)
data_to_check = {
'Est. time': ' min',
'Max fees': r"[$]\d+.\d+",
@@ -151,17 +148,15 @@ class TestWalletCollectibles(MultipleSharedDeviceTestCase):
self.wallet_view.send_from_collectible_info_button.click()
self.wallet_view.address_text_input.send_keys(self.receiver['wallet_address'])
self.wallet_view.continue_button.click()
for text in [self.account_name, self.sender_short_address]:
expected_text = '1 Glitch Punks #3422'
for text in [self.account_name, self.sender_short_address, expected_text]:
if not self.wallet_view.from_data_container.get_child_element_by_text(text).is_element_displayed():
self.errors.append(self.wallet_view,
"Text %s is not shown in 'From' container on the Review Send page" % text)
if not self.wallet_view.to_data_container.get_child_element_by_text(
self.receiver_short_address).is_element_displayed():
self.errors.append(self.wallet_view,
"Text %s is not shown in 'To' container on the Review Send page" % text)
if not self.wallet_view.on_data_container.get_child_element_by_text(self.network_name).is_element_displayed():
self.errors.append(self.wallet_view,
"Text %s is not shown inside 'On' container on the Review Send page" % text)
for text in [self.receiver_short_address, expected_text]:
if not self.wallet_view.to_data_container.get_child_element_by_text(text).is_element_displayed():
self.errors.append(self.wallet_view,
"Text %s is not shown in 'To' container on the Review Send page" % text)
data_to_check = {
'Est. time': ' min',
'Max fees': r"[$]\d+.\d+",
@@ -52,7 +52,7 @@ class TestWalletOneDevice(MultipleSharedDeviceTestCase):
'Mainnet': self.mainnet_balance,
'Arbitrum': self.arb_balance,
'Optimism': self.optimism_balance,
'Base, NEW': self.base_balance
'Base': self.base_balance
}
for network in expected_balances:
@@ -99,32 +99,28 @@ class TestWalletOneDevice(MultipleSharedDeviceTestCase):
self.wallet_view.confirm_button.click()
self.wallet_view.just_fyi("Checking Review Send page for %s on %s" % (asset, network))
expected_amount = "%s %s" % (data['amount'], 'ETH' if asset == 'Ether' else 'SNT')
sender_short_address = self.sender['wallet_address'].replace(self.sender['wallet_address'][6:-3],
'').lower()
receiver_short_address = self.receiver['wallet_address'].replace(self.receiver['wallet_address'][6:-3],
'').lower()
for text in [self.account_name, sender_short_address]:
for text in [self.account_name, sender_short_address, expected_amount]:
if not self.wallet_view.from_data_container.get_child_element_by_text(text).is_element_displayed():
self.errors.append(
self.wallet_view,
"%s on %s: text %s is not shown in 'From' container on the Review Send page" % (
asset, network, text))
if not self.wallet_view.to_data_container.get_child_element_by_text(
receiver_short_address).is_element_displayed():
self.errors.append(
self.wallet_view,
"%s on %s: text %s is not shown in 'To' container on the Review Send page" % (
asset, network, text))
if not self.wallet_view.on_data_container.get_child_element_by_text(network).is_element_displayed():
self.errors.append(
self.wallet_view,
"%s on %s: network %s is not shown in 'On' container on the Review Send page" % (
asset, network, text))
for text in [receiver_short_address, expected_amount]:
if not self.wallet_view.to_data_container.get_child_element_by_text(text).is_element_displayed():
self.errors.append(
self.wallet_view,
"%s on %s: text %s is not shown in 'To' container on the Review Send page" % (
asset, network, text))
data_to_check = {
'Est. time': ' min',
'Max fees': r"[$]\d+.\d+",
'Recipient gets': "%s %s" % (data['amount'], 'ETH' if asset == 'Ether' else 'SNT')
'Recipient gets': expected_amount
}
for key, expected_value in data_to_check.items():
try:
@@ -309,6 +305,17 @@ class TestWalletOneDevice(MultipleSharedDeviceTestCase):
self.wallet_view,
"%s to %s: Text %s is not shown in the '%s' data container on the Review Bridge screen"
% (network_from, network_to, text, name))
amount_text = container.amount_text
if name == 'from' and amount_text != amount + ' ETH':
self.errors.append(
self.wallet_view,
"%s to %s: amount %s in the 'from' data container doesn't match expected %s ETH"
% (network_from, network_to, amount_text, amount))
if name == 'to' and not re.findall(r"0.000\d+ ETH", amount_text):
self.errors.append(
self.wallet_view,
"%s to %s: amount %s in the 'to' data container is not a number"
% (network_from, network_to, amount_text))
except TimeoutException:
self.errors.append(self.wallet_view, "%s to %s: data '%s' is not shown in Review Bridge screen" %
(network_from, network_to, name))
+4 -5
View File
@@ -81,7 +81,7 @@ class ActivityElement(BaseElement):
class ConfirmationViewInfoContainer(BaseElement):
def __init__(self, driver, label_name: str):
self.locator = "//*[@text='%s']/following-sibling::android.view.ViewGroup[1]" % label_name
self.locator = "//*[@content-desc='summary-%s-label']/following-sibling::android.view.ViewGroup[1]" % label_name
super().__init__(driver, xpath=self.locator)
@property
@@ -139,9 +139,8 @@ class WalletView(BaseView):
self.amount_input_increase_button = Button(self.driver, accessibility_id='amount-input-inc-button')
# Review Send and Review Bridge screens
self.from_data_container = ConfirmationViewInfoContainer(self.driver, label_name='From')
self.to_data_container = ConfirmationViewInfoContainer(self.driver, label_name='To')
self.on_data_container = ConfirmationViewInfoContainer(self.driver, label_name='On')
self.from_data_container = ConfirmationViewInfoContainer(self.driver, label_name='from')
self.to_data_container = ConfirmationViewInfoContainer(self.driver, label_name='to')
# Swap flow
self.approve_swap_button = Button(self.driver, accessibility_id='Approve')
@@ -182,7 +181,7 @@ class WalletView(BaseView):
def set_network_in_wallet(self, network_name: str):
self.network_drop_down.click()
Button(self.driver, accessibility_id="%s, label-component" % network_name).click()
Button(self.driver, accessibility_id="%s, label-component" % network_name.capitalize()).click()
self.network_drop_down.click()
def get_account_element(self, account_name: str = 'Account 1'):
+1 -1
View File
@@ -200,7 +200,6 @@
"bad-fees-description": "Your priority fee is below our suggested parameters.",
"balance": "Balance",
"base": "Base",
"base-chain-available-info": "Base chain is now on Status - view your assets, interact with dApps and swap tokens",
"be-safe-with-secure-cold-wallet": "Be safe with secure cold wallet",
"begin-set-up": "Begin setup",
"below-base-fee": "max fee below base fee",
@@ -1893,6 +1892,7 @@
"on-keycard": "On Keycard",
"on-status-tree": "On Status tree",
"on-the-web": "On the web",
"on-uppercase": "On",
"once-enabled-share-metadata": "Once enabled, links posted in the chat may share your metadata with the site",
"one-day": "One day",
"one-month": "One month",