Allow pay_with_call to take multiple arguments#1401
Merged
Conversation
Contributor
Author
|
Looks like Codecov is broken on |
agryaznov
reviewed
Sep 20, 2022
agryaznov
approved these changes
Sep 20, 2022
| 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); |
Contributor
There was a problem hiding this comment.
Suggested change
| 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
Contributor
Author
There was a problem hiding this comment.
I don't get what you mean here, can you clarify?
Contributor
There was a problem hiding this comment.
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
Merged
Merged
agryaznov
pushed a commit
that referenced
this pull request
Oct 18, 2022
agryaznov
added a commit
that referenced
this pull request
Oct 20, 2022
* 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>
Merged
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
We were using the wrong metavariable when accepting function arguments to the
pay_with_callmacro, as reported here.