Skip to content

[Testing] No idempotency test for the withdrawnAmount/topped-up financial fields when an event is re-processed #806

Description

@grantfox-oss

Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0

Why this matters

tests/soroban-event-worker.test.ts Event processing idempotency only covers stream_created, fee_collected, and replayed stream_paused/stream_resumed - all of which use upsert or set-absolute fields. There is no test that re-processes a tokens_withdrawn event and asserts handleTokensWithdrawn does not double-increment Stream.withdrawnAmount, nor a test confirming handleStreamToppedUp's depositedAmount stays correct under replay.

Acceptance criteria

  • Add a test that runs handleTokensWithdrawn twice for the same txHash and asserts withdrawnAmount changes exactly once
  • Add a test that replays stream_topped_up and asserts depositedAmount/endTime are not double-applied
  • Wire these into the existing idempotency describe block

Files to touch

  • backend/tests/soroban-event-worker.test.ts
  • backend/src/workers/soroban-event-worker.ts

Out of scope

  • Integration tests against a live RPC

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbackendBackend related taskstestingTesting related tasks

Type

No type

Fields

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