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

Commit

Permalink
Update UI tests
Browse files Browse the repository at this point in the history
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
  • Loading branch information
ggwpez committed Jul 5, 2023
1 parent 8f7751c commit baa9a39
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion primitives/api/test/tests/decl_and_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use sp_runtime::traits::Block as BlockT;
use sp_api::{
decl_runtime_apis, impl_runtime_apis, mock_impl_runtime_apis, ApiError, ApiExt, RuntimeApiInfo,
};
use sp_runtime::traits::Block as BlockT;

use substrate_test_runtime_client::runtime::{Block, Hash};

Expand Down
30 changes: 15 additions & 15 deletions primitives/api/test/tests/ui/impl_incorrect_method_signature.stderr
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
error[E0053]: method `test` has an incompatible type for trait
--> tests/ui/impl_incorrect_method_signature.rs:16:17
--> tests/ui/impl_incorrect_method_signature.rs:15:17
|
16 | fn test(data: String) {}
15 | fn test(data: String) {}
| ^^^^^^
| |
| expected `u64`, found `std::string::String`
| expected `u64`, found `String`
| help: change the parameter type to match the trait: `u64`
|
note: type in trait
--> tests/ui/impl_incorrect_method_signature.rs:10:17
--> tests/ui/impl_incorrect_method_signature.rs:9:17
|
10 | fn test(data: u64);
9 | fn test(data: u64);
| ^^^
= note: expected signature `fn(u64)`
found signature `fn(std::string::String)`
found signature `fn(String)`

error[E0308]: mismatched types
--> tests/ui/impl_incorrect_method_signature.rs:16:11
--> tests/ui/impl_incorrect_method_signature.rs:15:11
|
14 | / sp_api::impl_runtime_apis! {
15 | | impl self::Api<Block> for Runtime {
16 | | fn test(data: String) {}
13 | / sp_api::impl_runtime_apis! {
14 | | impl self::Api<Block> for Runtime {
15 | | fn test(data: String) {}
| | ^^^^ expected `u64`, found `String`
17 | | }
16 | | }
... |
29 | | }
30 | | }
25 | | }
26 | | }
| |_- arguments to this function are incorrect
|
note: associated function defined here
--> tests/ui/impl_incorrect_method_signature.rs:10:6
--> tests/ui/impl_incorrect_method_signature.rs:9:6
|
10 | fn test(data: u64);
9 | fn test(data: u64);
| ^^^^
6 changes: 3 additions & 3 deletions primitives/api/test/tests/ui/impl_missing_version.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error[E0405]: cannot find trait `ApiV4` in module `self::runtime_decl_for_api`
--> tests/ui/impl_missing_version.rs:18:13
--> tests/ui/impl_missing_version.rs:17:13
|
8 | pub trait Api {
7 | pub trait Api {
| ------------- similarly named trait `ApiV2` defined here
...
18 | impl self::Api<Block> for Runtime {
17 | impl self::Api<Block> for Runtime {
| ^^^ help: a trait with a similar name exists: `ApiV2`
6 changes: 3 additions & 3 deletions primitives/api/test/tests/ui/missing_versioned_method.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error[E0046]: not all trait items implemented, missing: `test3`
--> tests/ui/missing_versioned_method.rs:18:2
--> tests/ui/missing_versioned_method.rs:17:2
|
12 | fn test3();
11 | fn test3();
| ----------- `test3` from trait
...
18 | impl self::Api<Block> for Runtime {
17 | impl self::Api<Block> for Runtime {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `test3` in implementation
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error[E0046]: not all trait items implemented, missing: `test3`
--> tests/ui/missing_versioned_method_multiple_vers.rs:20:2
--> tests/ui/missing_versioned_method_multiple_vers.rs:19:2
|
12 | fn test3();
11 | fn test3();
| ----------- `test3` from trait
...
20 | impl self::Api<Block> for Runtime {
19 | impl self::Api<Block> for Runtime {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `test3` in implementation
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
error[E0053]: method `test` has an incompatible type for trait
--> tests/ui/type_reference_in_impl_runtime_apis_call.rs:16:17
--> tests/ui/type_reference_in_impl_runtime_apis_call.rs:15:17
|
16 | fn test(data: &u64) {
15 | fn test(data: &u64) {
| ^^^^
| |
| expected `u64`, found `&u64`
| help: change the parameter type to match the trait: `u64`
|
note: type in trait
--> tests/ui/type_reference_in_impl_runtime_apis_call.rs:10:17
--> tests/ui/type_reference_in_impl_runtime_apis_call.rs:9:17
|
10 | fn test(data: u64);
9 | fn test(data: u64);
| ^^^
= note: expected signature `fn(u64)`
found signature `fn(&u64)`

error[E0308]: mismatched types
--> tests/ui/type_reference_in_impl_runtime_apis_call.rs:16:11
--> tests/ui/type_reference_in_impl_runtime_apis_call.rs:15:11
|
14 | / sp_api::impl_runtime_apis! {
15 | | impl self::Api<Block> for Runtime {
16 | | fn test(data: &u64) {
13 | / sp_api::impl_runtime_apis! {
14 | | impl self::Api<Block> for Runtime {
15 | | fn test(data: &u64) {
| | ^^^^^^^ expected `u64`, found `&u64`
17 | | unimplemented!()
16 | | unimplemented!()
... |
31 | | }
32 | | }
27 | | }
28 | | }
| |_- arguments to this function are incorrect
|
note: associated function defined here
--> tests/ui/type_reference_in_impl_runtime_apis_call.rs:10:6
--> tests/ui/type_reference_in_impl_runtime_apis_call.rs:9:6
|
10 | fn test(data: u64);
9 | fn test(data: u64);
| ^^^^
help: consider removing the borrow
|
16 | fn test(data: &u64) {
15 | fn test(data: &u64) {
|

0 comments on commit baa9a39

Please sign in to comment.