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

Store type name of a field in event metadata #654

Merged
merged 4 commits into from
Sep 20, 2022
Merged

Conversation

SkymanOne
Copy link
Contributor

Fields in EventMetadata now also store name of a type specified in the pallet's source code.

Required for #673 in cargo-contract

CHANGELOG.md Outdated Show resolved Hide resolved
@jsdw
Copy link
Collaborator

jsdw commented Sep 16, 2022

LGTM aside from my tiny nit and Andrew's suggestion!

@@ -457,7 +490,13 @@ impl TryFrom<RuntimeMetadataPrefixed> for Metadata {
fields: variant
.fields()
.iter()
.map(|f| (f.name().map(|n| n.to_owned()), f.ty().id()))
.map(|f| {
EventFieldMetadata::new(
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: Maybe we could use something like impl From<Field<PortableForm>> here

Copy link
Collaborator

@lexnv lexnv left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for contributing! 👍

@SkymanOne SkymanOne merged commit 033ceb2 into master Sep 20, 2022
@SkymanOne SkymanOne deleted the gn-add-field-type branch September 20, 2022 08:59
This was referenced Sep 20, 2022
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