-
Notifications
You must be signed in to change notification settings - Fork 431
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
Make CallBuilder
and CreateBuilder
error handling optional
#1602
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
947cf6c
Make default behaviour of `fire()` to return "raw" return value
HCastano 5ff7fee
Update delegate call codepath to give option to handle `EnvError`
HCastano 503fddb
Update `CreateBuilder::instantiate()`'s default cleaner as well
HCastano 48023ca
Add a breaking change note in the changelog
HCastano dbf7ac4
Fix delegator example
HCastano 72add05
Drive-by: rename `fire()` method to `invoke()`
HCastano 9819e76
Fix ERC-1155 example
HCastano ff759b4
Update `Multisig` example
HCastano 0d37811
Fix ContractRef tests
HCastano 155d416
Revert "Drive-by: rename `fire()` method to `invoke()`"
HCastano 22a924d
Use instantiate instead of `try_instantiate` in `delegator`
ascjones File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 50 additions & 50 deletions
100
crates/ink/tests/ui/trait_def/fail/message_input_non_codec.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,56 @@ | ||
error[E0277]: the trait bound `NonCodec: WrapperTypeDecode` is not satisfied | ||
--> tests/ui/trait_def/fail/message_input_non_codec.rs:6:23 | ||
| | ||
6 | fn message(&self, input: NonCodec); | ||
| ^^^^^ the trait `WrapperTypeDecode` is not implemented for `NonCodec` | ||
| | ||
= help: the following other types implement trait `WrapperTypeDecode`: | ||
Arc<T> | ||
Box<T> | ||
Rc<T> | ||
= note: required for `NonCodec` to implement `parity_scale_codec::Decode` | ||
--> tests/ui/trait_def/fail/message_input_non_codec.rs:6:23 | ||
| | ||
6 | fn message(&self, input: NonCodec); | ||
| ^^^^^ the trait `WrapperTypeDecode` is not implemented for `NonCodec` | ||
| | ||
= help: the following other types implement trait `WrapperTypeDecode`: | ||
Arc<T> | ||
Box<T> | ||
Rc<T> | ||
= note: required for `NonCodec` to implement `parity_scale_codec::Decode` | ||
note: required by a bound in `DispatchInput` | ||
--> src/codegen/dispatch/type_check.rs | ||
| | ||
| T: scale::Decode + 'static; | ||
| ^^^^^^^^^^^^^ required by this bound in `DispatchInput` | ||
--> src/codegen/dispatch/type_check.rs | ||
| | ||
| T: scale::Decode + 'static; | ||
| ^^^^^^^^^^^^^ required by this bound in `DispatchInput` | ||
|
||
error[E0277]: the trait bound `NonCodec: WrapperTypeEncode` is not satisfied | ||
--> tests/ui/trait_def/fail/message_input_non_codec.rs:3:1 | ||
| | ||
3 | #[ink::trait_definition] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `WrapperTypeEncode` is not implemented for `NonCodec` | ||
4 | pub trait TraitDefinition { | ||
5 | #[ink(message)] | ||
| - required by a bound introduced by this call | ||
| | ||
= help: the following other types implement trait `WrapperTypeEncode`: | ||
&T | ||
&mut T | ||
Arc<T> | ||
Box<T> | ||
Cow<'a, T> | ||
Rc<T> | ||
String | ||
Vec<T> | ||
parity_scale_codec::Ref<'a, T, U> | ||
= note: required for `NonCodec` to implement `Encode` | ||
--> tests/ui/trait_def/fail/message_input_non_codec.rs:3:1 | ||
| | ||
3 | #[ink::trait_definition] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `WrapperTypeEncode` is not implemented for `NonCodec` | ||
4 | pub trait TraitDefinition { | ||
5 | #[ink(message)] | ||
| - required by a bound introduced by this call | ||
| | ||
= help: the following other types implement trait `WrapperTypeEncode`: | ||
&T | ||
&mut T | ||
Arc<T> | ||
Box<T> | ||
Cow<'a, T> | ||
Rc<T> | ||
String | ||
Vec<T> | ||
parity_scale_codec::Ref<'a, T, U> | ||
= 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 | ||
| | ||
| T: scale::Encode, | ||
| ^^^^^^^^^^^^^ required by this bound in `ExecutionInput::<ArgumentList<ArgumentListEnd, ArgumentListEnd>>::push_arg` | ||
--> $WORKSPACE/crates/env/src/call/execution_input.rs | ||
| | ||
| T: scale::Encode, | ||
| ^^^^^^^^^^^^^ required by this bound in `ExecutionInput::<ArgumentList<ArgumentListEnd, ArgumentListEnd>>::push_arg` | ||
|
||
error[E0599]: the method `fire` exists for struct `CallBuilder<E, Set<Call<E>>, Set<ExecutionInput<ArgumentList<ink::ink_env::call::utils::Argument<NonCodec>, ArgumentList<ArgumentListEnd, ArgumentListEnd>>>>, Set<ReturnType<()>>>`, but its trait bounds were not satisfied | ||
--> tests/ui/trait_def/fail/message_input_non_codec.rs:5:5 | ||
| | ||
5 | #[ink(message)] | ||
| ^ method cannot be called on `CallBuilder<E, Set<Call<E>>, Set<ExecutionInput<ArgumentList<ink::ink_env::call::utils::Argument<NonCodec>, ArgumentList<ArgumentListEnd, ArgumentListEnd>>>>, Set<ReturnType<()>>>` due to unsatisfied trait bounds | ||
| | ||
::: $WORKSPACE/crates/env/src/call/execution_input.rs | ||
| | ||
| pub struct ArgumentList<Head, Rest> { | ||
| ----------------------------------- doesn't satisfy `_: Encode` | ||
| | ||
= note: the following trait bounds were not satisfied: | ||
`ArgumentList<ink::ink_env::call::utils::Argument<NonCodec>, ArgumentList<ArgumentListEnd, ArgumentListEnd>>: Encode` | ||
error[E0599]: the method `try_fire` exists for struct `CallBuilder<E, Set<Call<E>>, Set<ExecutionInput<ArgumentList<ink::ink_env::call::utils::Argument<NonCodec>, ArgumentList<ArgumentListEnd, ArgumentListEnd>>>>, Set<ReturnType<()>>>`, but its trait bounds were not satisfied | ||
--> tests/ui/trait_def/fail/message_input_non_codec.rs:5:5 | ||
| | ||
5 | #[ink(message)] | ||
| ^ method cannot be called on `CallBuilder<E, Set<Call<E>>, Set<ExecutionInput<ArgumentList<ink::ink_env::call::utils::Argument<NonCodec>, ArgumentList<ArgumentListEnd, ArgumentListEnd>>>>, Set<ReturnType<()>>>` due to unsatisfied trait bounds | ||
| | ||
::: $WORKSPACE/crates/env/src/call/execution_input.rs | ||
| | ||
| pub struct ArgumentList<Head, Rest> { | ||
| ----------------------------------- doesn't satisfy `_: Encode` | ||
| | ||
= note: the following trait bounds were not satisfied: | ||
`ArgumentList<ink::ink_env::call::utils::Argument<NonCodec>, ArgumentList<ArgumentListEnd, ArgumentListEnd>>: Encode` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just call
fire
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the only difference would be that the panic string includes extra info:
Not sure how useful that is though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I think it is useful. If we just
fire
the panic message will just point to the line within the call builder file. Without backtraces (which we don't have) it will be quite hard to find the line which paniced.