Skip to content

test: add comprehensive tests for event decoders and mappings#292

Merged
IbrahimIjai merged 1 commit into
SO4-Markets:mainfrom
codellins:add-indexer-tests
Jun 27, 2026
Merged

test: add comprehensive tests for event decoders and mappings#292
IbrahimIjai merged 1 commit into
SO4-Markets:mainfrom
codellins:add-indexer-tests

Conversation

@codellins

Copy link
Copy Markdown
Contributor

What

Adds comprehensive test coverage for Soroban event decoder functions and protocol mapping handlers.

Issues Resolved

Closes #259
Closes #260
Closes #261
Closes #262

Changes

#259 - Indexer: Soroban event decoder tests

Added detailed fixtures and tests for:

  • Symbol topic decoding
  • Soroban address decoding
  • BytesN<32> decoding with various hex patterns
  • Boolean decoding
  • Signed and unsigned integer decoding
  • Malformed input handling for all decoder functions

#260 - Indexer: event dispatch unknown event test

Added tests verifying:

  • Unknown events do not crash indexing
  • No entity writes occur for unknown events
  • Structured logging occurs for unknown events

#261 - Indexer: market creation mapping test

Added tests verifying:

  • Market records are created with all required fields
  • Entity IDs are deterministically generated
  • Protocol contract and token records are ensured during market creation

#262 - Indexer: deposit lifecycle mapping tests

Added tests covering:

  • Deposit creation (dep_crt)
  • Deposit execution (dep_exe)
  • Deposit cancellation (dep_can)
  • Status transitions between events
  • Idempotent event handling

- Add detailed fixtures for symbol topics, Soroban addresses, BytesN<32>, booleans, signed and unsigned integers
- Include malformed input tests to ensure safe skip behavior
- Expand unknown event tests with deterministic assertion of no entity writes
- Add market creation mapping tests verifying Market and ProtocolContract records with deterministic entity IDs
- Add deposit lifecycle tests covering create, execute, and cancel transitions
- Verify idempotent event handling and status transitions

Resolves SO4-Markets#259
Resolves SO4-Markets#260
Resolves SO4-Markets#261
Resolves SO4-Markets#262
@vercel

vercel Bot commented Jun 27, 2026

Copy link
Copy Markdown

@codellins is attempting to deploy a commit to the Ijai's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jun 27, 2026

Copy link
Copy Markdown

@codellins 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! 🚀

Learn more about application limits

@IbrahimIjai IbrahimIjai merged commit 73e4ce1 into SO4-Markets:main Jun 27, 2026
0 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants