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 bug where user could input an address on the wrong network. #715

Merged

Conversation

CyonAlexRDX
Copy link
Contributor

@CyonAlexRDX CyonAlexRDX commented Sep 5, 2023

Fix bug where user could input an address on the wrong network - related Slack convo:
https://rdxworks.slack.com/archives/C031A0V1A1W/p1693924609445919

IMG_FB436C1F77D1-1

RPReplay_Final1693929301.MP4

@@ -17,17 +17,48 @@ public struct ChooseReceivingAccount: Sendable, FeatureReducer {

var manualAccountAddressFocused: Bool = false

public enum AddressValidation: Sendable, Hashable {
case valid(AccountAddress)
case wrongNetwork(AccountAddress, incorrectNetwork: UInt8)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need the incorrectNetwork? Seems to be unused

case .wrongNetwork:
return .error("Address is not valid on current network") // FIXME: Strings
case let .valid(validAddress):
if state.chooseAccounts.filteredAccounts.contains(where: { $0 == validAddress }) {
Copy link
Contributor

@maciek-rdx maciek-rdx Sep 5, 2023

Choose a reason for hiding this comment

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

We can do just contains(validAddress) I guess, but likely not worth to trigger one more build at this moment. Cosmetics

@CyonAlexRDX CyonAlexRDX merged commit edc9ffe into main Sep 5, 2023
5 checks passed
@CyonAlexRDX CyonAlexRDX deleted the ABW-2190_crit_bug_recipient_address_changes_in_review branch September 5, 2023 18:11
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants