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

Fix the ui tests #4066

Merged
merged 1 commit into from
Nov 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ error: No api implementation given!
--> $DIR/empty_impl_runtime_apis_call.rs:18:1
|
18 | impl_runtime_apis! {}
| ^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^ in this macro invocation
17 changes: 15 additions & 2 deletions core/sr-api-macros/tests/ui/impl_incorrect_method_signature.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,17 @@ error[E0053]: method `Api_test_runtime_api_impl` has an incompatible type for tr
| |_- type in trait
17 |
18 | impl_runtime_apis! {
| ^^^^^^^^^^^^^^^^^^ expected u64, found struct `std::string::String`
| -^^^^^^^^^^^^^^^^^
| |
| _expected u64, found struct `std::string::String`
| |
19 | | impl self::Api<Block> for Runtime {
20 | | fn test(data: String) {}
21 | | }
... |
33 | | }
34 | | }
| |_- in this macro invocation
|
= note: expected type `fn(&RuntimeApiImpl<RuntimeApiImplCall>, &sr_primitives::generic::block::BlockId<sr_primitives::generic::block::Block<sr_primitives::generic::header::Header<u64, sr_primitives::traits::BlakeTwo256>, substrate_test_runtime::Extrinsic>>, sr_api_hidden_includes_DECL_RUNTIME_APIS::sr_api_client::runtime_api::ExecutionContext, std::option::Option<u64>, std::vec::Vec<u8>) -> std::result::Result<sr_api_hidden_includes_DECL_RUNTIME_APIS::sr_api_client::runtime_api::NativeOrEncoded<()>, sr_api_hidden_includes_DECL_RUNTIME_APIS::sr_api_client::error::Error>`
found type `fn(&RuntimeApiImpl<RuntimeApiImplCall>, &sr_primitives::generic::block::BlockId<sr_primitives::generic::block::Block<sr_primitives::generic::header::Header<u64, sr_primitives::traits::BlakeTwo256>, substrate_test_runtime::Extrinsic>>, sr_api_hidden_includes_DECL_RUNTIME_APIS::sr_api_client::runtime_api::ExecutionContext, std::option::Option<std::string::String>, std::vec::Vec<u8>) -> std::result::Result<sr_api_hidden_includes_DECL_RUNTIME_APIS::sr_api_client::runtime_api::NativeOrEncoded<()>, sr_api_hidden_includes_DECL_RUNTIME_APIS::sr_api_client::error::Error>`
Expand All @@ -36,7 +46,10 @@ error[E0308]: mismatched types
... |
33 | | }
34 | | }
| |_^ expected u64, found struct `std::string::String`
| | ^
| | |
| |_expected u64, found struct `std::string::String`
| in this macro invocation
|
= note: expected type `u64`
found type `std::string::String`
Expand Down
8 changes: 6 additions & 2 deletions core/sr-api-macros/tests/ui/invalid_api_version.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ error: can't qualify macro invocation with `pub`
6 | | fn test(data: u64);
7 | | }
8 | | }
| |_^
| | ^ in this macro invocation
| |_|
|
|
= help: try adjusting the macro to put `pub` inside the invocation

Expand All @@ -20,7 +22,9 @@ error: Unexpected `api_version` attribute. The supported format is `api_version(
6 | | fn test(data: u64);
7 | | }
8 | | }
| |_^
| | ^ in this macro invocation
| |_|
|

error: Unexpected `api_version` attribute. The supported format is `api_version(1)`
--> $DIR/invalid_api_version.rs:4:4
Expand Down
8 changes: 6 additions & 2 deletions core/sr-api-macros/tests/ui/invalid_api_version_2.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ error: can't qualify macro invocation with `pub`
6 | | fn test(data: u64);
7 | | }
8 | | }
| |_^
| | ^ in this macro invocation
| |_|
|
|
= help: try adjusting the macro to put `pub` inside the invocation

Expand All @@ -20,7 +22,9 @@ error: Unexpected `api_version` attribute. The supported format is `api_version(
6 | | fn test(data: u64);
7 | | }
8 | | }
| |_^
| | ^ in this macro invocation
| |_|
|

error: Unexpected `api_version` attribute. The supported format is `api_version(1)`
--> $DIR/invalid_api_version_2.rs:4:4
Expand Down
8 changes: 6 additions & 2 deletions core/sr-api-macros/tests/ui/invalid_api_version_3.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ error: can't qualify macro invocation with `pub`
6 | | fn test(data: u64);
7 | | }
8 | | }
| |_^
| | ^ in this macro invocation
| |_|
|
|
= help: try adjusting the macro to put `pub` inside the invocation

Expand All @@ -20,7 +22,9 @@ error: Unexpected `api_version` attribute. The supported format is `api_version(
6 | | fn test(data: u64);
7 | | }
8 | | }
| |_^
| | ^ in this macro invocation
| |_|
|

error: Unexpected `api_version` attribute. The supported format is `api_version(1)`
--> $DIR/invalid_api_version_3.rs:4:4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,17 @@ error[E0053]: method `Api_test_runtime_api_impl` has an incompatible type for tr
| |_- type in trait
17 |
18 | impl_runtime_apis! {
| ^^^^^^^^^^^^^^^^^^ expected u64, found &u64
| -^^^^^^^^^^^^^^^^^
| |
| _expected u64, found &u64
| |
19 | | impl self::Api<Block> for Runtime {
20 | | fn test(data: &u64) {
21 | | unimplemented!()
... |
35 | | }
36 | | }
| |_- in this macro invocation
|
= note: expected type `fn(&RuntimeApiImpl<RuntimeApiImplCall>, &sr_primitives::generic::block::BlockId<sr_primitives::generic::block::Block<sr_primitives::generic::header::Header<u64, sr_primitives::traits::BlakeTwo256>, substrate_test_runtime::Extrinsic>>, sr_api_hidden_includes_DECL_RUNTIME_APIS::sr_api_client::runtime_api::ExecutionContext, std::option::Option<u64>, std::vec::Vec<u8>) -> std::result::Result<sr_api_hidden_includes_DECL_RUNTIME_APIS::sr_api_client::runtime_api::NativeOrEncoded<()>, sr_api_hidden_includes_DECL_RUNTIME_APIS::sr_api_client::error::Error>`
found type `fn(&RuntimeApiImpl<RuntimeApiImplCall>, &sr_primitives::generic::block::BlockId<sr_primitives::generic::block::Block<sr_primitives::generic::header::Header<u64, sr_primitives::traits::BlakeTwo256>, substrate_test_runtime::Extrinsic>>, sr_api_hidden_includes_DECL_RUNTIME_APIS::sr_api_client::runtime_api::ExecutionContext, std::option::Option<&u64>, std::vec::Vec<u8>) -> std::result::Result<sr_api_hidden_includes_DECL_RUNTIME_APIS::sr_api_client::runtime_api::NativeOrEncoded<()>, sr_api_hidden_includes_DECL_RUNTIME_APIS::sr_api_client::error::Error>`
Expand All @@ -36,7 +46,10 @@ error[E0308]: mismatched types
... |
35 | | }
36 | | }
| |_^ expected u64, found &u64
| | ^
| | |
| |_expected u64, found &u64
| in this macro invocation
|
= note: expected type `u64`
found type `&u64`
Expand Down