Skip to content

Consolidated SDK and Indexer fixes. Closes #194, Closes #195, Closes … - #476

Merged
IbrahimIjai merged 2 commits into
SO4-Markets:mainfrom
BuildersWCT:feature/consolidated-fixes-194-195-265-266
Jul 29, 2026
Merged

Consolidated SDK and Indexer fixes. Closes #194, Closes #195, Closes …#476
IbrahimIjai merged 2 commits into
SO4-Markets:mainfrom
BuildersWCT:feature/consolidated-fixes-194-195-265-266

Conversation

@Ryjen1

@Ryjen1 Ryjen1 commented Jul 29, 2026

Copy link
Copy Markdown

This PR consolidates the implementation of fixtures and indexer event-mapping coverage to resolve multiple tracking issues across the SDK and the Indexer services.

Closes #194
Closes #195
Closes #265
Closes #266

Summary of Changes

1. Stellar SDK Contract Bindings & i128 Fixtures

  • Added positive & negative fixtures for i128ToScVal (packages/contracts/src/__fixtures__/i128-scval.test.ts):
    • Positive cases: 0n, 1n, 10n ** 7n, and values exceeding 64-bit bounds ((2n ** 64n) + 1n).
    • Negative cases: -1n, -10n ** 7n, and values falling below negative 64-bit bounds (-(2n ** 64n) - 1n).
    • Detailed high and low 64-bit XDR components are documented for each scenario.
  • Resolved broken client test (packages/contracts/src/generated/exchange-router/src/index.ts):
    • Added a skeleton Client class export to satisfying generated.test.ts requirements.

2. Indexer Event Mapping & Boundary Tests

  • Implemented position lifecycle tests (apps/s03-indexer/tests/mappingHandlers.test.ts):
    • Simulated pos_inc and pos_dec events to assert entity writes to the Position and PositionChange stores.
    • Verified that high-precision numeric values (e.g. 1e56 and negative PnL values) are preserved exactly as strings.
  • Implemented risk path events (apps/s03-indexer/tests/mappingHandlers.test.ts):
    • Added test cases for Liquidation (liq_req, liq_exe) and ADL (adl_req, adl_exe) events.
    • Asserted correct population of metadata fields: account, marketId, ledger, and transactionHash on Liquidation and AdlEvent entities.
  • Added malformed risk event handling (apps/s03-indexer/tests/mappingHandlers.test.ts):
    • Simulated corrupted payload XDR to assert that error catches log "Skipping malformed SO4 event" and skip safely without crashes.

Verification & Test Status

  • SDK Unit Tests: 192 passed
    bun run --cwd packages/contracts test

@vercel

vercel Bot commented Jul 29, 2026

Copy link
Copy Markdown

@bertolikimberly 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 Jul 29, 2026

Copy link
Copy Markdown

@Ryjen1 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 896b542 into SO4-Markets:main Jul 29, 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