mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 16:17:59 +00:00
decl_runtime_apis! - check that a method without changed_in exists (#5635)
* `decl_runtime_apis!` - check that a method without `changed_in` exists This adds another check to the macro that ensures that not only methods with `changed_in` exists, but there are also the default methods exist. * Update primitives/api/proc-macro/src/decl_runtime_apis.rs Co-Authored-By: Nikolay Volf <nikvolf@gmail.com> * Fix test Co-authored-by: Nikolay Volf <nikvolf@gmail.com>
This commit is contained in:
@@ -113,7 +113,9 @@ use std::{panic::UnwindSafe, cell::RefCell};
|
||||
/// change is highlighted with the `#[changed_in(2)]` attribute above a method. A method that is
|
||||
/// tagged with this attribute is callable by the name `METHOD_before_version_VERSION`. This
|
||||
/// method will only support calling into wasm, trying to call into native will fail (change the
|
||||
/// spec version!). Such a method also does not need to be implemented in the runtime.
|
||||
/// spec version!). Such a method also does not need to be implemented in the runtime. It is
|
||||
/// required that there exist the "default" of the method without the `#[changed_in(_)]` attribute,
|
||||
/// this method will be used to call the current default implementation.
|
||||
///
|
||||
/// ```rust
|
||||
/// sp_api::decl_runtime_apis! {
|
||||
|
||||
Reference in New Issue
Block a user