Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Missing event field names in post v14 metadata #10750

Closed
lukanus opened this issue Jan 28, 2022 · 3 comments
Closed

Missing event field names in post v14 metadata #10750

lukanus opened this issue Jan 28, 2022 · 3 comments
Labels
J2-unconfirmed Issue might be valid, but it’s not yet known.

Comments

@lukanus
Copy link

lukanus commented Jan 28, 2022

After this PR (#9993) textual description of event fields was removed from description field.
Eg. for balance Transfer event ot was changed from Transfer succeeded. \[from, to, value\] to Transfer succeeded.
This is really nowhere to be found in metadata that only returns data types like AccountId32,AccountId32,u128.
This change seems to broke many apis (like https://polkascan.io/polkadot/event/6202002-3, https://polkascan.io/polkadot/event/8273065-21 ).

I understand the benefit of changing description into keys, but at the same time neither System.Events nor Metadata isn't carrying this information anymore. Is there any new, undocumented way to retrieve this keys? (polkadotjs isn't returning this data either).
And if not, would it be possible to revert the descriptions to how they were?

Maybe @Wizdave97 ? Since you're the one who changed it?

@github-actions github-actions bot added the J2-unconfirmed Issue might be valid, but it’s not yet known. label Jan 28, 2022
@bkchr
Copy link
Member

bkchr commented Jan 28, 2022

As you see here: #9896 (comment)

You can still access the data. This was removed by intention.

To know how to access this data with polkadotjs, you need to read the docs there or open an issue, but not in Substrate.

@bkchr bkchr closed this as completed Jan 28, 2022
@lukanus
Copy link
Author

lukanus commented Jan 28, 2022

@bkchr I'm not using polkadotjs. That was just an example of the code that is also not returning the fields.
I'm using pure ws storage requests to read the data. The issue you've linked does not explain in any way how to retrieve this value from node api. And obviously it is substrate - I even linked a PR in where this particular lines were removed.
https://github.com/paritytech/substrate/blob/master/frame/balances/src/lib.rs#L439 -> that's precisely an event substrate is producing.
And both state_getStorage SystemEvents and getMetadata are Substrate endpoints, this information is missing from both.
Would you be able to tell me then from where should I take this information using Substrate apis?

@bkchr
Copy link
Member

bkchr commented Jan 29, 2022

Why should the node api return this kind of information?

The node isn't interested in this data.

As the linked issue describes, the data is available in the scale-info metadata. See here: https://docs.rs/scale-info/latest/scale_info/struct.Field.html#method.name

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
J2-unconfirmed Issue might be valid, but it’s not yet known.
Projects
None yet
Development

No branches or pull requests

2 participants