Description
StellarSubmissionService in src/services/stellarSubmissionService.ts reads STELLAR_SERVER_SECRET, builds a keypair, and submits with retry/backoff and failure classification, but existing tests should be extended to cover the retry-on-retryable-failure path, idempotent resubmission, and the assertion that the secret never appears in logs or errors. Strengthen the test suite.
Requirements and context
- Must be secure, tested, and documented
- Should be efficient and easy to review
- Relevant code:
src/services/stellarSubmissionService.ts, src/services/stellarSubmissionService.test.ts, src/lib/stellarRpcFailure.ts
- Missing
STELLAR_SERVER_SECRET must throw a structured internal error without leaking config
Suggested execution
- Fork the repo and create a branch
git checkout -b test/stellar-submission-coverage
- Implement changes
- Stub the RPC server to return retryable then success and assert one final submit
- Assert non-retryable failures are not retried
- Assert the server secret is never serialized into errors/logs
- Validate security and correctness assumptions
Test and commit
- Run tests
- Cover edge cases
BAD_SEQUENCE, INSUFFICIENT_FUNDS, timeout retry, duplicate submission dedupe
- Include test output and notes
Example commit message
test: cover Stellar submission retry and secret safety
Guidelines
- Minimum 95 percent test coverage
- Clear documentation
- Timeframe: 96 hours
Description
StellarSubmissionServiceinsrc/services/stellarSubmissionService.tsreadsSTELLAR_SERVER_SECRET, builds a keypair, and submits with retry/backoff and failure classification, but existing tests should be extended to cover the retry-on-retryable-failure path, idempotent resubmission, and the assertion that the secret never appears in logs or errors. Strengthen the test suite.Requirements and context
src/services/stellarSubmissionService.ts,src/services/stellarSubmissionService.test.ts,src/lib/stellarRpcFailure.tsSTELLAR_SERVER_SECRETmust throw a structured internal error without leaking configSuggested execution
git checkout -b test/stellar-submission-coverageTest and commit
npm testBAD_SEQUENCE,INSUFFICIENT_FUNDS, timeout retry, duplicate submission dedupeExample commit message
test: cover Stellar submission retry and secret safetyGuidelines