-
Notifications
You must be signed in to change notification settings - Fork 373
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
In filetests, PrevRealm().Address is std.GetOrigPkgAddr(), instead of std.TestSetOrigCaller's #1704
Comments
I added a (passing) filetest for So it's likely something special in above filetest that makes the present issue fail. Quite probably those lines:
Are they wrong or something? Edit: Line 151 in b965e5e
Schematically we do in the case of an explicitely named package: // save package using realm crawl procedure.
memPkg := &std.MemPackage{ Name: string(pkgName), Path: pkgPath, Files: []*std.MemFile{{Name: "main.gno", Body: string(bz) }}}
// run decls and init functions.
m.RunMemPackage(memPkg, true)
m.PreprocessAllFilesAndSaveBlockNodes()
pv2 := store.GetPackage(pkgPath, false)
m.SetActivePackage(pv2)
m.RunMain() theory 2Or maybe it's because in this example we have gno/gnovm/pkg/gnolang/machine.go Lines 188 to 194 in b965e5e
|
Workaround Get rid of line:
Use |
So yes, you got it. When you add a realm path (something that starts with I invite you to add a |
Done! Closing here. Thanks for your reply. |
PrevRealm was tested from `gno/examples/gno.land/r/demo/tests/tests_test.gnotest`. As far as I can see in r/demo/tests however, it was not tested for *filetests*. Although `gno test .` passes, depending on whether #1704 is confirmed, there may be more filetests to add in this folder (in a different PR I guess). --------- Co-authored-by: grepsuzette <[email protected]> Co-authored-by: Morgan <[email protected]>
A potential bug, based on what @tbruyelle said in #1664 and what I read about
PrevRealm()
.Description
Happens with a filetest:
*a.gno
a_filetest.gno
Expected
So we print 3 lines:
Would expect
qwerty.Address()
to be equal todude
.But instead,
qwerty.Address()
is equal tostd.GetOrigPkgAddr()
.Note: calling
std.TestSetOrigCaller(dude)
does not help either.qwerty.Address()
will still return the address of "the filetest realm address" before it got modified todude
's address.The text was updated successfully, but these errors were encountered: