Skip to content

Add tests for StellarSubmissionService retry, idempotency, and secret handling #356

@thlpkee20-wq

Description

@thlpkee20-wq

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
    • npm test
  • 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

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions