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

Metadata V15: Add outer enum types for calls, events, errors #57

Merged
merged 1 commit into from
May 23, 2023

Conversation

lexnv
Copy link
Contributor

@lexnv lexnv commented May 15, 2023

This PR adds the outer enum types to the metadata:

  • RuntimeCall enum type
  • RuntimeEvent enum type
  • RuntimeError enum type

For more info visit: paritytech/substrate#14143

// CC @paritytech/subxt-team

@ascjones ascjones merged commit 0c64009 into main May 23, 2023
@ascjones ascjones deleted the lexnv/metadata_outer_enums branch May 23, 2023 12:35
@@ -50,6 +50,12 @@ pub struct RuntimeMetadataV15 {
pub ty: <PortableForm as Form>::Type,
/// Metadata of the Runtime API.
pub apis: Vec<RuntimeApiMetadata<PortableForm>>,
/// The type of the outer `RuntimeCall` enum.
pub call_enum_ty: <PortableForm as Form>::Type,
Copy link
Member

Choose a reason for hiding this comment

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

By doing this, we now have duplicated data in the metadata... I'm for this change, but then we should remove the duplicated stuff, like pallet.error, pallet.calls etc.

Copy link
Contributor

Choose a reason for hiding this comment

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

Indeed. I did have these originally and removed them on the grounds of duplication, favouring the previous structure of pallet.calls etc. for ease of migration. But if it will be a new breaking metadata version then we can consider removing them.

Copy link
Member

Choose a reason for hiding this comment

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

Technically we change the encoded format, so it will always require a new metadata version. However, we are in the process of releasing the next metadata version any way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That makes, sense. I'll create another PR to remove the duplicate data (ie pallet. calls) for the V15, thanks!

Copy link
Member

Choose a reason for hiding this comment

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

Please post this into the Polkadot forum. We need some attention around this.

Copy link
Member

Choose a reason for hiding this comment

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

Can go into the post of @jsdw where he announced the V15 freeze.

/// The type of the outer `RuntimeEvent` enum.
pub event_enum_ty: <PortableForm as Form>::Type,
/// The type of the outer `RuntimeError` enum.
pub error_enum_ty: <PortableForm as Form>::Type,
Copy link
Member

Choose a reason for hiding this comment

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

And you know that the error type isn't encoded like this? I know that you introduced this type now, but it doesn't make that much sense....

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.

4 participants