-
Notifications
You must be signed in to change notification settings - Fork 984
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: route not found when attempting to transfer assets to own accounts #18325
Conversation
Jenkins BuildsClick to see older builds (8)
|
Could you describe what changes you made here? I know what's being done but it will be nice to understand how you are doing it 👍 |
@J-Son89 thanks for the suggestion, updated the PR description with a better description of the changes 👍 |
52% of end-end tests have passed
Failed tests (19)Click to expandClass TestCommunityMultipleDeviceMerged:
Class TestActivityCenterContactRequestMultipleDevicePR:
Class TestCommunityOneDeviceMerged:
Class TestCommunityMultipleDeviceMergedTwo:
Expected to fail tests (4)Click to expandClass TestOneToOneChatMultipleSharedDevicesNewUi:
Class TestCommunityOneDeviceMerged:
Class TestGroupChatMultipleDeviceMergedNewUI:
Passed tests (25)Click to expandClass TestOneToOneChatMultipleSharedDevicesNewUi:
Class TestOneToOneChatMultipleSharedDevicesNewUiTwo:
Class TestGroupChatMultipleDeviceMergedNewUI:
Class TestActivityCenterContactRequestMultipleDevicePR:
Class TestActivityMultipleDevicePR:
Class TestActivityMultipleDevicePRTwo:
Class TestDeepLinksOneDevice:
Class TestCommunityOneDeviceMerged:
|
(rf/reg-event-fx :wallet/clean-account-selection | ||
(fn [{:keys [db]}] | ||
{:db (update-in db [:wallet :ui :send] dissoc :send-account-address)})) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Important step!
Recently I noticed when we navigate to a collectible details, for a moment, we show the previous displayed collectible details. that's because we are not cleaning the collectibles db when navigating back, so it's good we are cleaning these keys 👍
@@ -54,7 +59,8 @@ | |||
(fn [{:keys [db now]} [amount]] | |||
(let [wallet-address (get-in db [:wallet :current-viewing-account-address]) | |||
token (get-in db [:wallet :ui :send :token]) | |||
to-address (get-in db [:wallet :ui :send :to-address]) | |||
account-address (get-in db [:wallet :ui :send :send-account-address]) | |||
to-address (or account-address (get-in db [:wallet :ui :send :to-address])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use the not-found
in get-in
(get-in db [:a :b :c] :return-if-not-found)
(rf/reg-event-fx :wallet/select-send-account-address | ||
(fn [{:keys [db]} [{:keys [address stack-id]}]] | ||
{:db (-> db | ||
(assoc-in [:wallet :ui :send :send-account-address] address) | ||
(update-in [:wallet :ui :send] dissoc :to-address)) | ||
:fx [[:navigate-to-within-stack [:wallet-select-asset stack-id]]]})) | ||
|
||
(rf/reg-event-fx :wallet/select-send-address | ||
(fn [{:keys [db]} [{:keys [address stack-id]}]] | ||
{:db (assoc-in db [:wallet :ui :send :to-address] address) | ||
{:db (-> db | ||
(assoc-in [:wallet :ui :send :to-address] address) | ||
(update-in [:wallet :ui :send] dissoc :send-account-address)) | ||
:fx [[:navigate-to-within-stack [:wallet-select-asset stack-id]]]})) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these events only differ in the key where they store the selected address. But why do we need them? I think we could mark in :ui :send
a boolean instead 🤔
about the names of the events :wallet/select-send-address
and :wallet/select-send-account-address
are very similar, maybe we could set a different name more descriptive to understand them better.
3fe1f95
to
160b94a
Compare
160b94a
to
9a28ae0
Compare
73% of end-end tests have passed
Failed tests (11)Click to expandClass TestOneToOneChatMultipleSharedDevicesNewUi:
Class TestCommunityMultipleDeviceMergedTwo:
Class TestActivityCenterContactRequestMultipleDevicePR:
Class TestGroupChatMultipleDeviceMergedNewUI:
Class TestCommunityMultipleDeviceMerged:
Expected to fail tests (2)Click to expandClass TestCommunityOneDeviceMerged:
Class TestGroupChatMultipleDeviceMergedNewUI:
Passed tests (35)Click to expandClass TestDeepLinksOneDevice:
Class TestGroupChatMultipleDeviceMergedNewUI:
Class TestActivityMultipleDevicePRTwo:
Class TestActivityMultipleDevicePR:
Class TestOneToOneChatMultipleSharedDevicesNewUi:
Class TestCommunityOneDeviceMerged:
Class TestActivityCenterContactRequestMultipleDevicePR:
Class TestOneToOneChatMultipleSharedDevicesNewUiTwo:
Class TestCommunityMultipleDeviceMerged:
|
Hi @briansztamfater ! |
… eth account Signed-off-by: Brian Sztamfater <[email protected]>
9a28ae0
to
3ba85d6
Compare
… eth account (#18325) Signed-off-by: Brian Sztamfater <[email protected]>
fixes #18232
Summary
This PR fixes routes not being fetched when attemping to send assets to an account from My Accounts tab.
:wallet/select-send-account-address
event to dissoc:to-address
from db, and assoc:send-account-address
, also moved navigation to an effect:wallet/select-send-address
event to dissoc:send-account-address
from db, and assoc:to-address
:wallet/get-suggested-routes
event, use:send-account-address
or:to-address
as the sending address parameter (previously:send-account-address
was being ignored and causedgetSuggestedRoutes
endpoint to instantly fail)Platforms
Areas that maybe impacted
Functional
Steps to test
status: ready