-
Notifications
You must be signed in to change notification settings - Fork 18
Add unit tests for XDR event decoder #27
Copy link
Copy link
Open
Labels
Stellar WaveIssues in the Stellar wave programIssues in the Stellar wave programarea:decoderXDR / event decodingXDR / event decodingarea:testsTesting and coverageTesting and coveragedifficulty:intermediate~half a day~half a daygood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Metadata
Metadata
Assignees
Labels
Stellar WaveIssues in the Stellar wave programIssues in the Stellar wave programarea:decoderXDR / event decodingXDR / event decodingarea:testsTesting and coverageTesting and coveragedifficulty:intermediate~half a day~half a daygood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Background
Wraith's XDR event decoder parses raw Soroban event data into structured transfer records (from, to, amount, token). This decoder runs on every ingested ledger — a bug here silently corrupts the transfer history for all users. It currently has zero test coverage.
What to build
Add Jest unit tests for the XDR decoding logic using fixture data from real Soroban events.
Key files
src/decoder.ts— the XDR parsing functionsrc/__tests__/decoder.test.ts— create thisSuggested execution
transferevent XDR payloads from testnet (Stellar Laboratory or the Horizon events API)src/__tests__/fixtures/events.jsonfrom,to,amount, andcontractIdfor each fixtureExample commit message:
test(decoder): add unit tests for XDR Soroban event decoder with fixturesAcceptance criteria
npm testgreen