Skip to content

Commit

Permalink
sp-api: Sprinkle some automatically_derived attributes
Browse files Browse the repository at this point in the history
This attribute is informing tooling that the code is automatically
derived and thus, should not enable any linting.
  • Loading branch information
bkchr committed Nov 29, 2023
1 parent 2858cbc commit 08f29af
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion substrate/primitives/api/proc-macro/src/impl_runtime_apis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ fn generate_runtime_api_base_structures() -> Result<TokenStream> {
extensions_generated_for: std::cell::RefCell<std::option::Option<Block::Hash>>,
}

#[automatically_derived]
impl<Block: #crate_::BlockT, C: #crate_::CallApiAt<Block>> #crate_::ApiExt<Block> for
RuntimeApiImpl<Block, C>
{
Expand Down Expand Up @@ -367,6 +368,7 @@ fn generate_runtime_api_base_structures() -> Result<TokenStream> {
}
}

#[automatically_derived]
impl<Block: #crate_::BlockT, C> #crate_::ConstructRuntimeApi<Block, C>
for RuntimeApi
where
Expand All @@ -389,6 +391,7 @@ fn generate_runtime_api_base_structures() -> Result<TokenStream> {
}
}

#[automatically_derived]
impl<Block: #crate_::BlockT, C: #crate_::CallApiAt<Block>> RuntimeApiImpl<Block, C> {
fn commit_or_rollback_transaction(&self, commit: bool) {
let proof = "\
Expand Down Expand Up @@ -685,9 +688,11 @@ fn generate_api_impl_for_runtime_api(impls: &[ItemImpl]) -> Result<TokenStream>
// remove the trait to get just the module path
runtime_mod_path.segments.pop();

let processed_impl =
let mut processed_impl =
ApiRuntimeImplToApiRuntimeApiImpl { runtime_block }.process(impl_.clone());

processed_impl.attrs.push(parse_quote!(#[automatically_derived]));

result.push(processed_impl);
}

Expand Down

0 comments on commit 08f29af

Please sign in to comment.