-
Notifications
You must be signed in to change notification settings - Fork 480
Allow pay_with_call to take multiple arguments
#1401
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
Changes from 2 commits
161903b
9f5d01a
54eda38
3e977f9
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 | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,29 @@ | ||||||
| #[ink::contract] | ||||||
| mod contract { | ||||||
| #[ink(storage)] | ||||||
| pub struct Contract {} | ||||||
|
|
||||||
| impl Contract { | ||||||
| #[ink(constructor)] | ||||||
| pub fn new() -> Self { | ||||||
| Self {} | ||||||
| } | ||||||
|
|
||||||
| #[ink(message)] | ||||||
| pub fn message0(&self) {} | ||||||
|
|
||||||
| #[ink(message)] | ||||||
| pub fn message1(&self, _arg1: u8) {} | ||||||
|
|
||||||
| #[ink(message)] | ||||||
| pub fn message2(&self, _arg1: u8, _arg2: u8) {} | ||||||
|
|
||||||
| 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); | ||||||
HCastano marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| 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
Uh oh!
There was an error while loading. Please reload this page.