check wallet activated when sending to stellar#782
Merged
Conversation
zaelgohary
reviewed
Dec 1, 2024
Comment on lines
+123
to
+125
| toAddressError = 'Wallet not activated on stellar'; | ||
| return false; | ||
| } |
Contributor
There was a problem hiding this comment.
Suggested change
| toAddressError = 'Wallet not activated on stellar'; | |
| return false; | |
| } | |
| final wallet = widget.allWallets | |
| .where((wallet) => wallet.stellarAddress == toAddress).toList().first; | |
| if (wallet.stellarBalance == '-1') { | |
| toAddressError = 'Wallet not activated on stellar'; | |
| return false; | |
| } |
Contributor
Author
There was a problem hiding this comment.
In the provided code if there's no matching wallet, flutter will throw an exception.
That's why i handled it that way to check first there's a matching wallet.
AhmedHanafy725
requested changes
Dec 2, 2024
Comment on lines
+118
to
+125
| final matchingWallets = widget.allWallets | ||
| .where((wallet) => wallet.stellarAddress == toAddress); | ||
| final Wallet? wallet = | ||
| matchingWallets.isNotEmpty ? matchingWallets.first : null; | ||
| if (wallet != null && wallet.stellarBalance == '-1') { | ||
| toAddressError = 'Wallet not activated on stellar'; | ||
| return false; | ||
| } |
Contributor
There was a problem hiding this comment.
not enough, what if the user copies and pastes an address that does not match the current wallets?
we should get the balance of the wallet and make sure it's activated and has TFT trustline
…ect into development_check_wallet_activated
AhmedHanafy725
approved these changes
Dec 4, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tested Scenarios: