From a8468fa369cf88ffb1ecc6fca2256b4f0b623fd0 Mon Sep 17 00:00:00 2001 From: Omar Basem Date: Tue, 14 May 2024 19:26:57 +0400 Subject: [PATCH 01/20] lint --- .../contexts/wallet/account/view.cljs | 3 +- .../wallet/common/activity_tab/view.cljs | 12 +++-- src/status_im/contexts/wallet/home/view.cljs | 54 +++++++++++++++++++ src/status_im/subs/wallet/activities.cljs | 16 ++++-- src/utils/datetime.cljs | 11 ++++ 5 files changed, 84 insertions(+), 12 deletions(-) diff --git a/src/status_im/contexts/wallet/account/view.cljs b/src/status_im/contexts/wallet/account/view.cljs index 0c1c232abe1..b6ce0bf77dc 100644 --- a/src/status_im/contexts/wallet/account/view.cljs +++ b/src/status_im/contexts/wallet/account/view.cljs @@ -63,8 +63,7 @@ :size 32 :default-active @selected-tab :data (tabs-data watch-only?) - :on-change (rn/use-callback (fn [tab] - (reset! selected-tab tab))) + :on-change (rn/use-callback (fn [tab] (reset! selected-tab tab))) :scrollable? true :scroll-on-press? true}] [tabs/view {:selected-tab @selected-tab}] diff --git a/src/status_im/contexts/wallet/common/activity_tab/view.cljs b/src/status_im/contexts/wallet/common/activity_tab/view.cljs index 2a93b18e690..bc43a3808a7 100644 --- a/src/status_im/contexts/wallet/common/activity_tab/view.cljs +++ b/src/status_im/contexts/wallet/common/activity_tab/view.cljs @@ -66,8 +66,10 @@ {:title (i18n/label :t/no-activity) :description (i18n/label :t/empty-tab-description) :image (resources/get-themed-image :no-activity theme)}] - [rn/flat-list - {:data activity-list - :style {:flex 1} - :content-container-style {:padding-bottom jump-to.constants/floating-shell-button-height} - :render-fn activity-item}]))) + [rn/section-list + {:sections activity-list + :sticky-section-headers-enabled false + :style {:flex 1} + :content-container-style {:padding-bottom jump-to.constants/floating-shell-button-height} + :render-fn activity-item + :render-section-header-fn (fn [{:keys [title]}] [quo/divider-date title])}]))) diff --git a/src/status_im/contexts/wallet/home/view.cljs b/src/status_im/contexts/wallet/home/view.cljs index 73cdd8a1525..d3246f70b8b 100644 --- a/src/status_im/contexts/wallet/home/view.cljs +++ b/src/status_im/contexts/wallet/home/view.cljs @@ -85,7 +85,9 @@ [tokens-loading?]) [rn/view {:style (style/home-container)} [common.top-nav/view] +<<<<<<< HEAD [refreshable-flat-list/view +<<<<<<< HEAD {:refresh-control [rn/refresh-control {:refreshing (and tokens-loading? init-loaded?) :colors [colors/neutral-40] @@ -109,3 +111,55 @@ :data [] :render-fn #() :footer [tabs/view {:selected-tab selected-tab}]}]])) +======= + {:refresh-control [rn/refresh-control + {:refreshing (and tokens-loading? init-loaded?) + :colors [colors/neutral-40] + :tint-color colors/neutral-40 + :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 #(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] + [render-tabs tabs-data set-selected-tab selected-tab]] + :sticky-header-indices [0] + :data [] + :render-fn #() + :footer [tabs/view {:selected-tab selected-tab}]}]])) +======= + [rn/view + [quo/wallet-overview + {: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}]) + [rn/flat-list + {:ref #(reset! account-list-ref %) + :style style/accounts-list + :content-container-style style/accounts-list-container + :data cards + :horizontal true + :separator [rn/view {:style style/separator}] + :render-fn (fn [item] [quo/account-card item]) + :shows-horizontal-scroll-indicator false}] + [quo/tabs + {:style style/tabs + :size 32 + :default-active selected-tab + :data tabs-data + :on-change (fn [tab] + (set-selected-tab tab))}] + [tabs/view {:selected-tab selected-tab}]])) +>>>>>>> f39e5bfea (lint) +>>>>>>> 347001b89 (lint) diff --git a/src/status_im/subs/wallet/activities.cljs b/src/status_im/subs/wallet/activities.cljs index 38f10ff45bc..435880ab224 100644 --- a/src/status_im/subs/wallet/activities.cljs +++ b/src/status_im/subs/wallet/activities.cljs @@ -1,5 +1,7 @@ (ns status-im.subs.wallet.activities - (:require [re-frame.core :as rf])) + (:require + [re-frame.core :as rf] + [utils.datetime :as datetime])) (rf/reg-sub :wallet/all-activities @@ -11,7 +13,11 @@ :<- [:wallet/all-activities] :<- [:wallet/current-viewing-account-address] (fn [[activities current-viewing-account-address]] - (filter (fn [{:keys [sender recipient]}] - (or (= sender current-viewing-account-address) - (= recipient current-viewing-account-address))) - activities))) + (let [relevant-activities (filter (fn [{:keys [sender recipient]}] + (or (= sender current-viewing-account-address) + (= recipient current-viewing-account-address))) + activities) + grouped-by-day (group-by (fn [{:keys [timestamp]}] + (datetime/timestamp->relative-short-date (* timestamp 1000))) + relevant-activities)] + (map (fn [[date acts]] {:title date :data acts}) grouped-by-day)))) diff --git a/src/utils/datetime.cljs b/src/utils/datetime.cljs index 7d0a8bf9c9c..6d9db441ddd 100644 --- a/src/utils/datetime.cljs +++ b/src/utils/datetime.cljs @@ -209,6 +209,17 @@ (previous-years? datetime) (.format ^js (date-fmt) datetime)))) +(defn full-date->short-date + [s] + (let [words (string/split s #"\s+")] + (string/join " " (take (- (count words) 2) words)))) + +(defn timestamp->relative-short-date + [ms] + (->> ms + timestamp->relative + full-date->short-date)) + (defn timestamp->mini-date [ms] (.format ^js (short-date-fmt) From 7c2f0ad65718ffe544335c5e9d885fc5945817c5 Mon Sep 17 00:00:00 2001 From: Omar Basem Date: Mon, 6 May 2024 12:52:19 +0400 Subject: [PATCH 02/20] lint --- src/status_im/contexts/wallet/account/view.cljs | 7 +++++++ src/status_im/subs/wallet/activities.cljs | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/status_im/contexts/wallet/account/view.cljs b/src/status_im/contexts/wallet/account/view.cljs index b6ce0bf77dc..7aa3527fca7 100644 --- a/src/status_im/contexts/wallet/account/view.cljs +++ b/src/status_im/contexts/wallet/account/view.cljs @@ -63,7 +63,14 @@ :size 32 :default-active @selected-tab :data (tabs-data watch-only?) +<<<<<<< HEAD :on-change (rn/use-callback (fn [tab] (reset! selected-tab tab))) +======= + :on-change (rn/use-callback (fn [tab] + (when (= :activity tab) + (rf/dispatch [:wallet/fetch-activities])) + (reset! selected-tab tab))) +>>>>>>> 17d2348c4 (lint) :scrollable? true :scroll-on-press? true}] [tabs/view {:selected-tab @selected-tab}] diff --git a/src/status_im/subs/wallet/activities.cljs b/src/status_im/subs/wallet/activities.cljs index 435880ab224..bf5707e4c73 100644 --- a/src/status_im/subs/wallet/activities.cljs +++ b/src/status_im/subs/wallet/activities.cljs @@ -13,11 +13,11 @@ :<- [:wallet/all-activities] :<- [:wallet/current-viewing-account-address] (fn [[activities current-viewing-account-address]] - (let [relevant-activities (filter (fn [{:keys [sender recipient]}] + (let [account-activities (filter (fn [{:keys [sender recipient]}] (or (= sender current-viewing-account-address) (= recipient current-viewing-account-address))) activities) grouped-by-day (group-by (fn [{:keys [timestamp]}] (datetime/timestamp->relative-short-date (* timestamp 1000))) - relevant-activities)] + account-activities)] (map (fn [[date acts]] {:title date :data acts}) grouped-by-day)))) From b12611b754154e4a753f0b592e854aa35db17c4e Mon Sep 17 00:00:00 2001 From: Omar Basem Date: Mon, 6 May 2024 13:02:40 +0400 Subject: [PATCH 03/20] lint --- src/status_im/subs/wallet/activities.cljs | 12 +++---- .../subs/wallet/activities_test.cljs | 33 +++++++++++++++++++ 2 files changed, 39 insertions(+), 6 deletions(-) create mode 100644 src/status_im/subs/wallet/activities_test.cljs diff --git a/src/status_im/subs/wallet/activities.cljs b/src/status_im/subs/wallet/activities.cljs index bf5707e4c73..4261d17977c 100644 --- a/src/status_im/subs/wallet/activities.cljs +++ b/src/status_im/subs/wallet/activities.cljs @@ -14,10 +14,10 @@ :<- [:wallet/current-viewing-account-address] (fn [[activities current-viewing-account-address]] (let [account-activities (filter (fn [{:keys [sender recipient]}] - (or (= sender current-viewing-account-address) - (= recipient current-viewing-account-address))) - activities) - grouped-by-day (group-by (fn [{:keys [timestamp]}] - (datetime/timestamp->relative-short-date (* timestamp 1000))) - account-activities)] + (or (= sender current-viewing-account-address) + (= recipient current-viewing-account-address))) + activities) + grouped-by-day (group-by (fn [{:keys [timestamp]}] + (datetime/timestamp->relative-short-date (* timestamp 1000))) + account-activities)] (map (fn [[date acts]] {:title date :data acts}) grouped-by-day)))) diff --git a/src/status_im/subs/wallet/activities_test.cljs b/src/status_im/subs/wallet/activities_test.cljs new file mode 100644 index 00000000000..c9ec11d8a62 --- /dev/null +++ b/src/status_im/subs/wallet/activities_test.cljs @@ -0,0 +1,33 @@ +(ns status-im.subs.wallet.activities-test + (:require + [cljs.test :refer [is testing]] + [re-frame.db :as rf-db] + status-im.subs.root + status-im.subs.wallet.collectibles + [test-helpers.unit :as h] + [utils.re-frame :as rf])) + +(h/deftest-sub :wallet/all-activities + [sub-name] + (testing "It should correctly return the activities list from wallet data" + (swap! rf-db/app-db assoc-in + [:wallet :activities] + [{:id 1 :name "Transaction1"} + {:id 2 :name "Transaction2"}]) + (let [result (rf/sub [sub-name])] + (is (= [{:id 1 :name "Transaction1"} {:id 2 :name "Transaction2"}] @result))))) + +(h/deftest-sub :wallet/activities-for-current-viewing-account + [sub-name] + (testing "Activities should be filtered and grouped by account and dates" + (swap! rf-db/app-db assoc + {:wallet/all-activities [{:sender "acc1" :recipient "acc2" :timestamp 1588291200} + {:sender "acc2" :recipient "acc1" :timestamp 1588377600}] + :wallet/current-viewing-account-address "acc1"}) + (let [result (rf/sub [sub-name])] + (is (= [{:title "May 1" :data [{:sender "acc1" :recipient "acc2" :timestamp 1588291200}]} + {:title "May 2" :data [{:sender "acc2" :recipient "acc1" :timestamp 1588377600}]}] + @result))))) + + + From 7addc564b728bb4589c50e4c7a9d70685c1f0323 Mon Sep 17 00:00:00 2001 From: Omar Basem Date: Mon, 6 May 2024 13:04:56 +0400 Subject: [PATCH 04/20] lint --- src/status_im/subs/wallet/activities_test.cljs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/status_im/subs/wallet/activities_test.cljs b/src/status_im/subs/wallet/activities_test.cljs index c9ec11d8a62..9100b33652a 100644 --- a/src/status_im/subs/wallet/activities_test.cljs +++ b/src/status_im/subs/wallet/activities_test.cljs @@ -9,7 +9,8 @@ (h/deftest-sub :wallet/all-activities [sub-name] - (testing "It should correctly return the activities list from wallet data" + (testing + "Return the activities list from wallet data" (swap! rf-db/app-db assoc-in [:wallet :activities] [{:id 1 :name "Transaction1"} @@ -19,10 +20,12 @@ (h/deftest-sub :wallet/activities-for-current-viewing-account [sub-name] - (testing "Activities should be filtered and grouped by account and dates" + (testing + "Return activities filtered and grouped by account and dates" (swap! rf-db/app-db assoc {:wallet/all-activities [{:sender "acc1" :recipient "acc2" :timestamp 1588291200} - {:sender "acc2" :recipient "acc1" :timestamp 1588377600}] + {:sender "acc2" :recipient "acc1" :timestamp 1588377600} + {:sender "acc3" :recipient "acc4" :timestamp 1588464000}] :wallet/current-viewing-account-address "acc1"}) (let [result (rf/sub [sub-name])] (is (= [{:title "May 1" :data [{:sender "acc1" :recipient "acc2" :timestamp 1588291200}]} From 44a5d81de433fb16289be16f4eeccf52d27ab3f2 Mon Sep 17 00:00:00 2001 From: Omar Basem Date: Wed, 8 May 2024 10:44:10 +0400 Subject: [PATCH 05/20] review --- src/status_im/subs/wallet/activities.cljs | 19 ++++++------ .../subs/wallet/activities_test.cljs | 19 ++++-------- src/utils/datetime.cljs | 7 +++-- src/utils/datetime_test.cljs | 30 +++++++++++++++++++ 4 files changed, 50 insertions(+), 25 deletions(-) diff --git a/src/status_im/subs/wallet/activities.cljs b/src/status_im/subs/wallet/activities.cljs index 4261d17977c..79dfa7a2a77 100644 --- a/src/status_im/subs/wallet/activities.cljs +++ b/src/status_im/subs/wallet/activities.cljs @@ -8,16 +8,15 @@ :<- [:wallet] :-> :activities) -(rf/reg-sub - :wallet/activities-for-current-viewing-account +(rf/reg-sub :wallet/activities-for-current-viewing-account :<- [:wallet/all-activities] :<- [:wallet/current-viewing-account-address] (fn [[activities current-viewing-account-address]] - (let [account-activities (filter (fn [{:keys [sender recipient]}] - (or (= sender current-viewing-account-address) - (= recipient current-viewing-account-address))) - activities) - grouped-by-day (group-by (fn [{:keys [timestamp]}] - (datetime/timestamp->relative-short-date (* timestamp 1000))) - account-activities)] - (map (fn [[date acts]] {:title date :data acts}) grouped-by-day)))) + (->> activities + (filter (fn [{:keys [sender recipient]}] + (or (= sender current-viewing-account-address) + (= recipient current-viewing-account-address)))) + (group-by (fn [{:keys [timestamp]}] + (datetime/timestamp->relative-short-date (* timestamp 1000)))) + (map (fn [[date activities]] + {:title date :data activities}))))) diff --git a/src/status_im/subs/wallet/activities_test.cljs b/src/status_im/subs/wallet/activities_test.cljs index 9100b33652a..753f9a60130 100644 --- a/src/status_im/subs/wallet/activities_test.cljs +++ b/src/status_im/subs/wallet/activities_test.cljs @@ -9,28 +9,21 @@ (h/deftest-sub :wallet/all-activities [sub-name] - (testing - "Return the activities list from wallet data" + (testing "Return the activities list from wallet data" (swap! rf-db/app-db assoc-in [:wallet :activities] [{:id 1 :name "Transaction1"} {:id 2 :name "Transaction2"}]) - (let [result (rf/sub [sub-name])] - (is (= [{:id 1 :name "Transaction1"} {:id 2 :name "Transaction2"}] @result))))) + (is (= [{:id 1 :name "Transaction1"} {:id 2 :name "Transaction2"}] (rf/sub [sub-name]))))) (h/deftest-sub :wallet/activities-for-current-viewing-account [sub-name] - (testing - "Return activities filtered and grouped by account and dates" + (testing "Return activities filtered and grouped by account and dates" (swap! rf-db/app-db assoc {:wallet/all-activities [{:sender "acc1" :recipient "acc2" :timestamp 1588291200} {:sender "acc2" :recipient "acc1" :timestamp 1588377600} {:sender "acc3" :recipient "acc4" :timestamp 1588464000}] :wallet/current-viewing-account-address "acc1"}) - (let [result (rf/sub [sub-name])] - (is (= [{:title "May 1" :data [{:sender "acc1" :recipient "acc2" :timestamp 1588291200}]} - {:title "May 2" :data [{:sender "acc2" :recipient "acc1" :timestamp 1588377600}]}] - @result))))) - - - + (is (= [{:title "May 1" :data [{:sender "acc1" :recipient "acc2" :timestamp 1588291200}]} + {:title "May 2" :data [{:sender "acc2" :recipient "acc1" :timestamp 1588377600}]}] + (rf/sub [sub-name]))))) diff --git a/src/utils/datetime.cljs b/src/utils/datetime.cljs index 6d9db441ddd..d6665789475 100644 --- a/src/utils/datetime.cljs +++ b/src/utils/datetime.cljs @@ -211,8 +211,11 @@ (defn full-date->short-date [s] - (let [words (string/split s #"\s+")] - (string/join " " (take (- (count words) 2) words)))) + (let [words (string/split s #"\s+") + last-word (last words)] + (if (or (= "AM" last-word) (= "PM" last-word)) + (string/join " " (take (- (count words) 2) words)) + s))) (defn timestamp->relative-short-date [ms] diff --git a/src/utils/datetime_test.cljs b/src/utils/datetime_test.cljs index bdcd7e2811d..3aafcc90160 100644 --- a/src/utils/datetime_test.cljs +++ b/src/utils/datetime_test.cljs @@ -174,6 +174,36 @@ (is (= "Today 12:00 PM" (datetime/timestamp->relative 163684800000))) (is (= "Today 12:00 AM" (datetime/timestamp->relative 163641600000)))))) +(deftest timestamp->relative-short-date-test + (with-redefs [t/*ms-fn* (constantly 163696545000) + datetime/time-zone-offset (t/period :hours 0) + datetime/is-24-hour (constantly false)] + (testing "short date format for previous years" + (is (= "Dec 31, 1974" (datetime/timestamp->relative-short-date 157766399000))) + (is (= "Jan 1, 1973" (datetime/timestamp->relative-short-date 94694400000)))) + + (testing "short date format for dates 7 days ago or older, but in the current year" + (is (= "03 Mar" (datetime/timestamp->relative-short-date 163091745000))) + (is (= "02 Mar" (datetime/timestamp->relative-short-date 163004400000))) + (is (= "01 Jan" (datetime/timestamp->relative-short-date 157820400000)))) + + (testing "short date format for dates within the last 6 days" + (is (= "Sat" (datetime/timestamp->relative-short-date 163523745000))) + (is (= "Fri" (datetime/timestamp->relative-short-date 163437345000))) + (is (= "Thu" (datetime/timestamp->relative-short-date 163350945000))) + (is (= "Wed" (datetime/timestamp->relative-short-date 163264545000))) + (is (= "Tue" (datetime/timestamp->relative-short-date 163178145000)))) + + (testing "short date format for yesterday" + (is (= "Yesterday" (datetime/timestamp->relative-short-date 163610145000))) + (is (= "Yesterday" (datetime/timestamp->relative-short-date 163641599000)))) + + (testing "short date format for today, at various timestamps" + (is (= "Today" (datetime/timestamp->relative-short-date 163696545000))) + (is (= "Today" (datetime/timestamp->relative-short-date 163684800000))) + (is (= "Today" (datetime/timestamp->relative-short-date 163641600000)))))) + + #_((deftest day-relative-before-yesterday-force-24H-test (with-redefs [t/*ms-fn* (constantly epoch-plus-3d) datetime/is-24-hour (constantly true) From 53fcb196c8fede996758d75aeed33c8c527e1e56 Mon Sep 17 00:00:00 2001 From: Omar Basem Date: Wed, 8 May 2024 10:55:15 +0400 Subject: [PATCH 06/20] review --- src/status_im/subs/wallet/activities_test.cljs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/status_im/subs/wallet/activities_test.cljs b/src/status_im/subs/wallet/activities_test.cljs index 753f9a60130..8cce90ab1df 100644 --- a/src/status_im/subs/wallet/activities_test.cljs +++ b/src/status_im/subs/wallet/activities_test.cljs @@ -19,11 +19,13 @@ (h/deftest-sub :wallet/activities-for-current-viewing-account [sub-name] (testing "Return activities filtered and grouped by account and dates" - (swap! rf-db/app-db assoc - {:wallet/all-activities [{:sender "acc1" :recipient "acc2" :timestamp 1588291200} - {:sender "acc2" :recipient "acc1" :timestamp 1588377600} - {:sender "acc3" :recipient "acc4" :timestamp 1588464000}] - :wallet/current-viewing-account-address "acc1"}) + (swap! + (-> rf-db/app-db + (assoc-in [:wallet :activities] + [{:sender "acc1" :recipient "acc2" :timestamp 1588291200} + {:sender "acc2" :recipient "acc1" :timestamp 1588377600} + {:sender "acc3" :recipient "acc4" :timestamp 1588464000}]) + (assoc-in [:wallet :current-viewing-account-address] "acc1"))) (is (= [{:title "May 1" :data [{:sender "acc1" :recipient "acc2" :timestamp 1588291200}]} {:title "May 2" :data [{:sender "acc2" :recipient "acc1" :timestamp 1588377600}]}] (rf/sub [sub-name]))))) From 94c87312eb26803448661873ec918557ec45ad6e Mon Sep 17 00:00:00 2001 From: Omar Basem Date: Wed, 8 May 2024 11:08:19 +0400 Subject: [PATCH 07/20] review --- src/status_im/subs/wallet/activities_test.cljs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/status_im/subs/wallet/activities_test.cljs b/src/status_im/subs/wallet/activities_test.cljs index 8cce90ab1df..fdbd097049b 100644 --- a/src/status_im/subs/wallet/activities_test.cljs +++ b/src/status_im/subs/wallet/activities_test.cljs @@ -19,13 +19,14 @@ (h/deftest-sub :wallet/activities-for-current-viewing-account [sub-name] (testing "Return activities filtered and grouped by account and dates" - (swap! - (-> rf-db/app-db - (assoc-in [:wallet :activities] - [{:sender "acc1" :recipient "acc2" :timestamp 1588291200} - {:sender "acc2" :recipient "acc1" :timestamp 1588377600} - {:sender "acc3" :recipient "acc4" :timestamp 1588464000}]) - (assoc-in [:wallet :current-viewing-account-address] "acc1"))) + (swap! rf-db/app-db + (fn [db] + (-> db + (assoc-in [:wallet :activities] + [{:sender "acc1" :recipient "acc2" :timestamp 1588291200} + {:sender "acc2" :recipient "acc1" :timestamp 1588377600} + {:sender "acc3" :recipient "acc4" :timestamp 1588464000}]) + (assoc-in [:wallet :current-viewing-account-address] "acc1")))) (is (= [{:title "May 1" :data [{:sender "acc1" :recipient "acc2" :timestamp 1588291200}]} {:title "May 2" :data [{:sender "acc2" :recipient "acc1" :timestamp 1588377600}]}] (rf/sub [sub-name]))))) From f02af381ffe724f8e812ab33240a0e5bd58a5ff7 Mon Sep 17 00:00:00 2001 From: Omar Basem Date: Wed, 8 May 2024 11:36:28 +0400 Subject: [PATCH 08/20] lint --- src/status_im/subs/wallet/activities_test.cljs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/status_im/subs/wallet/activities_test.cljs b/src/status_im/subs/wallet/activities_test.cljs index fdbd097049b..9c48c998c1a 100644 --- a/src/status_im/subs/wallet/activities_test.cljs +++ b/src/status_im/subs/wallet/activities_test.cljs @@ -27,6 +27,6 @@ {:sender "acc2" :recipient "acc1" :timestamp 1588377600} {:sender "acc3" :recipient "acc4" :timestamp 1588464000}]) (assoc-in [:wallet :current-viewing-account-address] "acc1")))) - (is (= [{:title "May 1" :data [{:sender "acc1" :recipient "acc2" :timestamp 1588291200}]} - {:title "May 2" :data [{:sender "acc2" :recipient "acc1" :timestamp 1588377600}]}] + (is (= [{:title "May 1, 2020" :data [{:sender "acc1" :recipient "acc2" :timestamp 1588291200}]} + {:title "May 2, 2020" :data [{:sender "acc2" :recipient "acc1" :timestamp 1588377600}]}] (rf/sub [sub-name]))))) From 23997d7e1622d08e55917f9c47ccff860c172eb1 Mon Sep 17 00:00:00 2001 From: Omar Basem Date: Thu, 9 May 2024 12:26:56 +0400 Subject: [PATCH 09/20] lint --- src/status_im/feature_flags.cljs | 15 +++++++++++++++ src/utils/datetime_test.cljs | 1 - 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/status_im/feature_flags.cljs b/src/status_im/feature_flags.cljs index ff017881385..fa9b7c3593d 100644 --- a/src/status_im/feature_flags.cljs +++ b/src/status_im/feature_flags.cljs @@ -28,7 +28,22 @@ ::wallet.wallet-connect (enabled-in-env? :FLAG_WALLET_CONNECT_ENABLED)}) (defonce ^:private feature-flags-config +<<<<<<< HEAD (reagent/atom initial-flags)) +======= + (reagent/atom + {::community.edit-account-selection (enabled-in-env? :FLAG_EDIT_ACCOUNT_SELECTION_ENABLED) + ::wallet.assets-modal-hide (enabled-in-env? :FLAG_ASSETS_MODAL_HIDE) + ::wallet.assets-modal-manage-tokens (enabled-in-env? :FLAG_ASSETS_MODAL_MANAGE_TOKENS) + ::wallet.bridge-token (enabled-in-env? :FLAG_BRIDGE_TOKEN_ENABLED) + ::wallet.contacts (enabled-in-env? :FLAG_CONTACTS_ENABLED) + ::wallet.edit-derivation-path (enabled-in-env? :FLAG_EDIT_DERIVATION_PATH) + ::wallet.graph (enabled-in-env? :FLAG_GRAPH_ENABLED) + ::wallet.import-private-key (enabled-in-env? :FLAG_IMPORT_PRIVATE_KEY_ENABLED) + ::wallet.long-press-watch-only-asset (enabled-in-env? :FLAG_LONG_PRESS_WATCH_ONLY_ASSET_ENABLED) + ::wallet.swap (enabled-in-env? :FLAG_SWAP_ENABLED) + ::wallet.wallet-connect (enabled-in-env? :FLAG_WALLET_CONNECT_ENABLED)})) +>>>>>>> d84afea14 (lint) (defn feature-flags [] @feature-flags-config) diff --git a/src/utils/datetime_test.cljs b/src/utils/datetime_test.cljs index 3aafcc90160..07f0b99bd5a 100644 --- a/src/utils/datetime_test.cljs +++ b/src/utils/datetime_test.cljs @@ -203,7 +203,6 @@ (is (= "Today" (datetime/timestamp->relative-short-date 163684800000))) (is (= "Today" (datetime/timestamp->relative-short-date 163641600000)))))) - #_((deftest day-relative-before-yesterday-force-24H-test (with-redefs [t/*ms-fn* (constantly epoch-plus-3d) datetime/is-24-hour (constantly true) From 36da5ca7f41887ff05d27acef0d7bd823c160274 Mon Sep 17 00:00:00 2001 From: Omar Basem Date: Fri, 10 May 2024 10:17:06 +0400 Subject: [PATCH 10/20] lint --- Makefile | 2 +- src/status_im/subs/wallet/activities.cljs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b2ad755f612..a610cdb331a 100644 --- a/Makefile +++ b/Makefile @@ -281,7 +281,7 @@ run-android: export ORG_GRADLE_PROJECT_hermesEnabled := false run-android: ##@run Build Android APK and start it on the device @scripts/run-android.sh -SIMULATOR=iPhone 13 +SIMULATOR=iPhone 15 # TODO: fix IOS_STATUS_GO_TARGETS to be either amd64 or arm64 when RN is upgraded run-ios: export TARGET := ios run-ios: export IOS_STATUS_GO_TARGETS := ios/arm64;iossimulator/amd64 diff --git a/src/status_im/subs/wallet/activities.cljs b/src/status_im/subs/wallet/activities.cljs index 79dfa7a2a77..a8b9c53019b 100644 --- a/src/status_im/subs/wallet/activities.cljs +++ b/src/status_im/subs/wallet/activities.cljs @@ -19,4 +19,5 @@ (group-by (fn [{:keys [timestamp]}] (datetime/timestamp->relative-short-date (* timestamp 1000)))) (map (fn [[date activities]] - {:title date :data activities}))))) + {:title date :data activities :timestamp (:timestamp (first activities))})) + (sort-by (fn [{:keys [timestamp]}] (- timestamp)))))) From 5df80471c88a06e32a773280cbbb7eec5ef2b90f Mon Sep 17 00:00:00 2001 From: Omar Basem Date: Fri, 10 May 2024 10:20:46 +0400 Subject: [PATCH 11/20] lint --- src/status_im/contexts/wallet/home/view.cljs | 4 +++- src/status_im/feature_flags.cljs | 15 --------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/src/status_im/contexts/wallet/home/view.cljs b/src/status_im/contexts/wallet/home/view.cljs index d3246f70b8b..5aa2e52d45c 100644 --- a/src/status_im/contexts/wallet/home/view.cljs +++ b/src/status_im/contexts/wallet/home/view.cljs @@ -85,7 +85,6 @@ [tokens-loading?]) [rn/view {:style (style/home-container)} [common.top-nav/view] -<<<<<<< HEAD [refreshable-flat-list/view <<<<<<< HEAD {:refresh-control [rn/refresh-control @@ -134,6 +133,7 @@ :data [] :render-fn #() :footer [tabs/view {:selected-tab selected-tab}]}]])) +<<<<<<< HEAD ======= [rn/view [quo/wallet-overview @@ -163,3 +163,5 @@ [tabs/view {:selected-tab selected-tab}]])) >>>>>>> f39e5bfea (lint) >>>>>>> 347001b89 (lint) +======= +>>>>>>> 5f9b023ce (lint) diff --git a/src/status_im/feature_flags.cljs b/src/status_im/feature_flags.cljs index fa9b7c3593d..ff017881385 100644 --- a/src/status_im/feature_flags.cljs +++ b/src/status_im/feature_flags.cljs @@ -28,22 +28,7 @@ ::wallet.wallet-connect (enabled-in-env? :FLAG_WALLET_CONNECT_ENABLED)}) (defonce ^:private feature-flags-config -<<<<<<< HEAD (reagent/atom initial-flags)) -======= - (reagent/atom - {::community.edit-account-selection (enabled-in-env? :FLAG_EDIT_ACCOUNT_SELECTION_ENABLED) - ::wallet.assets-modal-hide (enabled-in-env? :FLAG_ASSETS_MODAL_HIDE) - ::wallet.assets-modal-manage-tokens (enabled-in-env? :FLAG_ASSETS_MODAL_MANAGE_TOKENS) - ::wallet.bridge-token (enabled-in-env? :FLAG_BRIDGE_TOKEN_ENABLED) - ::wallet.contacts (enabled-in-env? :FLAG_CONTACTS_ENABLED) - ::wallet.edit-derivation-path (enabled-in-env? :FLAG_EDIT_DERIVATION_PATH) - ::wallet.graph (enabled-in-env? :FLAG_GRAPH_ENABLED) - ::wallet.import-private-key (enabled-in-env? :FLAG_IMPORT_PRIVATE_KEY_ENABLED) - ::wallet.long-press-watch-only-asset (enabled-in-env? :FLAG_LONG_PRESS_WATCH_ONLY_ASSET_ENABLED) - ::wallet.swap (enabled-in-env? :FLAG_SWAP_ENABLED) - ::wallet.wallet-connect (enabled-in-env? :FLAG_WALLET_CONNECT_ENABLED)})) ->>>>>>> d84afea14 (lint) (defn feature-flags [] @feature-flags-config) From 28d9627cf80793b6d39cf9ff632ecb37aa4d47a7 Mon Sep 17 00:00:00 2001 From: Omar Basem Date: Tue, 14 May 2024 11:20:27 +0400 Subject: [PATCH 12/20] fix test --- src/status_im/subs/wallet/activities_test.cljs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/status_im/subs/wallet/activities_test.cljs b/src/status_im/subs/wallet/activities_test.cljs index 9c48c998c1a..b70a65ee495 100644 --- a/src/status_im/subs/wallet/activities_test.cljs +++ b/src/status_im/subs/wallet/activities_test.cljs @@ -27,6 +27,6 @@ {:sender "acc2" :recipient "acc1" :timestamp 1588377600} {:sender "acc3" :recipient "acc4" :timestamp 1588464000}]) (assoc-in [:wallet :current-viewing-account-address] "acc1")))) - (is (= [{:title "May 1, 2020" :data [{:sender "acc1" :recipient "acc2" :timestamp 1588291200}]} - {:title "May 2, 2020" :data [{:sender "acc2" :recipient "acc1" :timestamp 1588377600}]}] + (is (= [{:title "May 2, 2020" :data [{:sender "acc2" :recipient "acc1" :timestamp 1588377600}] :timestamp 1588377600} + {:title "May 1, 2020" :data [{:sender "acc1" :recipient "acc2" :timestamp 1588291200}] :timestamp 1588291200}] (rf/sub [sub-name]))))) From a00cd0eecdbd6e46960da48801a0e6a8891c6fa1 Mon Sep 17 00:00:00 2001 From: Omar Basem Date: Tue, 14 May 2024 19:27:31 +0400 Subject: [PATCH 13/20] lint --- src/status_im/contexts/wallet/account/view.cljs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/status_im/contexts/wallet/account/view.cljs b/src/status_im/contexts/wallet/account/view.cljs index 7aa3527fca7..b6ce0bf77dc 100644 --- a/src/status_im/contexts/wallet/account/view.cljs +++ b/src/status_im/contexts/wallet/account/view.cljs @@ -63,14 +63,7 @@ :size 32 :default-active @selected-tab :data (tabs-data watch-only?) -<<<<<<< HEAD :on-change (rn/use-callback (fn [tab] (reset! selected-tab tab))) -======= - :on-change (rn/use-callback (fn [tab] - (when (= :activity tab) - (rf/dispatch [:wallet/fetch-activities])) - (reset! selected-tab tab))) ->>>>>>> 17d2348c4 (lint) :scrollable? true :scroll-on-press? true}] [tabs/view {:selected-tab @selected-tab}] From 57b086ae4e501a039da7e7382545690bccbeaf7e Mon Sep 17 00:00:00 2001 From: Omar Basem Date: Tue, 14 May 2024 20:02:38 +0400 Subject: [PATCH 14/20] lint --- src/status_im/subs/wallet/activities.cljs | 9 ++++++--- src/status_im/subs/wallet/activities_test.cljs | 8 ++++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/status_im/subs/wallet/activities.cljs b/src/status_im/subs/wallet/activities.cljs index a8b9c53019b..7973ee00496 100644 --- a/src/status_im/subs/wallet/activities.cljs +++ b/src/status_im/subs/wallet/activities.cljs @@ -1,6 +1,7 @@ (ns status-im.subs.wallet.activities (:require [re-frame.core :as rf] + [status-im.contexts.wallet.common.activity-tab.constants :as constants] [utils.datetime :as datetime])) (rf/reg-sub @@ -13,9 +14,11 @@ :<- [:wallet/current-viewing-account-address] (fn [[activities current-viewing-account-address]] (->> activities - (filter (fn [{:keys [sender recipient]}] - (or (= sender current-viewing-account-address) - (= recipient current-viewing-account-address)))) + (filter (fn [{:keys [sender recipient activity-type]}] + (let [receiving-activity? (= activity-type constants/wallet-activity-type-receive) + relevant-address (if receiving-activity? recipient sender)] + (= relevant-address current-viewing-account-address)))) + (distinct) (group-by (fn [{:keys [timestamp]}] (datetime/timestamp->relative-short-date (* timestamp 1000)))) (map (fn [[date activities]] diff --git a/src/status_im/subs/wallet/activities_test.cljs b/src/status_im/subs/wallet/activities_test.cljs index b70a65ee495..9c6d120c892 100644 --- a/src/status_im/subs/wallet/activities_test.cljs +++ b/src/status_im/subs/wallet/activities_test.cljs @@ -27,6 +27,10 @@ {:sender "acc2" :recipient "acc1" :timestamp 1588377600} {:sender "acc3" :recipient "acc4" :timestamp 1588464000}]) (assoc-in [:wallet :current-viewing-account-address] "acc1")))) - (is (= [{:title "May 2, 2020" :data [{:sender "acc2" :recipient "acc1" :timestamp 1588377600}] :timestamp 1588377600} - {:title "May 1, 2020" :data [{:sender "acc1" :recipient "acc2" :timestamp 1588291200}] :timestamp 1588291200}] + (is (= [{:title "May 2, 2020" + :data [{:sender "acc2" :recipient "acc1" :timestamp 1588377600}] + :timestamp 1588377600} + {:title "May 1, 2020" + :data [{:sender "acc1" :recipient "acc2" :timestamp 1588291200}] + :timestamp 1588291200}] (rf/sub [sub-name]))))) From 8e4e4924f251e852dd3b2aed1e8331557e7b8301 Mon Sep 17 00:00:00 2001 From: Omar Basem Date: Wed, 15 May 2024 20:00:07 +0400 Subject: [PATCH 15/20] lint --- Makefile | 2 +- src/status_im/contexts/wallet/home/view.cljs | 56 -------------------- 2 files changed, 1 insertion(+), 57 deletions(-) diff --git a/Makefile b/Makefile index a610cdb331a..b2ad755f612 100644 --- a/Makefile +++ b/Makefile @@ -281,7 +281,7 @@ run-android: export ORG_GRADLE_PROJECT_hermesEnabled := false run-android: ##@run Build Android APK and start it on the device @scripts/run-android.sh -SIMULATOR=iPhone 15 +SIMULATOR=iPhone 13 # TODO: fix IOS_STATUS_GO_TARGETS to be either amd64 or arm64 when RN is upgraded run-ios: export TARGET := ios run-ios: export IOS_STATUS_GO_TARGETS := ios/arm64;iossimulator/amd64 diff --git a/src/status_im/contexts/wallet/home/view.cljs b/src/status_im/contexts/wallet/home/view.cljs index 5aa2e52d45c..73cdd8a1525 100644 --- a/src/status_im/contexts/wallet/home/view.cljs +++ b/src/status_im/contexts/wallet/home/view.cljs @@ -86,7 +86,6 @@ [rn/view {:style (style/home-container)} [common.top-nav/view] [refreshable-flat-list/view -<<<<<<< HEAD {:refresh-control [rn/refresh-control {:refreshing (and tokens-loading? init-loaded?) :colors [colors/neutral-40] @@ -110,58 +109,3 @@ :data [] :render-fn #() :footer [tabs/view {:selected-tab selected-tab}]}]])) -======= - {:refresh-control [rn/refresh-control - {:refreshing (and tokens-loading? init-loaded?) - :colors [colors/neutral-40] - :tint-color colors/neutral-40 - :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 #(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] - [render-tabs tabs-data set-selected-tab selected-tab]] - :sticky-header-indices [0] - :data [] - :render-fn #() - :footer [tabs/view {:selected-tab selected-tab}]}]])) -<<<<<<< HEAD -======= - [rn/view - [quo/wallet-overview - {: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}]) - [rn/flat-list - {:ref #(reset! account-list-ref %) - :style style/accounts-list - :content-container-style style/accounts-list-container - :data cards - :horizontal true - :separator [rn/view {:style style/separator}] - :render-fn (fn [item] [quo/account-card item]) - :shows-horizontal-scroll-indicator false}] - [quo/tabs - {:style style/tabs - :size 32 - :default-active selected-tab - :data tabs-data - :on-change (fn [tab] - (set-selected-tab tab))}] - [tabs/view {:selected-tab selected-tab}]])) ->>>>>>> f39e5bfea (lint) ->>>>>>> 347001b89 (lint) -======= ->>>>>>> 5f9b023ce (lint) From b874aef7d0479dd5651b2f4eba7572f1204d6198 Mon Sep 17 00:00:00 2001 From: Omar Basem Date: Wed, 15 May 2024 20:03:29 +0400 Subject: [PATCH 16/20] lint --- .../contexts/wallet/wallet_connect/utils.cljs | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/status_im/contexts/wallet/wallet_connect/utils.cljs diff --git a/src/status_im/contexts/wallet/wallet_connect/utils.cljs b/src/status_im/contexts/wallet/wallet_connect/utils.cljs new file mode 100644 index 00000000000..8cf5952d67f --- /dev/null +++ b/src/status_im/contexts/wallet/wallet_connect/utils.cljs @@ -0,0 +1,39 @@ +(ns status-im.contexts.wallet.wallet-connect.utils + ;; NOTE: Not sorting namespaces since @walletconnect/react-native-compat should be the first + #_{:clj-kondo/ignore [:unsorted-required-namespaces]} + (:require ["@walletconnect/react-native-compat"] + ["@walletconnect/core" :refer [Core]] + ["@walletconnect/web3wallet" :refer [Web3Wallet]] + ["@walletconnect/utils" :refer [buildApprovedNamespaces]] + [status-im.config :as config] + [utils.i18n :as i18n])) + +(defn- wallet-connect-metadata + [] + #js + {:name (i18n/label :t/status) + :description (i18n/label :t/status-is-a-secure-messaging-app) + :url "https://status.app" + :icons + ["https://res.cloudinary.com/dhgck7ebz/image/upload/f_auto,c_limit,w_1080,q_auto/Brand/Logo%20Section/Mark/Mark_01"]}) + +(defn- wallet-connect-core + [] + (Core. #js {:projectId config/WALLET_CONNECT_PROJECT_ID})) + +(defn init + [] + (let [core (wallet-connect-core)] + (Web3Wallet.init + (clj->js {:core core + :metadata wallet-connect-metadata})))) + +(defn build-approved-namespaces + [proposal supported-namespaces] + (buildApprovedNamespaces + (clj->js {:proposal proposal + :supportedNamespaces supported-namespaces}))) + +(defn format-address + [chain-id address] + (str chain-id ":" address)) From ba6772e3a188f4cf7a6639633904ce9c3cc7ad3c Mon Sep 17 00:00:00 2001 From: Omar Basem Date: Wed, 15 May 2024 20:12:17 +0400 Subject: [PATCH 17/20] lint --- src/status_im/subs/wallet/activities_test.cljs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/status_im/subs/wallet/activities_test.cljs b/src/status_im/subs/wallet/activities_test.cljs index 9c6d120c892..8cef0e73558 100644 --- a/src/status_im/subs/wallet/activities_test.cljs +++ b/src/status_im/subs/wallet/activities_test.cljs @@ -27,10 +27,7 @@ {:sender "acc2" :recipient "acc1" :timestamp 1588377600} {:sender "acc3" :recipient "acc4" :timestamp 1588464000}]) (assoc-in [:wallet :current-viewing-account-address] "acc1")))) - (is (= [{:title "May 2, 2020" - :data [{:sender "acc2" :recipient "acc1" :timestamp 1588377600}] - :timestamp 1588377600} - {:title "May 1, 2020" + (is (= [{:title "May 1, 2020" :data [{:sender "acc1" :recipient "acc2" :timestamp 1588291200}] :timestamp 1588291200}] (rf/sub [sub-name]))))) From c8f23752dec7852785b7b538fb9b48ea02a43f77 Mon Sep 17 00:00:00 2001 From: Omar Basem Date: Fri, 17 May 2024 10:07:43 +0400 Subject: [PATCH 18/20] fix test --- src/status_im/contexts/wallet/wallet_connect/utils.cljs | 6 +++--- src/status_im/subs/wallet/send.cljs | 7 ++++--- status-go-version.json | 6 +++--- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/status_im/contexts/wallet/wallet_connect/utils.cljs b/src/status_im/contexts/wallet/wallet_connect/utils.cljs index 8cf5952d67f..a3414892dde 100644 --- a/src/status_im/contexts/wallet/wallet_connect/utils.cljs +++ b/src/status_im/contexts/wallet/wallet_connect/utils.cljs @@ -1,10 +1,10 @@ (ns status-im.contexts.wallet.wallet-connect.utils ;; NOTE: Not sorting namespaces since @walletconnect/react-native-compat should be the first #_{:clj-kondo/ignore [:unsorted-required-namespaces]} - (:require ["@walletconnect/react-native-compat"] - ["@walletconnect/core" :refer [Core]] - ["@walletconnect/web3wallet" :refer [Web3Wallet]] + (:require ["@walletconnect/core" :refer [Core]] + ["@walletconnect/react-native-compat"] ["@walletconnect/utils" :refer [buildApprovedNamespaces]] + ["@walletconnect/web3wallet" :refer [Web3Wallet]] [status-im.config :as config] [utils.i18n :as i18n])) diff --git a/src/status_im/subs/wallet/send.cljs b/src/status_im/subs/wallet/send.cljs index 465d096f7b5..ac6609cd2d0 100644 --- a/src/status_im/subs/wallet/send.cljs +++ b/src/status_im/subs/wallet/send.cljs @@ -37,10 +37,11 @@ :wallet/recent-recipients :<- [:wallet/activities-for-current-viewing-account] :<- [:wallet/current-viewing-account-address] - (fn [[activities current-viewing-account-address]] - (let [users-sent-transactions (filter (fn [{:keys [sender]}] + (fn [[sections current-viewing-account-address]] + (let [all-transactions (mapcat :data sections) + users-sent-transactions (filter (fn [{:keys [sender]}] (= sender current-viewing-account-address)) - activities)] + all-transactions)] (set (map :recipient users-sent-transactions))))) (rf/reg-sub diff --git a/status-go-version.json b/status-go-version.json index 4e420643697..544646624bf 100644 --- a/status-go-version.json +++ b/status-go-version.json @@ -3,7 +3,7 @@ "_comment": "Instead use: scripts/update-status-go.sh ", "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" } From 30557daf4f7d1fb309cbea4a5f0df6484307319b Mon Sep 17 00:00:00 2001 From: Omar Basem Date: Fri, 17 May 2024 10:10:13 +0400 Subject: [PATCH 19/20] lint --- status-go-version.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/status-go-version.json b/status-go-version.json index 544646624bf..4e420643697 100644 --- a/status-go-version.json +++ b/status-go-version.json @@ -3,7 +3,7 @@ "_comment": "Instead use: scripts/update-status-go.sh ", "owner": "status-im", "repo": "status-go", - "version": "v0.179.19", - "commit-sha1": "3103c298015483cb4d1ee90c8f432fcefe21927d", - "src-sha256": "0ks0ks1fxfn1vdnl5j1pygvyv8gbiixihxrc1ac39yi5q61hwccb" + "version": "v0.179.17", + "commit-sha1": "0dbbf7c641691b3b5b6f4eb241d133aa7d42bf82", + "src-sha256": "0fp6zwb35pwmgb88xyqilw5dj8007cq9m186s915glnf94a45b7x" } From 4e0c883b2eca88b063ae6ee055383b549a428653 Mon Sep 17 00:00:00 2001 From: Omar Basem Date: Fri, 17 May 2024 10:33:25 +0400 Subject: [PATCH 20/20] lint --- .../contexts/wallet/wallet_connect/utils.cljs | 39 ------------------- 1 file changed, 39 deletions(-) delete mode 100644 src/status_im/contexts/wallet/wallet_connect/utils.cljs diff --git a/src/status_im/contexts/wallet/wallet_connect/utils.cljs b/src/status_im/contexts/wallet/wallet_connect/utils.cljs deleted file mode 100644 index a3414892dde..00000000000 --- a/src/status_im/contexts/wallet/wallet_connect/utils.cljs +++ /dev/null @@ -1,39 +0,0 @@ -(ns status-im.contexts.wallet.wallet-connect.utils - ;; NOTE: Not sorting namespaces since @walletconnect/react-native-compat should be the first - #_{:clj-kondo/ignore [:unsorted-required-namespaces]} - (:require ["@walletconnect/core" :refer [Core]] - ["@walletconnect/react-native-compat"] - ["@walletconnect/utils" :refer [buildApprovedNamespaces]] - ["@walletconnect/web3wallet" :refer [Web3Wallet]] - [status-im.config :as config] - [utils.i18n :as i18n])) - -(defn- wallet-connect-metadata - [] - #js - {:name (i18n/label :t/status) - :description (i18n/label :t/status-is-a-secure-messaging-app) - :url "https://status.app" - :icons - ["https://res.cloudinary.com/dhgck7ebz/image/upload/f_auto,c_limit,w_1080,q_auto/Brand/Logo%20Section/Mark/Mark_01"]}) - -(defn- wallet-connect-core - [] - (Core. #js {:projectId config/WALLET_CONNECT_PROJECT_ID})) - -(defn init - [] - (let [core (wallet-connect-core)] - (Web3Wallet.init - (clj->js {:core core - :metadata wallet-connect-metadata})))) - -(defn build-approved-namespaces - [proposal supported-namespaces] - (buildApprovedNamespaces - (clj->js {:proposal proposal - :supportedNamespaces supported-namespaces}))) - -(defn format-address - [chain-id address] - (str chain-id ":" address))