-
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
Implement seal_is_contract
and seal_caller_is_origin
#1129
Conversation
…act with self.env()
and
seal_caller_is_origin`seal_is_contract
and seal_caller_is_origin
Hmm, I didn't notice the initial PR in the substrate so I didn't comment there. But maybe better to implement the function that returns |
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 looks like it works, but needs a bit of cleanup
3d71b32
to
02ca62a
Compare
02ca62a
to
5617aeb
Compare
@HCastano thanks for your review! Here comes the cleaned-up version |
Some notes:
|
I think we should have both functions. |
Agree. When is possible we will use cheaper |
Please do fix any |
But I think the node version used might be too old if the new features are used in the examples? How do I update the node there? It appears to be installed in the CI image? |
The |
@agryaznov You should see the CI output if you click on "Details" right of the failed jobs. You can also reproduce it locally, this list here should give some hints: /~https://github.com/paritytech/ink/blob/master/CONTRIBUTING.md#checklist (it might be a bit outdated though, so better ask before trying to figure out why something isn't working). |
Is it build with |
Yup: /~https://github.com/paritytech/substrate-contracts-node/blob/main/runtime/Cargo.toml#L58-L63. |
This reverts commit a40fab1.
Codecov Report
@@ Coverage Diff @@
## master #1129 +/- ##
=======================================
Coverage 78.69% 78.69%
=======================================
Files 252 252
Lines 9395 9395
=======================================
Hits 7393 7393
Misses 2002 2002
Continue to review full report at Codecov.
|
🦑 📈 ink! Example Contracts ‒ Changes Report 📉 🦑These are the results when building the
Link to the run | Last update: Wed Feb 23 12:27:29 CET 2022 |
CI issues seem to be fixed now. |
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've got only some nitpicks, looks good besides that, we can merge after those are fixed.
Could you click "Resolve conversation" for the comments by reviewers which were resolved? That makes it easier to follow what's going on. Thanks!
Co-authored-by: Michael Müller <mich@elmueller.net>
…mental_off_chain eingine
Will take a look at this again today, sorry! |
I'm not sure why ink-waterfall ci now fails. It began to fall with an error starting from this commit which changes nothing apart from comment typos. |
It's not your fault, it's because we currently don't use fixed nightly versions anywhere in CI. Since yesterday the Rust nightly version contains a bug which makes For this PR we can ignore the |
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.
Nice, thanks!
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.
Couple small things, but looks good!
My take on resolving comments: as a reviewer I want to be the one to mark comments as resolved. That way I'm able to get a refresher on what comments I've made, and judge whether or not they were actually resolved correctly
/// pub fn is_contract(&mut self, account_id: AccountId) -> bool { | ||
/// self.env().is_contract(&account_id) | ||
/// } |
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.
/// pub fn is_contract(&mut self, account_id: AccountId) -> bool { | |
/// self.env().is_contract(&account_id) | |
/// } | |
/// pub fn is_contract(&mut self, account_id: &AccountId) -> bool { | |
/// self.env().is_contract(account_id) | |
/// } |
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.
Hm, no, this won't work as Ink messages can't take references as params.
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>
The other tests need to be green, though :) |
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.
LGTM. You can merge once the CI is green.
Follow-up for paritytech/substrate#10789.
Needed for #804.