Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dlipicar
Copy link
Contributor

@dlipicar dlipicar commented Dec 10, 2024

What does the PR do

Fixes #16921 and #16922

SendDetails doesn't have chain information, that comes with each RouterSentTransaction
image
image

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.

@dlipicar dlipicar requested review from a team as code owners December 10, 2024 18:28
@dlipicar dlipicar requested review from Cuteivist, Khushboo-dev-cpp, alaibe and saledjenic and removed request for a team December 10, 2024 18:28
@status-im-auto
Copy link
Member

status-im-auto commented Dec 10, 2024

Jenkins Builds

Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 4488ed8 #1 2024-12-10 18:37:34 ~9 min tests/nim 📄log
✔️ 4488ed8 #1 2024-12-10 18:39:41 ~11 min macos/aarch64 🍎dmg
✔️ 4488ed8 #1 2024-12-10 18:44:19 ~15 min tests/ui 📄log
✔️ 4488ed8 #1 2024-12-10 18:45:18 ~16 min macos/x86_64 🍎dmg
✔️ 4488ed8 #1 2024-12-10 18:47:38 ~19 min linux-nix/x86_64 📦tgz
✔️ 4488ed8 #1 2024-12-10 18:50:45 ~22 min windows/x86_64 💿exe
✔️ 4488ed8 #1 2024-12-10 18:52:35 ~24 min linux/x86_64 📦tgz
✔️ 9fa6c62 #2 2024-12-10 21:33:24 ~6 min macos/aarch64 🍎dmg
✔️ 9fa6c62 #2 2024-12-10 21:36:08 ~8 min tests/nim 📄log
✔️ 9fa6c62 #2 2024-12-10 21:39:31 ~12 min tests/ui 📄log
✔️ 9fa6c62 #2 2024-12-10 21:41:09 ~13 min linux-nix/x86_64 📦tgz
✔️ 9fa6c62 #2 2024-12-10 21:41:21 ~14 min macos/x86_64 🍎dmg
✔️ 9fa6c62 #2 2024-12-10 21:45:30 ~18 min windows/x86_64 💿exe
✔️ 9fa6c62 #2 2024-12-10 21:48:29 ~21 min linux/x86_64 📦tgz

@anastasiyaig anastasiyaig self-requested a review December 11, 2024 06:24
@anastasiyaig
Copy link
Contributor

I tested it today and both issues are fixed

@anastasiyaig anastasiyaig linked an issue Dec 11, 2024 that may be closed by this pull request
@@ -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
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ugh there's already so much duplicated data between the two structs. What's the reason for having each field twice?
image
I see this and I think "which of the two fields should I trust?"

Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants