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

fix(ts bindings): handle SAC spec #1795

Merged
merged 2 commits into from
Dec 19, 2024
Merged

fix(ts bindings): handle SAC spec #1795

merged 2 commits into from
Dec 19, 2024

Conversation

willemneal
Copy link
Member

@willemneal willemneal commented Dec 13, 2024

While creating the TS Bindings, we were creating a higher level Spec (not just Vec<ScSpecEntry>), from the raw bytes of the XDR. This higher-level Spec uses metadata from Wasm files, rather than just the raw Vec<ScSpecEntry> stuff, but TS Bindings don't even use that extra metadata. This implementation detail resulted in a bug when generating TS Bindings for Stellar Asset Contracts, which do not have the (unused) extra metadata.

This adds a test of generating TS Bindings for SAC, and fixes the bug.

We've also cleaned up ts-tests logic while here, updating "soroban" references with "stellar".

@willemneal willemneal changed the title fix: handle SAC spec fix(ts bindings): handle SAC spec Dec 13, 2024
@willemneal willemneal requested a review from chadoh December 13, 2024 20:47
@willemneal willemneal marked this pull request as ready for review December 13, 2024 20:47
Wasm files have metadata that isn't currently used by typebindings. However, we were creating a higher level Spec (not just  `Vec<ScSpecEntry>`), from the raw bytes of the XDR.

Also, add initialization logic in
`cmd/crates/soroban-spec-typescript/ts-tests` and a test to show that we
can generate typebindings from the native asset. Clean up `ts-tests`
logic while here, updating "soroban" references with "stellar".
Copy link
Contributor

@chadoh chadoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks for fixing this!

@chadoh chadoh merged commit 1efc4c5 into main Dec 19, 2024
29 of 31 checks passed
@chadoh chadoh deleted the fix/SAC-bindings branch December 19, 2024 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants