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.
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: add std.PrevRealm #667
feat: add std.PrevRealm #667
Changes from all commits
12292de
7dbbd9b
4ce2d2f
13de845
970894e
5cf8a7b
09a600d
a6f7f6f
5d39021
73a41b9
e79361a
770cf31
68e3071
cb5ae15
98c7b05
93f8234
459db94
44f2b7b
d0dc76e
229545a
eb456c9
f8ac502
d228cbd
505a5c6
bb0d553
fb9245b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 understand why it needs to be empty. what happens without this line?
Maybe it's solved by the if-else chain i suggested above. it seemed like it was unnecessarily setting lastPkgPath before.
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.
std.Realm
return a Realm{}in the case we return a user, we want PkgPath to be empty.
Without this line, we could return a Realm containing a user address and
gno.land/r/demo/xxx
which is the "Current realm".This condition won't be present in the next function
std.Realm
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.
For accounts, it's a good idea to have an empty variable. However, if default realm implementation is desired later, it could change to
gno.land/r/moul
. What is the current value before erasing it?I like using
if PkgPath != ""
for distinction, similar toif err != nil
. We can update the method or choose a new variable when accounts have a path.Waiting for your response, but currently inclined to maintain the current behavior.
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.
Hi @moul I'm not sure i understand your question, but here is a better explanation
The Frames will be
so when we will finish the iteration loop, lastCaller will be
user1.gno
, and pkgPath will begno.land/r/moul/sayhi
, (frame[i].LastPackage.PkgPath
)So we use
if ctx.OrigCaller == lastCaller
to empty itIs it more clear ?
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 was asking what was the raw value before erasing it. Checking if it makes sense to be kept somehow.