Skip to content
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

feat: PrevRealm has the same behavior between MsgRun and MsgCall #1664

Closed
tbruyelle opened this issue Feb 17, 2024 · 2 comments · Fixed by #1719
Closed

feat: PrevRealm has the same behavior between MsgRun and MsgCall #1664

tbruyelle opened this issue Feb 17, 2024 · 2 comments · Fixed by #1719

Comments

@tbruyelle
Copy link
Contributor

tbruyelle commented Feb 17, 2024

Currently, if PrevRealm is called directly in the context of MsgRun, it returns the user realm instead of the user address as in MsgCall.

@grepsuzette
Copy link
Contributor

Think that's the case inside filetests.
In my test PrevRealm().Address is not the same as std.TestSetOrigCaller(<addr>)

@tbruyelle
Copy link
Contributor Author

Think that's the case inside filetests. In my test PrevRealm().Address is not the same as std.TestSetOrigCaller(<addr>)

It should be the same if your PrevRealm() is directly called by the realm behind your test. If not, I'm interested to see your case, because that can be a bug.

tbruyelle added a commit to tbruyelle/gno that referenced this issue Mar 1, 2024
Fix gnolang#1664

As commented in the IsRealm() method, a better format of user realms
should emerge in the form of `gno.land/u/user_address`, which would
remove the confusion between standard realms and the realm forged under
the MsgRun transaction.
thehowl pushed a commit that referenced this issue May 23, 2024
Fix #1664

As commented in the IsRealm() method, a better format of user realms
should emerge in the form of `gno.land/u/user_address`, which would
remove the confusion between standard realms and the realm forged under
the MsgRun transaction.

BREAKING CHANGE: `std.PrevRealm` is not returning the user realm any
more when invoked under a transaction broadcasted by `MsgRun`.

To run the txtar test:
```
$ go test ./gno.land/cmd/gnoland/ -v -run TestTestdata/prevrealm
```

<!-- please provide a detailed description of the changes made in this
pull request. -->

<details><summary>Contributors' checklist...</summary>

- [x] Added new tests, or not needed, or not feasible
- [ ] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [ ] 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
- [x] Provided any useful hints for running manual tests
- [ ] Added new benchmarks to [generated
graphs](https://gnoland.github.io/benchmarks), if any. More info
[here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md).
</details>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

2 participants