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

feat(suite-native): advanced recipient address validation #15521

Merged
merged 1 commit into from
Nov 27, 2024

Conversation

PeKne
Copy link
Contributor

@PeKne PeKne commented Nov 22, 2024

Description

  • advanced recipient address validation (taproot, bech32 uppercase and LTC + BCH deprecated addresses)

Resolve #15403

@PeKne PeKne added the mobile Suite Lite issues and PRs label Nov 22, 2024
@PeKne PeKne requested a review from a team as a code owner November 22, 2024 12:44
Copy link

github-actions bot commented Nov 22, 2024

🚀 Expo preview is ready!

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

Learn more about 𝝠 Expo Github Action

isAddressValid(value, networkSymbol) &&
!isAddressDeprecated(value, networkSymbol) &&
!isBech32AddressUppercase(value) && // bech32 addresses are valid as uppercase but are not accepted by Trezor
!(isTaprootAddress(value, networkSymbol) && isTaprootUnavailable) // bech32m/Taproot addresses are valid but may not be supported by older FW
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not a fan of ! in front of a complex boolean expression. I'd rename isTaprootUnavailable to isTaprootAvailable and simplify the negation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixup 9c98ecc

@PeKne PeKne force-pushed the feat/native/advanced-recipient-address-validation branch from 9c98ecc to 4c39df6 Compare November 27, 2024 08:23
@PeKne PeKne force-pushed the feat/native/advanced-recipient-address-validation branch from 4c39df6 to 03fe155 Compare November 27, 2024 10:30
@yanascz
Copy link
Contributor

yanascz commented Nov 27, 2024

Seems to work fine now.

@PeKne PeKne merged commit 5abbfce into develop Nov 27, 2024
15 checks passed
@PeKne PeKne deleted the feat/native/advanced-recipient-address-validation branch November 27, 2024 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mobile Suite Lite issues and PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Send coins - Advanced address validation
2 participants