Pick a fixture
Each fixture’s manifest has two sets of answers.
expected_decoded is what correct parsing yields; expected_indexed is what a correct indexer stores. The values come from Horizon, the ledger, or the transaction as it was built, never from the SDK you’re testing.
Browse every fixture, with its files and expectations, on the fixtures page or at /v1/fixtures.
Load it
Fetch the manifest and the files you need. In tests, verify the hash too. It costs one line and guarantees you’re asserting against the exact bytes the manifest describes.trim() before decoding. The SDK guide shows a pinned sparse checkout.
Assert on what your code produces
The point is to test your function, not the SDK. Run the fixture through the code path your users hit, then compare with the manifest. Here’s the shape of it for a payment-history row, withtoPaymentRow standing in for your own code:
payment-row.test.mjs
- Compare as strings. Every 64-bit value in a manifest is a JSON string. If your code produces a
bigintor auint64, stringify it before comparing. If it produces anumber, the test should fail, and it will. - Pin the fixture id, not “the first fixture”. Ids are stable forever. A test that reads
fixtures[0]changes meaning when the corpus grows.
Need the whole ledger?
Some code works on ledgers, not transactions: a custom ingestion loop, a meta parser, a replay tool. Every fixture’s canonical ledger is available as a zstd-compressedLedgerCloseMetaBatch, the format Galexie and the data lake use:
getLedgers to the mock RPC and get each LedgerCloseMeta as base64, exactly as Stellar RPC returns it.