Skip to content

feat(events): accept raw ContractEvent XDR input - #141

Merged
Ayinkx merged 1 commit into
AyinkxLab:mainfrom
arike-tech:fix/raw-contract-event-xdr
Oct 28, 2026
Merged

Ayinkx merged 1 commit into
AyinkxLab:mainfrom
arike-tech:fix/raw-contract-event-xdr

Conversation

@arike-tech

Copy link
Copy Markdown
Contributor

Closes #10

Summary

  • Add parse_contract_event_xdr to decode base64 ContractEvent blobs with stellar-xdr.
  • Normalize contract id, event type, topics, and data into the existing EventRecord shape.
  • Accept raw blobs directly through parse_events_str and as xdr/eventXdr fixture fields.
  • Preserve optional fixture metadata such as ledger and txHash when supplied alongside a raw event.
  • Return structured decode errors for malformed base64/XDR.
  • Update docs/events.md and the changelog.

Tests

  • cargo test -p observatory-events passed.
  • cargo test --workspace --all-features passed.
  • cargo clippy -p observatory-events --all-targets --all-features -- -D warnings passed.
  • Added tests for raw event decoding, fixture-entry decoding, bare blob input, malformed input, and fixture-shape equivalence.

Decode base64 ContractEvent blobs directly or from fixture xdr entries and normalize them into EventRecord. Malformed XDR returns a structured decode error.
@Ayinkx
Ayinkx merged commit 7cca8eb into AyinkxLab:main Oct 28, 2026
9 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

Development

Successfully merging this pull request may close these issues.

feat(events): accept raw ContractEvent XDR input

2 participants