mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 06:27:58 +00:00
Versioning for #[runtime-interface] (#5328)
* versionned runtime-interface * use only one additional wasm blob * alter docs * formatting, naming and docs * add comment for test * version duplicate err * RuntimeInterfaceItem -> RuntimeInterfaceFunction< * test naming * version checking * remove spaces * Update primitives/runtime-interface/proc-macro/src/runtime_interface/bare_function_interface.rs Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com> * remove sanity checks and reduce coverage * add doc comment Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
use sp_runtime_interface::runtime_interface;
|
||||
|
||||
#[runtime_interface]
|
||||
trait Test {
|
||||
#[version(2)]
|
||||
fn test() { }
|
||||
#[version(2)]
|
||||
fn test() { }
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,11 @@
|
||||
error: Duplicated version attribute
|
||||
--> $DIR/no_duplicate_versions.rs:7:2
|
||||
|
|
||||
7 | #[version(2)]
|
||||
| ^
|
||||
|
||||
error: Previous version with the same number defined here
|
||||
--> $DIR/no_duplicate_versions.rs:5:2
|
||||
|
|
||||
5 | #[version(2)]
|
||||
| ^
|
||||
@@ -0,0 +1,17 @@
|
||||
use sp_runtime_interface::runtime_interface;
|
||||
|
||||
#[runtime_interface]
|
||||
trait Test {
|
||||
#[version(1)]
|
||||
fn test2() {}
|
||||
#[version(2)]
|
||||
fn test2() {}
|
||||
#[version(3)]
|
||||
fn test2() {}
|
||||
|
||||
fn test() { }
|
||||
#[version(3)]
|
||||
fn test() { }
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,5 @@
|
||||
error: Unexpected version attribute: missing version '2' for this function
|
||||
--> $DIR/no_gaps_in_versions.rs:13:2
|
||||
|
|
||||
13 | #[version(3)]
|
||||
| ^
|
||||
@@ -1,11 +0,0 @@
|
||||
error: Generic parameters not supported.
|
||||
--> $DIR/no_generic_parameters.rs:5:10
|
||||
|
|
||||
5 | fn test<R>() {}
|
||||
| ^
|
||||
|
||||
error: Generic parameters not supported.
|
||||
--> $DIR/no_generic_parameters.rs:4:12
|
||||
|
|
||||
4 | trait Test<T> {
|
||||
| ^
|
||||
@@ -0,0 +1,8 @@
|
||||
use sp_runtime_interface::runtime_interface;
|
||||
|
||||
#[runtime_interface]
|
||||
trait Test {
|
||||
fn test<T>() {}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,5 @@
|
||||
error: Generic parameters not supported.
|
||||
--> $DIR/no_generic_parameters_method.rs:5:10
|
||||
|
|
||||
5 | fn test<T>() {}
|
||||
| ^
|
||||
+1
-1
@@ -2,7 +2,7 @@ use sp_runtime_interface::runtime_interface;
|
||||
|
||||
#[runtime_interface]
|
||||
trait Test<T> {
|
||||
fn test<R>() {}
|
||||
fn test() {}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,5 @@
|
||||
error: Generic parameters not supported.
|
||||
--> $DIR/no_generic_parameters_trait.rs:4:12
|
||||
|
|
||||
4 | trait Test<T> {
|
||||
| ^
|
||||
Reference in New Issue
Block a user