fix: replace hardcoded testnet explorer URL in PurchaseSuccessModal with buildExplorerUrl - #1695
Merged
1nonlypiece merged 1 commit intoJul 28, 2026
Conversation
…ith buildExplorerUrl Replace the inline template string in PurchaseSuccessModal.tsx (https://stellar.expert/explorer/testnet/tx/${txHash}) with buildExplorerUrl('tx', txHash, network) from @/utils/explorerLinks, which validates the hash against TX_HASH_PATTERN before constructing the URL and defaults to the public network instead of hardcoding testnet. - Add network prop (ExplorerNetwork, defaults to 'public') to PurchaseSuccessModalProps so callers pass the configured network. - Restore Dialog.tsx component that was deleted in 1ecce7d. - Add test asserting no explorer link when txHash fails validation. - Add test asserting explorer link uses correct network (public/testnet). Closes Commitlabs-Org#1399
|
@Cerome360 is attempting to deploy a commit to the 1nonly's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Cerome360 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Summary
Replaces the hardcoded testnet Stellar Explorer URL in
PurchaseSuccessModalwith the app'sbuildExplorerUrlutility function, which validates the transaction hash and respects the configured network.What Changed
buildExplorerUrlfrom@/utils/explorerLinksand usesbuildExplorerUrl('tx', txHash, network)instead of a hardcodedhttps://stellar.expert/explorer/testnet/tx/${txHash}string. Accepts an optionalnetworkprop defaulting to'public'.Key Design Decisions
buildExplorerUrlwhich validates txHash againstTX_HASH_PATTERN(64 hex chars) before constructing the URL.buildExplorerUrlreturns a truthy value — invalid/missing hashes automatically hide the link.'public'(mainnet) rather than testnet, matching the app's production configuration.Acceptance Criteria
buildExplorerUrl('tx', txHash, network)networkpropTest Output
Follow-ups
None.
Security Note
All externally-sourced identifiers go through
buildExplorerUrlvalidation before URL construction, preventing URL injection via malformed tx hashes. Explorer links open withrel="noopener noreferrer".Closes #1399