Repository navigation
feat(frontend): prevent self-streaming when recipient matches sender wallet in StreamCreationWizard - #1691
Open
aazminu wants to merge 3 commits into
Conversation
…wallet in StreamCreationWizard
… StreamCreationWizard (LabsCrypt#1632)
This branch has not been deployed
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.
Description
Prevents users from creating a payment stream to their own connected Stellar wallet address in
RecipientStep(frontend/src/components/stream-creation/RecipientStep.tsx),StreamCreationWizard(frontend/src/components/stream-creation/StreamCreationWizard.tsx), andfrontend/src/lib/stream-validation.ts.Type of Change
Related Issues
Closes #1632
Fixes #1632
/claim #1632
Changes Made
validateRecipientandvalidateStreamForminfrontend/src/lib/stream-validation.tsto accept an optionalsenderAddressparameter and return"Recipient address cannot be the same as your connected sender wallet"when the trimmed, case-normalized recipient matches the sender wallet address.RecipientStep(frontend/src/components/stream-creation/RecipientStep.tsx) to compare the recipient input against the connected sender wallet address and immediately display the inline validation error alert.StreamCreationWizard(frontend/src/components/stream-creation/StreamCreationWizard.tsx) to passwalletPublicKeytoRecipientStepand disable theNextbutton on Step 2 when recipient validation fails.frontend/src/lib/__tests__/stream-validation.test.tsandfrontend/src/__tests__/components.test.tsxcovering exact, case-insensitive, and whitespace-padded self-stream detection.Testing
Test Coverage
Test Steps
npx vitest run src/lib/__tests__/stream-validation.test.ts src/__tests__/components.test.tsx src/components/stream-creation/__tests__/StreamCreationWizard.test.tsxinfrontend/(118/118 tests pass).npx tsc --noEmitinfrontend/(0 errors).npx eslint src/lib/stream-validation.ts src/components/stream-creation/RecipientStep.tsx src/components/stream-creation/StreamCreationWizard.tsx src/lib/__tests__/stream-validation.test.ts src/__tests__/components.test.tsxinfrontend/(0 errors, 0 warnings).Checklist
Additional Notes
Payout Details
0x9a51790aC01c54184bcFa067bC38f7F0E7C6F6B6