forked from gnolang/gno
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: attempt to improve OriginCall funcs
`AssertOriginCall` and `IsOriginCall` relies on the number of frames to determine if the function was called by a gno transaction (definition taken from `examples/gno.land/r/demo/banktest/README.md`). Since this number is different in the context of test and filetest, the 2 functions are overrided during test setup, but the override works only for filetest files and not for test files. This change makes `AssertOriginCall` and `IsOriginCall` to rely on message's signers instead of frames. If the message has at east one signer, we consider the function was called by a gno tx. As a result, the functions no longer needs to be overrided in test setup, and they work both for filetest files and test files. Fix gnolang#481
- Loading branch information
Showing
3 changed files
with
7 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters