-
Notifications
You must be signed in to change notification settings - Fork 646
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
wip/PoC: Enrich metadata custom types with essential types for chain communications #4358
Conversation
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
The CI pipeline was cancelled due to failure one of the required jobs. |
The CI pipeline was cancelled due to failure one of the required jobs. |
I'd leave this as a draft for now since we'll prob want to think about and iterate on it a bit etc :) |
/// The fixed name of the ForeignAssets pallet. | ||
const FOREIGN_ASSETS_PALLET_NAME: &str = "ForeignAssets"; | ||
/// The fixed name of the Assets pallet. | ||
const ASSETS_PALLET_NAME: &str = "Assets"; |
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.
This is nothing we want to integrate. Users will have no fucking idea that they should call the pallets this way. These pallets can also have multiple instances. This doesn't makes any sense and we should not start doing 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.
Yep that makes sense! Its a bit of a hack to see how far I can get in subxt to remove those config types :D
I think a better approach may be to collect the associated types from pallet's configs. However, I'll have to look how much that will increase the metadata size and if we run into limitations with it (maybe not all types impl TypeInfo for us to expose these), will think about it! Thanks for the review! 🙏
( | ||
"Address".into(), | ||
address_ty, | ||
), | ||
( | ||
"Signature".into(), | ||
signature_ty, | ||
), |
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.
They already exist in the extrinsic metadata?
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Small refactoring PR to improve the readability of the proc macros. - small improvement in docs - use new `let Some(..) else` expression - removed extra indentations by early returns Discovered during metadata v16 poc, extracted from: #4358 --------- Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> Co-authored-by: Bastian Köcher <git@kchr.de> Co-authored-by: command-bot <> Co-authored-by: gupnik <mail.guptanikhil@gmail.com>
Small refactoring PR to improve the readability of the proc macros. - small improvement in docs - use new `let Some(..) else` expression - removed extra indentations by early returns Discovered during metadata v16 poc, extracted from: paritytech#4358 --------- Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> Co-authored-by: Bastian Köcher <git@kchr.de> Co-authored-by: command-bot <> Co-authored-by: gupnik <mail.guptanikhil@gmail.com>
Superseded by: #5274 |
This PR enriches the metadata's custom types via captured types needed by users to communicate with the chain.
Ideally, this will naturally evolve into a strongly typed metadata V16.
Subxt relies on a preset called
Config
to interact with the chain.This
Config
present contains types such asAccountId
,Hasher
and more needed to craft transactions.Subxt has implemented a
SubstrateConfig
andPolkadotConfig
.This is the subxt config that can be almost entirely replaced by metadata types.
The end goal of this PoC is to remove as many types needed by those configs and rely on the metadata provided information instead.
For more details, see paritytech/subxt#1566.