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.
Adds script for generating
Vm.vy
file which can be used to access cheatcodes from Vyper tests.Current version of the script produces correct interface which can be compiled and imported, however marking as wip because of the following concerns:
lib/forge-std
then there is basically no way of importing it from user's project (It could've been something likefrom lib.forge-std.src import Vm
, but-
is disallowed in import directives). Vyper 0.4 addedsearch_paths
config option, so we should be able to support this for 0.4+.enum
is deprecated in favor of identicalflag
in Vyper 0.4. If we useflag
, then Vm.vy will only compile on 0.4+, but if we useenum
, a bunch of deprectation warnings will be emitted for 0.4+One thing I've though about is that we could just keep two versions of
Vm.vy
and inject them under some path likeforge_builtins/Vm.vy
depending on the current compiler version. This gives us ability to inject different interfaces when compiling 0.3 and 0.4, and source will always be available throughfrom forge_builtings import Vm
, without the need for user to care about import resolution.Such approach should work for Vm.sol as well, allowing us to keep entire interface in the forge binary itself and removing the need for users to wait for forge-std release to use new cheatcodes.
cc @DaniPopes @mattsse @mds1