Skip to content

Commit 59b4e11

Browse files
committed
tests: fix ui tests
1 parent d94ad4c commit 59b4e11

8 files changed

+45
-45
lines changed

crates/env/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,5 @@ unstable-hostfn = []
105105
level = "warn"
106106
check-cfg = [
107107
'cfg(feature, values(any()))',
108+
'cfg(ink_abi, values("ink", "sol", "all"))'
108109
]

crates/ink/tests/ui/contract/fail/message/message-input-non-codec.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ note: required by a bound in `ExecutionInput::<ArgumentList<ArgumentListEnd, Arg
5050
| T: AbiEncodeWith<Abi>,
5151
| ^^^^^^^^^^^^^^^^^^ required by this bound in `ExecutionInput::<ArgumentList<ArgumentListEnd, ArgumentListEnd, Abi>, Abi>::push_arg`
5252

53-
error[E0599]: the method `try_invoke` exists for struct `CallBuilder<DefaultEnvironment, Set<Call>, Set<ExecutionInput<ArgumentList<Argument<NonCodecType>, ArgumentList<ArgumentListEnd, ArgumentListEnd, ScaleEncoding>, ScaleEncoding>, ScaleEncoding>>, Set<ReturnType<()>>>`, but its trait bounds were not satisfied
53+
error[E0599]: the method `try_invoke` exists for struct `CallBuilder<DefaultEnvironment, Set<Call>, Set<ExecutionInput<ArgumentList<Argument<NonCodecType>, ArgumentList<ArgumentListEnd, ArgumentListEnd, Ink>, Ink>, Ink>>, Set<ReturnType<()>>>`, but its trait bounds were not satisfied
5454
--> tests/ui/contract/fail/message/message-input-non-codec.rs:18:9
5555
|
5656
18 | pub fn message(&self, _input: NonCodecType) {}
@@ -59,8 +59,8 @@ error[E0599]: the method `try_invoke` exists for struct `CallBuilder<DefaultEnvi
5959
::: $WORKSPACE/crates/env/src/call/execution.rs
6060
|
6161
| pub struct ArgumentList<Head, Rest, Abi> {
62-
| ---------------------------------------- doesn't satisfy `_: AbiEncodeWith<ScaleEncoding>` or `_: Encode`
62+
| ---------------------------------------- doesn't satisfy `_: AbiEncodeWith<Ink>` or `_: Encode`
6363
|
6464
= note: the following trait bounds were not satisfied:
65-
`ArgumentList<Argument<NonCodecType>, ArgumentList<ArgumentListEnd, ArgumentListEnd, ScaleEncoding>, ScaleEncoding>: Encode`
66-
which is required by `ArgumentList<Argument<NonCodecType>, ArgumentList<ArgumentListEnd, ArgumentListEnd, ScaleEncoding>, ScaleEncoding>: AbiEncodeWith<ScaleEncoding>`
65+
`ArgumentList<Argument<NonCodecType>, ArgumentList<ArgumentListEnd, ArgumentListEnd, ink::abi::Ink>, ink::abi::Ink>: Encode`
66+
which is required by `ArgumentList<Argument<NonCodecType>, ArgumentList<ArgumentListEnd, ArgumentListEnd, ink::abi::Ink>, ink::abi::Ink>: AbiEncodeWith<ink::abi::Ink>`

crates/ink/tests/ui/contract/fail/message/message-returns-non-codec.stderr

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,28 +25,27 @@ note: required by a bound in `DispatchOutput`
2525
| ^^^^^^^^^^^^^ required by this bound in `DispatchOutput`
2626

2727
error[E0277]: the trait bound `Result<NonCodecType, LangError>: Encode` is not satisfied
28-
--> tests/ui/contract/fail/message/message-returns-non-codec.rs:18:9
29-
|
30-
18 | / pub fn message(&self) -> NonCodecType {
31-
19 | | NonCodecType
32-
20 | | }
33-
| |_________^ the trait `Encode` is not implemented for `Result<NonCodecType, LangError>`
34-
|
35-
= help: the trait `Encode` is implemented for `Result<T, E>`
28+
--> tests/ui/contract/fail/message/message-returns-non-codec.rs:3:1
29+
|
30+
3 | #[ink::contract]
31+
| ^^^^^^^^^^^^^^^^ the trait `Encode` is not implemented for `Result<NonCodecType, LangError>`
32+
|
33+
= help: the trait `Encode` is implemented for `Result<T, E>`
3634
note: required by a bound in `return_value`
37-
--> $WORKSPACE/crates/env/src/api.rs
38-
|
39-
| pub fn return_value<R>(return_flags: ReturnFlags, return_value: &R)
40-
| ------------ required by a bound in this function
41-
| where
42-
| R: scale::Encode,
43-
| ^^^^^^^^^^^^^ required by this bound in `return_value`
35+
--> $WORKSPACE/crates/env/src/api.rs
36+
|
37+
| pub fn return_value<R>(return_flags: ReturnFlags, return_value: &R)
38+
| ------------ required by a bound in this function
39+
| where
40+
| R: scale::Encode,
41+
| ^^^^^^^^^^^^^ required by this bound in `return_value`
42+
= note: this error originates in the attribute macro `ink::contract` (in Nightly builds, run with -Z macro-backtrace for more info)
4443

45-
error[E0599]: the method `try_invoke` exists for struct `CallBuilder<DefaultEnvironment, Set<Call>, Set<ExecutionInput<ArgumentList<ArgumentListEnd, ArgumentListEnd, ScaleEncoding>, ScaleEncoding>>, Set<ReturnType<NonCodecType>>>`, but its trait bounds were not satisfied
44+
error[E0599]: the method `try_invoke` exists for struct `CallBuilder<DefaultEnvironment, Set<Call>, Set<ExecutionInput<ArgumentList<ArgumentListEnd, ArgumentListEnd, Ink>, Ink>>, Set<ReturnType<NonCodecType>>>`, but its trait bounds were not satisfied
4645
--> tests/ui/contract/fail/message/message-returns-non-codec.rs:18:9
4746
|
4847
6 | pub struct NonCodecType;
49-
| ----------------------- doesn't satisfy `NonCodecType: AbiDecodeWith<ScaleEncoding>`, `NonCodecType: DecodeMessageResult<ScaleEncoding>` or `NonCodecType: WrapperTypeDecode`
48+
| ----------------------- doesn't satisfy `NonCodecType: AbiDecodeWith<ink::abi::Ink>`, `NonCodecType: DecodeMessageResult<ink::abi::Ink>` or `NonCodecType: WrapperTypeDecode`
5049
...
5150
18 | / pub fn message(&self) -> NonCodecType {
5251
19 | | NonCodecType
@@ -60,9 +59,9 @@ error[E0599]: the method `try_invoke` exists for struct `CallBuilder<DefaultEnvi
6059
|
6160
= note: the following trait bounds were not satisfied:
6261
`Result<NonCodecType, LangError>: ink::parity_scale_codec::Decode`
63-
which is required by `NonCodecType: DecodeMessageResult<ScaleEncoding>`
62+
which is required by `NonCodecType: DecodeMessageResult<ink::abi::Ink>`
6463
`NonCodecType: WrapperTypeDecode`
65-
which is required by `NonCodecType: AbiDecodeWith<ScaleEncoding>`
64+
which is required by `NonCodecType: AbiDecodeWith<ink::abi::Ink>`
6665
note: the trait `WrapperTypeDecode` must be implemented
6766
--> $CARGO/parity-scale-codec-3.7.4/src/codec.rs
6867
|

crates/ink/tests/ui/contract/fail/trait/trait-message-selector-overlap-1.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ error[E0119]: conflicting implementations of trait `DispatchableMessageInfo<1083
77
43 | fn message(&self) {}
88
| ^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Contract`
99

10-
error[E0119]: conflicting implementations of trait `TraitCallForwarderFor<1083895717>` for type `contract::_::CallBuilder`
10+
error[E0119]: conflicting implementations of trait `TraitCallForwarderFor<1083895717>` for type `contract::_::CallBuilder<ink::abi::Ink>`
1111
--> tests/ui/contract/fail/trait/trait-message-selector-overlap-1.rs:41:5
1212
|
1313
36 | / impl TraitDefinition1 for Contract {
@@ -20,7 +20,7 @@ error[E0119]: conflicting implementations of trait `TraitCallForwarderFor<108389
2020
42 | | #[ink(message)]
2121
43 | | fn message(&self) {}
2222
44 | | }
23-
| |_____^ conflicting implementation for `contract::_::CallBuilder`
23+
| |_____^ conflicting implementation for `contract::_::CallBuilder<ink::abi::Ink>`
2424

2525
error[E0283]: type annotations needed
2626
--> tests/ui/contract/fail/trait/trait-message-selector-overlap-1.rs:19:1

crates/ink/tests/ui/contract/fail/trait/trait-message-selector-overlap-2.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ error[E0119]: conflicting implementations of trait `DispatchableMessageInfo<1518
77
43 | fn message(&self) {}
88
| ^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Contract`
99

10-
error[E0119]: conflicting implementations of trait `TraitCallForwarderFor<1518209067>` for type `contract::_::CallBuilder`
10+
error[E0119]: conflicting implementations of trait `TraitCallForwarderFor<1518209067>` for type `contract::_::CallBuilder<ink::abi::Ink>`
1111
--> tests/ui/contract/fail/trait/trait-message-selector-overlap-2.rs:41:5
1212
|
1313
36 | / impl TraitDefinition1 for Contract {
@@ -20,7 +20,7 @@ error[E0119]: conflicting implementations of trait `TraitCallForwarderFor<151820
2020
42 | | #[ink(message)]
2121
43 | | fn message(&self) {}
2222
44 | | }
23-
| |_____^ conflicting implementation for `contract::_::CallBuilder`
23+
| |_____^ conflicting implementation for `contract::_::CallBuilder<ink::abi::Ink>`
2424

2525
error[E0283]: type annotations needed
2626
--> tests/ui/contract/fail/trait/trait-message-selector-overlap-2.rs:19:1

crates/ink/tests/ui/contract/fail/trait/trait-message-selector-overlap-3.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ error[E0119]: conflicting implementations of trait `DispatchableMessageInfo<42>`
77
43 | fn message2(&self) {}
88
| ^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Contract`
99

10-
error[E0119]: conflicting implementations of trait `TraitCallForwarderFor<42>` for type `contract::_::CallBuilder`
10+
error[E0119]: conflicting implementations of trait `TraitCallForwarderFor<42>` for type `contract::_::CallBuilder<ink::abi::Ink>`
1111
--> tests/ui/contract/fail/trait/trait-message-selector-overlap-3.rs:41:5
1212
|
1313
36 | / impl TraitDefinition1 for Contract {
@@ -20,7 +20,7 @@ error[E0119]: conflicting implementations of trait `TraitCallForwarderFor<42>` f
2020
42 | | #[ink(message)]
2121
43 | | fn message2(&self) {}
2222
44 | | }
23-
| |_____^ conflicting implementation for `contract::_::CallBuilder`
23+
| |_____^ conflicting implementation for `contract::_::CallBuilder<ink::abi::Ink>`
2424

2525
error[E0283]: type annotations needed
2626
--> tests/ui/contract/fail/trait/trait-message-selector-overlap-3.rs:19:1

crates/ink/tests/ui/trait_def/fail/message_input_non_codec.stderr

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,18 @@ note: required by a bound in `ExecutionInput::<ArgumentList<ArgumentListEnd, Arg
3838
| T: AbiEncodeWith<Abi>,
3939
| ^^^^^^^^^^^^^^^^^^ required by this bound in `ExecutionInput::<ArgumentList<ArgumentListEnd, ArgumentListEnd, Abi>, Abi>::push_arg`
4040

41-
error[E0277]: the trait bound `ArgumentList<Argument<NonCodec>, ArgumentList<ArgumentListEnd, ArgumentListEnd, ScaleEncoding>, ScaleEncoding>: AbiEncodeWith<ScaleEncoding>` is not satisfied
41+
error[E0277]: the trait bound `ArgumentList<Argument<NonCodec>, ArgumentList<ArgumentListEnd, ArgumentListEnd, ink::abi::Ink>, ink::abi::Ink>: AbiEncodeWith<ink::abi::Ink>` is not satisfied
4242
--> tests/ui/trait_def/fail/message_input_non_codec.rs:5:5
4343
|
4444
5 | / #[ink(message)]
4545
6 | | fn message(&self, input: NonCodec);
4646
| |_______________________________________^ unsatisfied trait bound
4747
|
48-
= help: the trait `Encode` is not implemented for `ArgumentList<Argument<NonCodec>, ArgumentList<ArgumentListEnd, ArgumentListEnd, ScaleEncoding>, ScaleEncoding>`
48+
= help: the trait `Encode` is not implemented for `ArgumentList<Argument<NonCodec>, ArgumentList<ArgumentListEnd, ArgumentListEnd, ink::abi::Ink>, ink::abi::Ink>`
4949
= help: the following other types implement trait `Encode`:
50-
ArgumentList<Argument<Head>, Rest, ScaleEncoding>
51-
ArgumentList<ArgumentListEnd, ArgumentListEnd, ScaleEncoding>
52-
= note: required for `ArgumentList<Argument<NonCodec>, ArgumentList<ArgumentListEnd, ArgumentListEnd, ScaleEncoding>, ScaleEncoding>` to implement `AbiEncodeWith<ScaleEncoding>`
50+
ArgumentList<Argument<Head>, Rest, ink::abi::Ink>
51+
ArgumentList<ArgumentListEnd, ArgumentListEnd, ink::abi::Ink>
52+
= note: required for `ArgumentList<Argument<NonCodec>, ArgumentList<ArgumentListEnd, ArgumentListEnd, ink::abi::Ink>, ink::abi::Ink>` to implement `AbiEncodeWith<ink::abi::Ink>`
5353
note: required by a bound in `Execution::<Args, Output, Abi>::new`
5454
--> $WORKSPACE/crates/env/src/call/execution.rs
5555
|
@@ -59,7 +59,7 @@ note: required by a bound in `Execution::<Args, Output, Abi>::new`
5959
| pub fn new(input: ExecutionInput<Args, Abi>) -> Self {
6060
| --- required by a bound in this associated function
6161

62-
error[E0599]: the method `try_invoke` exists for struct `CallBuilder<E, Set<Call>, Set<ExecutionInput<ArgumentList<Argument<NonCodec>, ArgumentList<ArgumentListEnd, ArgumentListEnd, ScaleEncoding>, ScaleEncoding>, ScaleEncoding>>, Set<ReturnType<()>>>`, but its trait bounds were not satisfied
62+
error[E0599]: the method `try_invoke` exists for struct `CallBuilder<E, Set<Call>, Set<ExecutionInput<ArgumentList<Argument<NonCodec>, ArgumentList<ArgumentListEnd, ArgumentListEnd, Ink>, Ink>, Ink>>, Set<ReturnType<()>>>`, but its trait bounds were not satisfied
6363
--> tests/ui/trait_def/fail/message_input_non_codec.rs:5:5
6464
|
6565
5 | #[ink(message)]
@@ -70,8 +70,8 @@ error[E0599]: the method `try_invoke` exists for struct `CallBuilder<E, Set<Call
7070
::: $WORKSPACE/crates/env/src/call/execution.rs
7171
|
7272
| pub struct ArgumentList<Head, Rest, Abi> {
73-
| ---------------------------------------- doesn't satisfy `_: AbiEncodeWith<ScaleEncoding>` or `_: Encode`
73+
| ---------------------------------------- doesn't satisfy `_: AbiEncodeWith<Ink>` or `_: Encode`
7474
|
7575
= note: the following trait bounds were not satisfied:
76-
`ArgumentList<Argument<NonCodec>, ArgumentList<ArgumentListEnd, ArgumentListEnd, ScaleEncoding>, ScaleEncoding>: Encode`
77-
which is required by `ArgumentList<Argument<NonCodec>, ArgumentList<ArgumentListEnd, ArgumentListEnd, ScaleEncoding>, ScaleEncoding>: AbiEncodeWith<ScaleEncoding>`
76+
`ArgumentList<Argument<NonCodec>, ArgumentList<ArgumentListEnd, ArgumentListEnd, ink::abi::Ink>, ink::abi::Ink>: Encode`
77+
which is required by `ArgumentList<Argument<NonCodec>, ArgumentList<ArgumentListEnd, ArgumentListEnd, ink::abi::Ink>, ink::abi::Ink>: AbiEncodeWith<ink::abi::Ink>`

crates/ink/tests/ui/trait_def/fail/message_output_non_codec.stderr

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ error[E0277]: the trait bound `Result<NonCodec, LangError>: ink::parity_scale_co
3232
| |__________________________________^ the trait `ink::parity_scale_codec::Decode` is not implemented for `Result<NonCodec, LangError>`
3333
|
3434
= help: the trait `ink::parity_scale_codec::Decode` is implemented for `Result<T, E>`
35-
= note: required for `NonCodec` to implement `DecodeMessageResult<ScaleEncoding>`
35+
= note: required for `NonCodec` to implement `DecodeMessageResult<ink::abi::Ink>`
3636
note: required by a bound in `Execution::<Args, Output, Abi>::new`
3737
--> $WORKSPACE/crates/env/src/call/execution.rs
3838
|
@@ -42,7 +42,7 @@ note: required by a bound in `Execution::<Args, Output, Abi>::new`
4242
| pub fn new(input: ExecutionInput<Args, Abi>) -> Self {
4343
| --- required by a bound in this associated function
4444

45-
error[E0277]: the trait bound `NonCodec: AbiDecodeWith<ScaleEncoding>` is not satisfied
45+
error[E0277]: the trait bound `NonCodec: AbiDecodeWith<ink::abi::Ink>` is not satisfied
4646
--> tests/ui/trait_def/fail/message_output_non_codec.rs:5:5
4747
|
4848
5 | / #[ink(message)]
@@ -55,7 +55,7 @@ error[E0277]: the trait bound `NonCodec: AbiDecodeWith<ScaleEncoding>` is not sa
5555
Rc<T>
5656
sp_core::Bytes
5757
= note: required for `NonCodec` to implement `ink::parity_scale_codec::Decode`
58-
= note: required for `NonCodec` to implement `AbiDecodeWith<ScaleEncoding>`
58+
= note: required for `NonCodec` to implement `AbiDecodeWith<ink::abi::Ink>`
5959
note: required by a bound in `Execution::<Args, Output, Abi>::new`
6060
--> $WORKSPACE/crates/env/src/call/execution.rs
6161
|
@@ -65,11 +65,11 @@ note: required by a bound in `Execution::<Args, Output, Abi>::new`
6565
| pub fn new(input: ExecutionInput<Args, Abi>) -> Self {
6666
| --- required by a bound in this associated function
6767

68-
error[E0599]: the method `try_invoke` exists for struct `CallBuilder<E, Set<Call>, Set<ExecutionInput<ArgumentList<ArgumentListEnd, ArgumentListEnd, ScaleEncoding>, ScaleEncoding>>, Set<ReturnType<NonCodec>>>`, but its trait bounds were not satisfied
68+
error[E0599]: the method `try_invoke` exists for struct `CallBuilder<E, Set<Call>, Set<ExecutionInput<ArgumentList<ArgumentListEnd, ArgumentListEnd, Ink>, Ink>>, Set<ReturnType<NonCodec>>>`, but its trait bounds were not satisfied
6969
--> tests/ui/trait_def/fail/message_output_non_codec.rs:5:5
7070
|
7171
1 | pub struct NonCodec;
72-
| ------------------- doesn't satisfy `NonCodec: AbiDecodeWith<ScaleEncoding>`, `NonCodec: DecodeMessageResult<ScaleEncoding>` or `NonCodec: WrapperTypeDecode`
72+
| ------------------- doesn't satisfy `NonCodec: AbiDecodeWith<ink::abi::Ink>`, `NonCodec: DecodeMessageResult<ink::abi::Ink>` or `NonCodec: WrapperTypeDecode`
7373
...
7474
5 | #[ink(message)]
7575
| _____^
@@ -83,9 +83,9 @@ error[E0599]: the method `try_invoke` exists for struct `CallBuilder<E, Set<Call
8383
|
8484
= note: the following trait bounds were not satisfied:
8585
`Result<NonCodec, LangError>: ink::parity_scale_codec::Decode`
86-
which is required by `NonCodec: DecodeMessageResult<ScaleEncoding>`
86+
which is required by `NonCodec: DecodeMessageResult<ink::abi::Ink>`
8787
`NonCodec: WrapperTypeDecode`
88-
which is required by `NonCodec: AbiDecodeWith<ScaleEncoding>`
88+
which is required by `NonCodec: AbiDecodeWith<ink::abi::Ink>`
8989
note: the trait `WrapperTypeDecode` must be implemented
9090
--> $CARGO/parity-scale-codec-3.7.4/src/codec.rs
9191
|

0 commit comments

Comments
 (0)