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

Commit 35fcfe4

Browse files
bkchrgavofyork
authored andcommitted
Fix the ui tests (#4066)
1 parent 3ccfdab commit 35fcfe4

File tree

6 files changed

+49
-11
lines changed

6 files changed

+49
-11
lines changed

core/sr-api-macros/tests/ui/empty_impl_runtime_apis_call.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ error: No api implementation given!
22
--> $DIR/empty_impl_runtime_apis_call.rs:18:1
33
|
44
18 | impl_runtime_apis! {}
5-
| ^^^^^^^^^^^^^^^^^^^^^
5+
| ^^^^^^^^^^^^^^^^^^^^^ in this macro invocation

core/sr-api-macros/tests/ui/impl_incorrect_method_signature.stderr

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,17 @@ error[E0053]: method `Api_test_runtime_api_impl` has an incompatible type for tr
2121
| |_- type in trait
2222
17 |
2323
18 | impl_runtime_apis! {
24-
| ^^^^^^^^^^^^^^^^^^ expected u64, found struct `std::string::String`
24+
| -^^^^^^^^^^^^^^^^^
25+
| |
26+
| _expected u64, found struct `std::string::String`
27+
| |
28+
19 | | impl self::Api<Block> for Runtime {
29+
20 | | fn test(data: String) {}
30+
21 | | }
31+
... |
32+
33 | | }
33+
34 | | }
34+
| |_- in this macro invocation
2535
|
2636
= 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>`
2737
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>`
@@ -36,7 +46,10 @@ error[E0308]: mismatched types
3646
... |
3747
33 | | }
3848
34 | | }
39-
| |_^ expected u64, found struct `std::string::String`
49+
| | ^
50+
| | |
51+
| |_expected u64, found struct `std::string::String`
52+
| in this macro invocation
4053
|
4154
= note: expected type `u64`
4255
found type `std::string::String`

core/sr-api-macros/tests/ui/invalid_api_version.stderr

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ error: can't qualify macro invocation with `pub`
77
6 | | fn test(data: u64);
88
7 | | }
99
8 | | }
10-
| |_^
10+
| | ^ in this macro invocation
11+
| |_|
12+
|
1113
|
1214
= help: try adjusting the macro to put `pub` inside the invocation
1315

@@ -20,7 +22,9 @@ error: Unexpected `api_version` attribute. The supported format is `api_version(
2022
6 | | fn test(data: u64);
2123
7 | | }
2224
8 | | }
23-
| |_^
25+
| | ^ in this macro invocation
26+
| |_|
27+
|
2428

2529
error: Unexpected `api_version` attribute. The supported format is `api_version(1)`
2630
--> $DIR/invalid_api_version.rs:4:4

core/sr-api-macros/tests/ui/invalid_api_version_2.stderr

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ error: can't qualify macro invocation with `pub`
77
6 | | fn test(data: u64);
88
7 | | }
99
8 | | }
10-
| |_^
10+
| | ^ in this macro invocation
11+
| |_|
12+
|
1113
|
1214
= help: try adjusting the macro to put `pub` inside the invocation
1315

@@ -20,7 +22,9 @@ error: Unexpected `api_version` attribute. The supported format is `api_version(
2022
6 | | fn test(data: u64);
2123
7 | | }
2224
8 | | }
23-
| |_^
25+
| | ^ in this macro invocation
26+
| |_|
27+
|
2428

2529
error: Unexpected `api_version` attribute. The supported format is `api_version(1)`
2630
--> $DIR/invalid_api_version_2.rs:4:4

core/sr-api-macros/tests/ui/invalid_api_version_3.stderr

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ error: can't qualify macro invocation with `pub`
77
6 | | fn test(data: u64);
88
7 | | }
99
8 | | }
10-
| |_^
10+
| | ^ in this macro invocation
11+
| |_|
12+
|
1113
|
1214
= help: try adjusting the macro to put `pub` inside the invocation
1315

@@ -20,7 +22,9 @@ error: Unexpected `api_version` attribute. The supported format is `api_version(
2022
6 | | fn test(data: u64);
2123
7 | | }
2224
8 | | }
23-
| |_^
25+
| | ^ in this macro invocation
26+
| |_|
27+
|
2428

2529
error: Unexpected `api_version` attribute. The supported format is `api_version(1)`
2630
--> $DIR/invalid_api_version_3.rs:4:4

core/sr-api-macros/tests/ui/type_reference_in_impl_runtime_apis_call.stderr

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,17 @@ error[E0053]: method `Api_test_runtime_api_impl` has an incompatible type for tr
2121
| |_- type in trait
2222
17 |
2323
18 | impl_runtime_apis! {
24-
| ^^^^^^^^^^^^^^^^^^ expected u64, found &u64
24+
| -^^^^^^^^^^^^^^^^^
25+
| |
26+
| _expected u64, found &u64
27+
| |
28+
19 | | impl self::Api<Block> for Runtime {
29+
20 | | fn test(data: &u64) {
30+
21 | | unimplemented!()
31+
... |
32+
35 | | }
33+
36 | | }
34+
| |_- in this macro invocation
2535
|
2636
= 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>`
2737
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>`
@@ -36,7 +46,10 @@ error[E0308]: mismatched types
3646
... |
3747
35 | | }
3848
36 | | }
39-
| |_^ expected u64, found &u64
49+
| | ^
50+
| | |
51+
| |_expected u64, found &u64
52+
| in this macro invocation
4053
|
4154
= note: expected type `u64`
4255
found type `&u64`

0 commit comments

Comments
 (0)