-
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
Allow pay_with_call
to take multiple arguments
#1401
Conversation
Looks like Codecov is broken on |
fn check_compiles(&self) { | ||
ink::env::pay_with_call!(self.message0(), 0); | ||
ink::env::pay_with_call!(self.message1(0), 0); | ||
ink::env::pay_with_call!(self.message2(0, 0), 0); |
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::env::pay_with_call!(self.message2(0, 0), 0); | |
ink::env::pay_with_call!(self.message2(4*64, 0), 0); |
just to make sure it really works with expr; fun fact: it will compile regardless the value of the expr is out of bounds
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.
I don't get what you mean here, can you clarify?
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.
nevermind, just wanted to pass it a lil more interesting expr than just 0
; 4*64
evaluates to 256
which is out of u8
bounds; still this would compile, while passing just 256
- not
* Add `ink_env::pay_with_call!` helper macro for off-chain emulation of sending payments with contract msg calls (#1379) * first ver.: transfer_in api function implememted but we can't have it in on-chain env * transfer_in moved to test_api * doc + example updated * Update examples/contract-transfer/lib.rs Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com> * use stmt moved to macro * docs and nitty gritties * moved the macro to the test mod * spell fix * next review round suggestions applied * Use four spaces for macro indentation Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com> * Allow `pay_with_call` to take multiple arguments (#1401) * Moved constants from `match` to a separate constants (#1418) * fix tests Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com> Co-authored-by: Andrew Jones <ascjones@gmail.com>
We were using the wrong metavariable when accepting function arguments to the
pay_with_call
macro, as reported here.