-
Notifications
You must be signed in to change notification settings - Fork 374
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
chore: In r/demo/boards public API, change AssertOriginCall() to PrevRealm().IsUser() #2358
chore: In r/demo/boards public API, change AssertOriginCall() to PrevRealm().IsUser() #2358
Conversation
…Realm().IsUser() Signed-off-by: Jeff Thompson <jeff@thefirst.org>
@jefft0 can you please check why the tests are failing? 🙏 |
Hi @leohhhn . A test file is getting the new panic message "invalid non-user call" when calling the realm function. I don't understand. I thought that |
Signed-off-by: Jeff Thompson <jeff@thefirst.org>
Hi @leohhhn. I changed the test to |
Ideally we should work with just Due to the issue, right now I suggest going with your latest proposal, and iterating on this once we fix up the issues. |
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 until we fix the issues in the above comment
…() to PrevRealm().IsUser() (gnolang#2358) In r/demo/boards, `std.AssertOriginCall()` blocks calling the API from another realm. But it also prevents using MsgRun for testing as we do in PR gnolang#1583. Therefore, we change to check `std.PrevRealm().IsUser()`. This still blocks another realm from calling the code, but allows being [called by MsgRun](https://github.com/gnolang/gno/blob/d7f12167eff72cd4a12e9e8b8aaa30dc241bfb6c/misc/stress-test/stress-test-many-posts/main.go#L148-L156) where a user keypair sends the transaction. <details><summary>Contributors' checklist...</summary> - [x] Added new tests, or not needed, or not feasible - [x] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [x] Updated the official documentation or not needed - [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [x] Added references to related issues and PRs </details> --------- Signed-off-by: Jeff Thompson <jeff@thefirst.org> Co-authored-by: Leon Hudak <33522493+leohhhn@users.noreply.github.com>
In r/demo/boards,
std.AssertOriginCall()
blocks calling the API from another realm. But it also prevents using MsgRun for testing as we do in PR #1583. Therefore, we change to checkstd.PrevRealm().IsUser()
. This still blocks another realm from calling the code, but allows being called by MsgRun where a user keypair sends the transaction.Contributors' checklist...
BREAKING CHANGE: xxx
message was included in the description