Skip to content
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

Integrate scale-info for type generation #2

Merged
merged 17 commits into from
Jan 6, 2021
Merged

Integrate scale-info for type generation #2

merged 17 commits into from
Jan 6, 2021

Conversation

ascjones
Copy link
Contributor

@ascjones ascjones commented Dec 17, 2020

Adds a v13 feature which includes scale-info type information.

The v13 metadata is still a work in progress and will likely require some further iteration as I work on the integration process with substrate.

@ascjones ascjones marked this pull request as ready for review January 6, 2021 12:10
@ascjones ascjones requested a review from tomusdrw January 6, 2021 12:10
Copy link
Contributor

@tomusdrw tomusdrw left a comment

Choose a reason for hiding this comment

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

lgtm! small grumble about inconsistent feature activation

if #[cfg(feature = "v12")] {
mod v12;
pub use v12::*;
} else if #[cfg(feature = "v13")] {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
} else if #[cfg(feature = "v13")] {
}
if #[cfg(feature = "v13")] {

It should be possible to enable both v12 and `v13

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, we will need to reconsider the exports e.g. pub use v12::*; because there will be some duplicates.

Can remove those and just have the user import the v12 v13 types as required?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, let's avoid the reexports and be explicit about versions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, please have a look and merge if happy

@tomusdrw tomusdrw merged commit 1ac42f8 into main Jan 6, 2021
@tomusdrw tomusdrw deleted the aj-scale-info branch January 6, 2021 13:06
gilescope referenced this pull request in gilescope/frame-metadata Aug 28, 2022
#2)

* Metadata supporting scale-info can be decoded and serialized in no_std (feature flag scale_info)

* Changes from review: rename feature flag into full_derive

* Changes from review: std implies full-derive

* Changes from review: optimization

Co-authored-by: echevrier <[email protected]>
jsdw pushed a commit that referenced this pull request Nov 9, 2022
* Metadata supporting scale-info can be decoded and serialized in no_std (#2)

* Metadata supporting scale-info can be decoded and serialized in no_std (feature flag scale_info)

* Changes from review: rename feature flag into full_derive

* Changes from review: std implies full-derive

* Changes from review: optimization

Co-authored-by: echevrier <[email protected]>

* split full_derive into decode and sered_codec features.

(drop new Debug impls)

* cargo fmt

* rename serde_codec to serde_full

* Prior to v14 everything was Debug.

Are there any downsides? Unused debug impls will just get optimised away won't they?

* rust fmt

* Debug for the masses. Make it work for no_std

* check all combos of features

(if this plays well with ci then we should double up,
doing the same again but target wasm32)

* all wasm feature combos

Co-authored-by: echevrier <[email protected]>
Co-authored-by: echevrier <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants