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

Update to latest changes in scale-info #5

Merged
merged 7 commits into from
Aug 24, 2021
Merged

Update to latest changes in scale-info #5

merged 7 commits into from
Aug 24, 2021

Conversation

montekki
Copy link
Contributor

A bit of updating to get it to work with latest changes in the substrate branch and other deps branches.

  • Removes NonZeroU32 type ids.
  • frame-metadata dep on scale-info bumped to git = "https://github.com/paritytech/scale-info", branch = "aj-substrate"
  • Hacky workaround since scale-info aj-substrate branch does not yet support TypeDefPhantom::type_param

@@ -114,7 +114,7 @@ impl<'a> TypeGenerator<'a> {
TypeDef::Sequence(seq) => vec![seq.type_param().id()],
TypeDef::Tuple(tuple) => tuple.fields().iter().map(|f| f.id()).collect(),
TypeDef::Compact(compact) => vec![compact.type_param().id()],
TypeDef::Phantom(phantom) => vec![phantom.type_param().id()],
TypeDef::Phantom(_phantom) => vec![/* TODO [now]: this is not yet in the `aj-substrate` branch phantom.type_param().id() */],
Copy link
Owner

Choose a reason for hiding this comment

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

Actually I have remove that here: paritytech/scale-info#96, and aj-substrate includes that PR. We need to figure out whether we still have enough information to generate the correct types. We probably should, but it needs testing out on this side.

core/Cargo.toml Outdated Show resolved Hide resolved
let type_param = params
.iter()
.next()
.expect("a phantom type should have a single type parameter");
let type_path = syn::parse_quote! { core::marker::PhantomData<#type_param> };
*/
Copy link
Owner

Choose a reason for hiding this comment

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

Yes, aj-substrate is in flux atm - should stabilize in the next day or two once I get polkadot compiling.

@ascjones
Copy link
Owner

Thanks for this, I will merge this as is since I will need it now! Can fix anything in follow ups.

@ascjones ascjones merged commit 947521b into ascjones:master Aug 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants