-
Notifications
You must be signed in to change notification settings - Fork 10
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
Conversation
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
@@ -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, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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....
This PR adds the outer enum types to the metadata:
For more info visit: paritytech/substrate#14143
// CC @paritytech/subxt-team