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

Use RuntimeMetadataPrefixed instead of RuntimeMetadata #70

Merged

Conversation

chevdor
Copy link
Owner

@chevdor chevdor commented May 10, 2023

The MetadataWrapper from subwasm always wrapped around the RuntimeMetadata, fetching it from the RuntimeMetadataPrefixed which is defined as:

pub struct RuntimeMetadataPrefixed(pub u32, pub RuntimeMetadata);

This became an issue when exporting the .scale format since subxt expects a serialized RuntimeMetadataPrefixed and subwasm was providing the inner RuntimeMetadata, missing the u32 prefix.

This PR modifies the wrapper to allow exporting the prefix as well and make the scale export from subwasm compatible with subxt ❤️

related to #61

@chevdor
Copy link
Owner Author

chevdor commented May 10, 2023

@trusch beware: this PR fixes the scale format export but also the hex+scale and json+scale.

If you are using those last 2 formats, you may need to fix the usage as you now get an etra u32 at the beginning.

@chevdor chevdor merged commit 24b924d into master May 10, 2023
@chevdor chevdor deleted the wk-230510-use-runtimemetadataprefixed-vs-runtimemetadata branch May 10, 2023 09:03
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.

1 participant