test: expand stellarRpcFailure Horizon result-code coverage#361
Open
samueloyibodevv wants to merge 1 commit into
Open
test: expand stellarRpcFailure Horizon result-code coverage#361samueloyibodevv wants to merge 1 commit into
samueloyibodevv wants to merge 1 commit into
Conversation
|
@samueloyibodevv 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.
Overview
This PR expands
src/lib/stellarRpcFailure.test.tsto comprehensively cover Horizonextras.result_codesclassification for transaction- and operation-level failures. It verifiestx_bad_seq,tx_insufficient_fee,op_no_destination, andop_underfunded, confirmsshouldRetrybehavior for each classified failure, and adds security assertions to ensure raw upstream messages never leak through classified output.Related Issue
Closes #349
Changes
⚙️ Stellar Result-Code Classification Coverage
src/lib/stellarRpcFailure.test.tsextras.result_codespayloads.tx_bad_seqandtx_insufficient_feemapping toTX_RESULT_CODE.op_no_destinationandop_underfundedmapping toOP_RESULT_CODE.shouldRetryon tx/op result-code classifications.extras, non-Errorobjects, andnull/undefinedinput.🔒 Sanitization And Security
src/lib/stellarRpcFailure.tssanitizeError()so raw upstreammessagetext is replaced withUPSTREAM_MESSAGE_REDACTED.🧪 Related Test Alignment
[MODIFY]
src/routes/payouts.test.tsUpdated existing assertions to match the classifier’s structured return shape.
Added security checks confirming redacted classified output is not the raw upstream object.
[MODIFY]
src/__tests__/stellarRpcFailure.integration.test.tsUpdated the logger mock to include
.child().Aligned the long-message sanitization expectation with the redacted behavior.
📘 Documentation
docs/payouts-stellar-result-codes-retry-storms.mdVerification Results
tx_bad_seqclassificationtx_insufficient_feeclassificationop_no_destinationclassificationop_underfundedclassificationshouldRetryfor tx/op result-code failuresScreenshots
✅ Targeted test run
A screenshot of:
npm test -- --runInBand src/lib/stellarRpcFailure.test.ts src/routes/payouts.test.ts