Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support/contractevents: Properly parse asset topic, add event generator. #4808

Merged
merged 3 commits into from
Mar 15, 2023

Conversation

Shaptic
Copy link
Contributor

@Shaptic Shaptic commented Mar 14, 2023

What

This PR has three components:

  1. It fixes a misunderstanding in event parsing in which assets were assumed to be encoded in SEP-11 <code>:<issuer> format, whereas they're actually encoded as raw XDR separated by a : byte
  2. It adds more tests for various parts of the library
  3. It adds an exported GenerateEvent function which lets external packages generate arbitrary event fixtures for testing without worrying about packing the XDR correctly

Why

Respectively,

  1. This is a bug when using this on real events and the new TestRealXdr() proves this
  2. For stability, of course
  3. Related issues like services/horizon: Add account_credited/debited effects for SAC events. #4806 can benefit from creating events w/o needing to understand their structure

See stellar/rs-soroban-env#727 for recommendations on improving (1).

Known limitations

n/a

@Shaptic Shaptic added the bug label Mar 14, 2023
@Shaptic Shaptic requested review from sreuland and a team March 14, 2023 23:34
@Shaptic Shaptic merged commit f8ba8f1 into stellar:soroban-xdr-next Mar 15, 2023
@Shaptic Shaptic deleted the fix-event-parsing branch March 15, 2023 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants