-
Notifications
You must be signed in to change notification settings - Fork 443
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 ink! message result return reverts #998
Conversation
Hide their docs since they are not meant to be used by ink! users.
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 works=)
); | ||
let result: #message_output = #message_callable(&mut contract, input); | ||
let failure = ::ink_lang::is_result_type!(#message_output) | ||
&& ::ink_lang::is_result_err!(&result); |
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.
&& ::ink_lang::is_result_err!(&result); | |
&& ::ink_lang::is_result_err!(result); |
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.
Thank you for the debugging help, @xgreenx !
On the downside of this PR is that it currently slightly increases the Wasm file sizes of some ink! smart contracts. E.g. ERC-20 raised from 28.9kB to 31.4kB in size. We might be able to find some optimizations to reduce this additional bloat. |
I was scratching my head trying to figure out why the ERC-20 on |
* add initiate_message and finalize_message utility codegen methods * make is_result_type and is_result_err usable from outside ink_lang Hide their docs since they are not meant to be used by ink! users. * use the new initiate_message and finalize_message in ink! codegen * remove deprecated execute_message utility method * apply rustfmt * fix clippy warnings * prevent Drop call for static storage * add missing docs * fix ui test * fix macro hygiene problem * fix bug * replace some #[inline(always)] with #[inline]
Fixes #985.
@xgreenx Please check if this fixes the problems for you.
Not yet optimized. Will do once we know for sure that this fix actually works.