From f56bd54fd39bede0acf7967d8ced772be3da30b8 Mon Sep 17 00:00:00 2001 From: flexsurfer Date: Mon, 13 Jan 2025 17:06:59 +0100 Subject: [PATCH] [#21915] Wrong address generated after creation a new keypair (#21921) --- src/status_im/contexts/keycard/create/events.cljs | 3 ++- .../wallet/add_account/create_account/events.cljs | 10 ++++++++++ .../create_account/select_keypair/view.cljs | 8 ++++++-- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/status_im/contexts/keycard/create/events.cljs b/src/status_im/contexts/keycard/create/events.cljs index f22e267098..63eba87e26 100644 --- a/src/status_im/contexts/keycard/create/events.cljs +++ b/src/status_im/contexts/keycard/create/events.cljs @@ -20,7 +20,8 @@ (rf/dispatch [:navigate-back]) (rf/dispatch [:open-modal :screen/confirm-backup {:masked-seed-phrase masked-seed-phrase - :on-success #(rf/dispatch [:keycard/create.phrase-backed-up %])}])) + :on-success #(rf/dispatch [:keycard/create.phrase-backed-up + masked-seed-phrase])}])) (rf/reg-event-fx :keycard/create.get-phrase (fn [{:keys [db]}] diff --git a/src/status_im/contexts/wallet/add_account/create_account/events.cljs b/src/status_im/contexts/wallet/add_account/create_account/events.cljs index b2551d3098..c320867b05 100644 --- a/src/status_im/contexts/wallet/add_account/create_account/events.cljs +++ b/src/status_im/contexts/wallet/add_account/create_account/events.cljs @@ -44,6 +44,16 @@ (rf/reg-event-fx :wallet/confirm-account-origin confirm-account-origin) +(defn store-new-seed-phrase + [{:keys [db]} [{:keys [seed-phrase]}]] + {:db (update-in db + [:wallet :ui :create-account :new-keypair] + assoc + :seed-phrase + seed-phrase)}) + +(rf/reg-event-fx :wallet/store-new-seed-phrase store-new-seed-phrase) + (defn seed-phrase-validated [{:keys [db]} [seed-phrase key-uid on-error]] (let [keypair-already-added? (-> db diff --git a/src/status_im/contexts/wallet/add_account/create_account/select_keypair/view.cljs b/src/status_im/contexts/wallet/add_account/create_account/select_keypair/view.cljs index c9d044fcc4..aee7ee986a 100644 --- a/src/status_im/contexts/wallet/add_account/create_account/select_keypair/view.cljs +++ b/src/status_im/contexts/wallet/add_account/create_account/select_keypair/view.cljs @@ -14,8 +14,12 @@ [masked-seed-phrase] (rf/dispatch [:navigate-to :screen/confirm-backup {:masked-seed-phrase masked-seed-phrase - :on-success #(rf/dispatch [:navigate-to :screen/wallet.keypair-name - {:workflow :new-keypair}])}])) + :on-success (fn [] + (rf/dispatch [:wallet/store-new-seed-phrase + {:seed-phrase + masked-seed-phrase}]) + (rf/dispatch [:navigate-to :screen/wallet.keypair-name + {:workflow :new-keypair}]))}])) (defn- keypair-options []