Skip to content

Add integration test for trade indexer correctly persisting buy events from Soroban transaction stream #619

Description

@Chucks1093

Summary

The trade indexer processes buy events from the Soroban transaction stream and writes them to the database, but there is no integration test confirming the persisted record matches the on-chain event fields. A test should simulate an incoming buy event and assert the database record is correct.

Scope

  • Feed a mock Soroban buy event into the indexer pipeline
  • Assert a trade record is created in the database with matching: buyer, creator_id, quantity, price, ledger, timestamp
  • Assert no duplicate record is created if the same event is processed twice (idempotency)
  • Assert an event with a missing required field is skipped and logged

Acceptance Criteria

  • Trade record created with all six fields correct
  • Duplicate event does not create a second record
  • Malformed event skipped without crashing the indexer
  • Skipped event produces a warn-level log

ETA: 12 hours


Coordinate on Telegram

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions