Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Environment agnostic contract invocation API #2219

Merged
merged 37 commits into from
Apr 26, 2024
Merged
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
fca4e05
WIP ideas
ascjones Apr 8, 2024
840aa43
Add invocation
ascjones Apr 11, 2024
9c88b33
SP
ascjones Apr 11, 2024
e12d262
Warnings
ascjones Apr 11, 2024
081d718
WIP add info trait
ascjones Apr 16, 2024
6b500cf
Revert "WIP add info trait"
ascjones Apr 16, 2024
667ad39
WIP TraitCallBuilder
ascjones Apr 19, 2024
08da1a0
Revert "WIP TraitCallBuilder"
ascjones Apr 19, 2024
95b8591
Generate and wire up TraitMessageBuilder
ascjones Apr 19, 2024
56ce1a7
trait impl
ascjones Apr 22, 2024
ebde85d
Utilize message builder from call builder
ascjones Apr 22, 2024
19b4dca
Use type inference
ascjones Apr 22, 2024
53eb64d
Try to use new API...
ascjones Apr 22, 2024
d9ed700
Add storage deposit limit
ascjones Apr 23, 2024
cf1b94f
Add sandbox err message
ascjones Apr 23, 2024
bf06c85
Revert "Add sandbox err message"
ascjones Apr 23, 2024
9174a14
message_builder!
ascjones Apr 23, 2024
d198e6b
Invoker Error type
ascjones Apr 23, 2024
1a09074
Invoker -> Executor
ascjones Apr 23, 2024
e0a6d5e
Extract executor to separate file
ascjones Apr 24, 2024
ce6cbbe
Merge branch 'master' into aj/hybrid-ink-api
ascjones Apr 24, 2024
80d5f27
Access TraitCallBuilder from as-dependency call builder
ascjones Apr 24, 2024
a3f21ba
docs
ascjones Apr 24, 2024
054d415
executor ref and move message_builder to own file + docs
ascjones Apr 25, 2024
ae430f7
executor ref and move message_builder to own file + docs
ascjones Apr 25, 2024
574c253
remove message_builder
ascjones Apr 25, 2024
35e633d
message_builder docs
ascjones Apr 25, 2024
6f4022a
fix message_builder doc tests
ascjones Apr 25, 2024
2bacee0
remove conflicting message builder impl
ascjones Apr 25, 2024
0c9480b
fmt
ascjones Apr 25, 2024
75811af
UI tests
ascjones Apr 25, 2024
8753ded
docs
ascjones Apr 25, 2024
12e01c1
Merge branch 'master' into aj/hybrid-ink-api
ascjones Apr 25, 2024
caa0fce
update copypasta comments
ascjones Apr 25, 2024
0aea636
Merge branch 'master' into aj/hybrid-ink-api
ascjones Apr 26, 2024
a34849c
license headers
ascjones Apr 26, 2024
aa9e29f
CHANGELOG.md
ascjones Apr 26, 2024
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
Prev Previous commit
Next Next commit
UI tests
ascjones committed Apr 25, 2024
commit 75811af7af031c62d7d66a9dbd03a016aef97abc
Original file line number Diff line number Diff line change
@@ -55,7 +55,7 @@ error[E0277]: the trait bound `NonCodecType: WrapperTypeEncode` is not satisfied
&mut T
= note: required for `NonCodecType` to implement `Encode`
note: required by a bound in `ExecutionInput::<ArgumentList<ArgumentListEnd, ArgumentListEnd>>::push_arg`
--> $WORKSPACE/crates/env/src/call/execution_input.rs
--> $WORKSPACE/crates/env/src/call/execution.rs
|
| pub fn push_arg<T>(
| -------- required by a bound in this associated function
Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@ error[E0277]: the trait bound `NonCodecType: WrapperTypeEncode` is not satisfied
&mut T
= note: required for `NonCodecType` to implement `Encode`
note: required by a bound in `ExecutionInput::<ArgumentList<ArgumentListEnd, ArgumentListEnd>>::push_arg`
--> $WORKSPACE/crates/env/src/call/execution_input.rs
--> $WORKSPACE/crates/env/src/call/execution.rs
|
| pub fn push_arg<T>(
| -------- required by a bound in this associated function
@@ -65,7 +65,7 @@ error[E0599]: the method `try_invoke` exists for struct `CallBuilder<DefaultEnvi
16 | pub fn message(&self, _input: NonCodecType) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ method cannot be called due to unsatisfied trait bounds
|
::: $WORKSPACE/crates/env/src/call/execution_input.rs
::: $WORKSPACE/crates/env/src/call/execution.rs
|
| pub struct ArgumentList<Head, Rest> {
| ----------------------------------- doesn't satisfy `_: Encode`
Original file line number Diff line number Diff line change
@@ -40,14 +40,33 @@ error[E0277]: the trait bound `NonCodec: WrapperTypeEncode` is not satisfied
&mut T
= note: required for `NonCodec` to implement `Encode`
note: required by a bound in `ExecutionInput::<ArgumentList<ArgumentListEnd, ArgumentListEnd>>::push_arg`
--> $WORKSPACE/crates/env/src/call/execution_input.rs
--> $WORKSPACE/crates/env/src/call/execution.rs
|
| pub fn push_arg<T>(
| -------- required by a bound in this associated function
...
| T: scale::Encode,
| ^^^^^^^^^^^^^ required by this bound in `ExecutionInput::<ArgumentList<ArgumentListEnd, ArgumentListEnd>>::push_arg`

error[E0277]: the trait bound `ArgumentList<Argument<NonCodec>, ArgumentList<ArgumentListEnd, ArgumentListEnd>>: Encode` is not satisfied
--> tests/ui/trait_def/fail/message_input_non_codec.rs:5:5
|
5 | / #[ink(message)]
6 | | fn message(&self, input: NonCodec);
| |_______________________________________^ the trait `Encode` is not implemented for `ArgumentList<Argument<NonCodec>, ArgumentList<ArgumentListEnd, ArgumentListEnd>>`
|
= help: the following other types implement trait `Encode`:
ArgumentList<Argument<Head>, Rest>
ArgumentList<ArgumentListEnd, ArgumentListEnd>
note: required by a bound in `Execution::<Args, Output>::new`
--> $WORKSPACE/crates/env/src/call/execution.rs
|
| Args: scale::Encode,
| ^^^^^^^^^^^^^ required by this bound in `Execution::<Args, Output>::new`
...
| pub fn new(input: ExecutionInput<Args>) -> Self {
| --- required by a bound in this associated function

error[E0599]: the method `try_invoke` exists for struct `CallBuilder<E, Set<Call<E>>, Set<ExecutionInput<ArgumentList<Argument<NonCodec>, ...>>>, ...>`, but its trait bounds were not satisfied
--> tests/ui/trait_def/fail/message_input_non_codec.rs:5:5
|
@@ -56,7 +75,7 @@ error[E0599]: the method `try_invoke` exists for struct `CallBuilder<E, Set<Call
6 | | fn message(&self, input: NonCodec);
| |_______________________________________^ method cannot be called due to unsatisfied trait bounds
|
::: $WORKSPACE/crates/env/src/call/execution_input.rs
::: $WORKSPACE/crates/env/src/call/execution.rs
|
| pub struct ArgumentList<Head, Rest> {
| ----------------------------------- doesn't satisfy `_: Encode`
Original file line number Diff line number Diff line change
@@ -24,6 +24,27 @@ note: required by a bound in `DispatchOutput`
| T: scale::Encode + 'static;
| ^^^^^^^^^^^^^ required by this bound in `DispatchOutput`

error[E0277]: the trait bound `NonCodec: WrapperTypeDecode` is not satisfied
--> tests/ui/trait_def/fail/message_output_non_codec.rs:5:5
|
5 | / #[ink(message)]
6 | | fn message(&self) -> NonCodec;
| |__________________________________^ the trait `WrapperTypeDecode` is not implemented for `NonCodec`
|
= help: the following other types implement trait `WrapperTypeDecode`:
Box<T>
Rc<T>
Arc<T>
= note: required for `NonCodec` to implement `ink::parity_scale_codec::Decode`
note: required by a bound in `Execution::<Args, Output>::new`
--> $WORKSPACE/crates/env/src/call/execution.rs
|
| Output: scale::Decode,
| ^^^^^^^^^^^^^ required by this bound in `Execution::<Args, Output>::new`
...
| pub fn new(input: ExecutionInput<Args>) -> Self {
| --- required by a bound in this associated function

error[E0599]: the method `try_invoke` exists for struct `CallBuilder<E, Set<Call<E>>, Set<ExecutionInput<ArgumentList<ArgumentListEnd, ArgumentListEnd>>>, Set<ReturnType<NonCodec>>>`, but its trait bounds were not satisfied
--> tests/ui/trait_def/fail/message_output_non_codec.rs:5:5
|