Update initialize tests for latest rust stable (#5971)

* Update initialize tests for latest rust stable

* Update more tests

* AHHH

* Fix `runtime-interface` test

* ------------------------______________----------------------

* ...
This commit is contained in:
Bastian Köcher
2020-05-11 23:33:32 +02:00
committed by GitHub
parent 97259789dd
commit 70923cdf7c
10 changed files with 50 additions and 80 deletions
@@ -2,4 +2,6 @@ error: No api implementation given!
--> $DIR/empty_impl_runtime_apis_call.rs:17:1
|
17 | sp_api::impl_runtime_apis! {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ in this macro invocation
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -21,20 +21,11 @@ error[E0053]: method `Api_test_runtime_api_impl` has an incompatible type for tr
| |_- type in trait
16 |
17 | sp_api::impl_runtime_apis! {
| -^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| _expected `u64`, found struct `std::string::String`
| |
18 | | impl self::Api<Block> for Runtime {
19 | | fn test(data: String) {}
20 | | }
... |
32 | | }
33 | | }
| |_- in this macro invocation
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u64`, found struct `std::string::String`
|
= note: expected fn pointer `fn(&RuntimeApiImpl<__SR_API_BLOCK__, RuntimeApiImplCall>, &sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::BlockId<__SR_API_BLOCK__>, sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::ExecutionContext, std::option::Option<u64>, std::vec::Vec<_>) -> std::result::Result<_, _>`
found fn pointer `fn(&RuntimeApiImpl<__SR_API_BLOCK__, RuntimeApiImplCall>, &sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::BlockId<__SR_API_BLOCK__>, sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::ExecutionContext, std::option::Option<std::string::String>, std::vec::Vec<_>) -> std::result::Result<_, _>`
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0308]: mismatched types
--> $DIR/impl_incorrect_method_signature.rs:17:1
@@ -46,10 +37,9 @@ error[E0308]: mismatched types
... |
32 | | }
33 | | }
| | ^
| | |
| |_expected `u64`, found struct `std::string::String`
| in this macro invocation
| |_^ expected `u64`, found struct `std::string::String`
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0308]: mismatched types
--> $DIR/impl_incorrect_method_signature.rs:19:11
@@ -14,10 +14,7 @@ error[E0277]: the trait bound `u32: std::convert::From<std::string::String>` is
... |
26 | | }
27 | | }
| | ^
| | |
| |_the trait `std::convert::From<std::string::String>` is not implemented for `u32`
| in this macro invocation
| |_^ the trait `std::convert::From<std::string::String>` is not implemented for `u32`
|
= help: the following implementations were found:
<u32 as std::convert::From<bool>>
@@ -25,3 +22,4 @@ error[E0277]: the trait bound `u32: std::convert::From<std::string::String>` is
<u32 as std::convert::From<h2::frame::reason::Reason>>
<u32 as std::convert::From<h2::frame::reason::Reason>>
and 18 others
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -22,20 +22,11 @@ error[E0053]: method `Api_test_runtime_api_impl` has an incompatible type for tr
| |_- type in trait
...
12 | sp_api::mock_impl_runtime_apis! {
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| _expected `u64`, found `()`
| |
13 | | impl Api<Block> for MockApi {
14 | | fn test(self, data: u64) {}
15 | |
16 | | fn test2(&mut self, data: u64) {}
17 | | }
18 | | }
| |_- in this macro invocation
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u64`, found `()`
|
= note: expected fn pointer `fn(&MockApi, &sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::BlockId<sp_runtime::generic::block::Block<sp_runtime::generic::header::Header<u64, sp_runtime::traits::BlakeTwo256>, substrate_test_runtime::Extrinsic>>, sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::ExecutionContext, std::option::Option<u64>, std::vec::Vec<_>) -> std::result::Result<_, _>`
found fn pointer `fn(&MockApi, &sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::BlockId<sp_runtime::generic::block::Block<sp_runtime::generic::header::Header<u64, sp_runtime::traits::BlakeTwo256>, substrate_test_runtime::Extrinsic>>, sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::ExecutionContext, std::option::Option<()>, std::vec::Vec<_>) -> std::result::Result<_, _>`
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0053]: method `Api_test2_runtime_api_impl` has an incompatible type for trait
--> $DIR/mock_only_self_reference.rs:12:1
@@ -49,17 +40,8 @@ error[E0053]: method `Api_test2_runtime_api_impl` has an incompatible type for t
| |_- type in trait
...
12 | sp_api::mock_impl_runtime_apis! {
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| _expected `u64`, found `()`
| |
13 | | impl Api<Block> for MockApi {
14 | | fn test(self, data: u64) {}
15 | |
16 | | fn test2(&mut self, data: u64) {}
17 | | }
18 | | }
| |_- in this macro invocation
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u64`, found `()`
|
= note: expected fn pointer `fn(&MockApi, &sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::BlockId<sp_runtime::generic::block::Block<sp_runtime::generic::header::Header<u64, sp_runtime::traits::BlakeTwo256>, substrate_test_runtime::Extrinsic>>, sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::ExecutionContext, std::option::Option<u64>, std::vec::Vec<_>) -> std::result::Result<_, _>`
found fn pointer `fn(&MockApi, &sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::BlockId<sp_runtime::generic::block::Block<sp_runtime::generic::header::Header<u64, sp_runtime::traits::BlakeTwo256>, substrate_test_runtime::Extrinsic>>, sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::ExecutionContext, std::option::Option<()>, std::vec::Vec<_>) -> std::result::Result<_, _>`
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -21,20 +21,11 @@ error[E0053]: method `Api_test_runtime_api_impl` has an incompatible type for tr
| |_- type in trait
16 |
17 | sp_api::impl_runtime_apis! {
| -^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| _expected `u64`, found `&u64`
| |
18 | | impl self::Api<Block> for Runtime {
19 | | fn test(data: &u64) {
20 | | unimplemented!()
... |
34 | | }
35 | | }
| |_- in this macro invocation
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u64`, found `&u64`
|
= note: expected fn pointer `fn(&RuntimeApiImpl<__SR_API_BLOCK__, RuntimeApiImplCall>, &sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::BlockId<__SR_API_BLOCK__>, sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::ExecutionContext, std::option::Option<u64>, std::vec::Vec<_>) -> std::result::Result<_, _>`
found fn pointer `fn(&RuntimeApiImpl<__SR_API_BLOCK__, RuntimeApiImplCall>, &sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::BlockId<__SR_API_BLOCK__>, sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::ExecutionContext, std::option::Option<&u64>, std::vec::Vec<_>) -> std::result::Result<_, _>`
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0308]: mismatched types
--> $DIR/type_reference_in_impl_runtime_apis_call.rs:17:1
@@ -46,10 +37,9 @@ error[E0308]: mismatched types
... |
34 | | }
35 | | }
| | ^
| | |
| |_expected `u64`, found `&u64`
| in this macro invocation
| |_^ expected `u64`, found `&u64`
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0308]: mismatched types
--> $DIR/type_reference_in_impl_runtime_apis_call.rs:19:11