Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # 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

@SkymanOne SkymanOne requested a review from ascjones September 15, 2022 19:19
@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
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants