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

chore(tests): different address on test caller #662

Merged
merged 2 commits into from
Apr 4, 2023

Conversation

albttx
Copy link
Member

@albttx albttx commented Mar 28, 2023

Description

A lot of our currents works needs to make a difference on the pkg address and the caller address, this PR fix this.

@albttx albttx requested a review from a team as a code owner March 28, 2023 14:50
@albttx albttx force-pushed the albttx/tests-addr-for-pkg branch 3 times, most recently from 655312f to 799c9fb Compare March 28, 2023 18:52
@albttx albttx self-assigned this Apr 3, 2023
Copy link
Member

@zivkovicmilos zivkovicmilos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 💯

Is the reasoning behind this PR that we want to explicitly manage the address of the caller in tests, that's why we fixate it to user1.gno?

Please resolve the merge conflicts, and we should be good to go 🙏

tests/file.go Outdated Show resolved Hide resolved
albttx and others added 2 commits April 4, 2023 14:40
fix stdlibs tests

Co-authored-by: Thomas Bruyelle <[email protected]>
fix(tests): gno.land/r/demo/boards

fix(tests): gno.land/r/demo/
@albttx albttx force-pushed the albttx/tests-addr-for-pkg branch from 799c9fb to ca99f96 Compare April 4, 2023 12:41
@albttx
Copy link
Member Author

albttx commented Apr 4, 2023

Is the reasoning behind this PR that we want to explicitly manage the address of the caller in tests, that's why we fixate it to user1.gno?

Yes, working on other PR require me to have a different address for the caller than the package

@albttx
Copy link
Member Author

albttx commented Apr 4, 2023

rebased

@moul moul merged commit 721bfc3 into gnolang:master Apr 4, 2023
@piux2
Copy link
Contributor

piux2 commented Apr 5, 2023

Why do we make a change here? the hard coded "user1.gno". The caller becomes hard-coded as "user1.gno"; we can no longer pass in pkgPath as a caller from RunFileTest anymore

caller := gno.DerivePkgAddr("user1.gno")

The entire "main" package address is changed.

pkgPath = "main"

@albttx
Copy link
Member Author

albttx commented Apr 5, 2023

@piux2 this was "impossible" before.

Ok, with tests you were able to set a "caller", But in "reality" the only way to get it was using GetOrigCaller which would never be a package but a end user.

This is a preparation for GetCaller ( #667 ) and TestSetCaller is coming too :)

grepsuzette pushed a commit to grepsuzette/gno that referenced this pull request Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants