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

sp-api: Put frame-metadata behind some feature #14398

Merged
merged 4 commits into from
Jul 3, 2023

Conversation

bkchr
Copy link
Member

@bkchr bkchr commented Jun 15, 2023

Closes: #14296

@bkchr bkchr added A0-please_review Pull request needs code review. C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit B1-note_worthy Changes should be noted in the release notes T0-node This PR/Issue is related to the topic “node”. labels Jun 15, 2023
@bkchr bkchr requested review from lexnv and a team June 15, 2023 21:40
@bkchr
Copy link
Member Author

bkchr commented Jun 16, 2023

bot fmt

@command-bot
Copy link

command-bot bot commented Jun 16, 2023

@bkchr https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3008401 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh". Check out https://gitlab.parity.io/parity/mirrors/substrate/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.

Comment bot cancel 6-3a763399-6663-4099-a148-8ba1877073e4 to cancel this command or bot cancel to cancel all commands in this pull request.

@command-bot
Copy link

command-bot bot commented Jun 16, 2023

@bkchr Command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh" has finished. Result: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3008401 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3008401/artifacts/download.

let mod_name = generate_runtime_mod_name_for_trait(&decl.ident);
let found_attributes = remove_supported_attributes(&mut decl.attrs);
let api_version =
get_api_version(&found_attributes).map(|v| generate_runtime_api_version(v as u32))?;
let id = generate_runtime_api_id(&decl.ident.to_string());

#[cfg(feature = "frame-metadata")]
let metadata = generate_decl_runtime_metadata(&decl);
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
let metadata = generate_decl_runtime_metadata(&decl);
let metadata = crate::runtime_metadata::generate_decl_runtime_metadata(&decl);

Then you can remove

#[cfg(feature = "frame-metadata")]
use crate::runtime_metadata::generate_decl_runtime_metadata;

altogether and there will be only one #[cfg(feature = "frame-metadata")] necessary instead of two. (Same for the other file.)

@bkchr
Copy link
Member Author

bkchr commented Jul 3, 2023

bot merge

@paritytech-processbot
Copy link

Waiting for commit status.

@paritytech-processbot
Copy link

Merge cancelled due to error. Error: Github API says #14398 is not mergeable

@bkchr bkchr merged commit 1b00cba into master Jul 3, 2023
4 checks passed
@bkchr bkchr deleted the bkchr-sp-api-frame-metadata branch July 3, 2023 09:54
@JoshOrndorff
Copy link
Contributor

Thank you 🙏

nathanwhit pushed a commit to nathanwhit/substrate that referenced this pull request Jul 19, 2023
* sp-api: Put `frame-metadata` behind some feature

Closes: paritytech#14296

* ".git/.scripts/commands/fmt/fmt.sh"

* Review feedback

---------

Co-authored-by: command-bot <>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. B1-note_worthy Changes should be noted in the release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit T0-node This PR/Issue is related to the topic “node”.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sp-api should not depend on frame-metadata
5 participants