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

chore: refactoring of the TxDetailModal to split the BumpFee (rbf) flow #15977

Merged
merged 3 commits into from
Dec 18, 2024

Conversation

peter-sanderson
Copy link
Contributor

@peter-sanderson peter-sanderson commented Dec 16, 2024

In this PR I am separating the code for TxDetailModal and TxDetailModal with bump-fee (RBF) form in it. The issue here is, that useRbf is used twice, so the internal form state is initialized twice. User changes fee in one, but when they submit it, the different state is used (with just default values). This result in the bug, there the custom fee is not used when set.

👉 For code-review, it will be best go commit by commit.

Resolves: #15598

@peter-sanderson peter-sanderson marked this pull request as ready for review December 16, 2024 12:10
@Lemonexe Lemonexe self-requested a review December 16, 2024 12:35
Copy link
Contributor

@Lemonexe Lemonexe left a comment

Choose a reason for hiding this comment

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

Amazing 🚀

I am delighted to witness such maximum despaghettification. The bottom content, heading, buttons callbacks, all that used to be such an iffy labyrinth of ifs and now it's neatly organised by concern 🙌 ❤️

Tested briefly with regtest, seems to be working fine, the bug with RBF fixed ✔️

EDIT: now I see that TS is broken in useRbfForm.test.tsx. That might be harder to update, as you'll need to render the context to test the <ReplaceTxButton />, or it might be ez, idk..

@peter-sanderson peter-sanderson force-pushed the bump-custom-fee branch 3 times, most recently from c97c0ef to 6f3d9fe Compare December 17, 2024 11:59
@Lemonexe Lemonexe self-requested a review December 17, 2024 12:00
Copy link
Contributor

@Lemonexe Lemonexe left a comment

Choose a reason for hiding this comment

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

Looks good after updating the test, I'm very glad that in the end, the unit tests did verify the code is working correctly 👍

@adamhavel adamhavel self-requested a review December 17, 2024 12:49
Copy link

github-actions bot commented Dec 18, 2024

🚀 Expo preview is ready!

  • Project → trezor-suite-preview
  • Platforms → android, ios
  • Scheme → trezorsuitelite
  • Runtime Version → 21
  • More info

Learn more about 𝝠 Expo Github Action

@peter-sanderson peter-sanderson merged commit 2ed4442 into develop Dec 18, 2024
30 checks passed
@peter-sanderson peter-sanderson deleted the bump-custom-fee branch December 18, 2024 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom fee is ignored when bumping transaction
3 participants