-
Notifications
You must be signed in to change notification settings - Fork 79
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(wallet): properly process ens transaction signals #16934
base: master
Are you sure you want to change the base?
Conversation
Jenkins Builds
|
I tested it today and both issues are fixed |
@@ -443,8 +443,8 @@ proc sendNotification[T](self: Module[T], status: string, sendDetails: SendDetai | |||
addressFrom = sendDetails.fromAddress | |||
addressTo = sendDetails.toAddress | |||
txTo = "" # txFrom is always the same as addressFrom, but txTo is different from addressTo when the app performs any sending flow via certain contract | |||
fromChain = sendDetails.fromChain | |||
toChain = sendDetails.toChain | |||
fromChain = sentTransaction.fromChain |
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 could swear that I've added those two params to SendDetails
on the statusgo side, not sure when/how they disappeared (could be while rebasing/preparing the final PR for review). Anyhow, accessing sentTransaction
here is a dangerous cause that can be nil
in some cases and that will lead to a crash.
Why don't we just update statusgo and add those 2 fields to SendDetails
cause that was my intention when was working on that.
The point is to initially set from and to chains based on SendDetails
and later in this function if sentTransaction
is provided to update those details and emit signal for notification.
Let's please update statusgo with that and revert all changes except one in src/app/modules/main/profile_section/ens_usernames/module.nim
.
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.
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.
SendDetails
are always sent from statusgo, while tx is being sent only if the tx succeeds/exists and that's why I added (but somehow lost later) from/to chains to SendDetails
.
SendDetails
expresses the intention of sending, while RouteSentTransaction
carries data about each individual tx.
For example when swap/bridge send details will have chains X and Y as "from" and "to" chains, while related approval tx will have X for both "from" and "to" chains and swap/bridge tx will have X for "from" and Y for "to" chain.
What does the PR do
Fixes #16921 and #16922
SendDetails
doesn't have chain information, that comes with eachRouterSentTransaction
This PR takes the chainID info from the proper field, indirectly fixing ENS name events and potentially other bugs.
This fix uncovered a new bug that re-added an ENS name to the list after a removal due to triggering a release. This is fixed in the second commit.