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

Additional custom metadata for module #3686

Closed
xlc opened this issue Sep 25, 2019 · 6 comments
Closed

Additional custom metadata for module #3686

xlc opened this issue Sep 25, 2019 · 6 comments

Comments

@xlc
Copy link
Contributor

xlc commented Sep 25, 2019

It will be useful to have decl_module takes an additional ModuleMetadata Encodeable and have it stored and passed via metadata rpc call.

This can be useful for various purposes, such as a workaround of paritytech/polkadot-sdk#368 (manually encode the child storage field info, and then JS SDK can decode it and extract the child storage details).

This is like a more generalised version of the constants field in the metadata, that it is not used in runtime, but significantly improves SDK developer's life quality.

@shawntabrizi
Copy link
Member

Should ideally be supported with some expansion of: #5678

@apopiak
Copy link
Contributor

apopiak commented Apr 6, 2021

related to #917

@gui1117
Copy link
Contributor

gui1117 commented Apr 26, 2021

with pallet macro there is extra constants: https://substrate.dev/rustdocs/v3.0.0/frame_support/attr.pallet.html#extra-constants-palletextra_constants-optional

it can add any values to the metadata under any names, would that be enough ?
what more would be needed.

@xlc
Copy link
Contributor Author

xlc commented Apr 26, 2021

Never aware of this feature but I think it solves my issue

@xlc xlc closed this as completed Apr 26, 2021
@shawntabrizi
Copy link
Member

I don't get it. How will this be used?

@xlc
Copy link
Contributor Author

xlc commented Apr 27, 2021

with extra_constants, I should be able to define arbitrary constants that is accessible via metadata, so it can expose things like non-runtime defined parameters, child storage key prefix or any other metadata that could be used by SDK. If I want, I should be able to have it return a JSON string represents custom types and partially address #917.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants