-
Notifications
You must be signed in to change notification settings - Fork 449
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
Fix bugs in two examples + Fix master
CI
#820
Changes from 6 commits
09e8ec1
9b051d2
cca614b
690bbdd
2d4368c
3891d79
e61673a
9ed01e6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -484,15 +484,20 @@ mod multisig_plain { | |
|
||
/// Invoke a confirmed execution without getting its output. | ||
/// | ||
/// If the transaction which is invoked transfers value, this value has | ||
/// to be sent as payment with this call. The method will fail otherwise, | ||
/// and the transaction would then be reverted. | ||
/// | ||
/// Its return value indicates whether the called transaction was successful. | ||
/// This can be called by anyone. | ||
#[ink(message)] | ||
#[ink(message, payable)] | ||
cmichi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
pub fn invoke_transaction( | ||
&mut self, | ||
trans_id: TransactionId, | ||
) -> Result<(), Error> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As a side note: There is another issue with this method. It internally uses
which currently would not revert the transaction. This will only happen once we have implemented error forwarding. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah this is a very important point made and acts as yet another motivator to implement storage reversal on error for non- |
||
self.ensure_confirmed(trans_id); | ||
let t = self.take_transaction(trans_id).expect(WRONG_TRANSACTION_ID); | ||
assert!(self.env().transferred_balance() == t.transferred_value); | ||
let result = build_call::<<Self as ::ink_lang::ContractEnv>::Env>() | ||
.callee(t.callee) | ||
.gas_limit(t.gas_limit) | ||
|
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.
A better way was to introduce an
ink-debug
feature and forward that toink_env
.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.
So the problem with this approach is that
cargo-contract
builds with--no-default-features
. But there is a ticket to forward anink-debug
feature: use-ink/cargo-contract#284.But for now it means that if somebody builds
contract-transfer
withcargo-contract
right now we need to explicitly enable the feature forink_env
like done in this PR, otherwise the user will not see the debug output.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.
We should raise the priority of the
--debug
flag oncargo-contract
then.