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

evm-contracts: Use forge-std instead of excerpted files #315

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "packages/contracts/evm-contracts/lib/forge-std"]
path = packages/contracts/evm-contracts/lib/forge-std
url = https://github.com/foundry-rs/forge-std
Comment on lines +1 to +3
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there no other way to do this? Submodules are always an absolute nightmare to work with

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the default way forge is installed, but... I guess we could replace the submodule with the files directly

Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any downside to the approach we had before where things are inline? I would prefer that over having to update every build tool going forward to support submodules

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've ran into a few missing functions in the inline files, and I wasn't able to get them working just by adding them there. That's why I wanted to refactor into properly using forge-std. But in the end it is not a must-have, and if this would produce more problems than benefits, I'm fine with sunsetting this PR.

2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
contract-types/
packaged/
packages/engine/paima-rest/src/tsoa/routes.ts
packages/contracts/evm-contracts/test-lib
packages/contracts/evm-contracts/lib
packages/contracts/evm-contracts/typechain-types
4 changes: 2 additions & 2 deletions packages/contracts/evm-contracts/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
src = 'contracts' # the source directory
test = 'test' # the test directory
out = 'artifacts/forge' # the output directory (for artifacts)
libs = ['test-lib'] # a list of library directories
libs = ['lib'] # a list of library directories
remappings = [ # a list of remappings
'@openzeppelin/=../../../node_modules/@openzeppelin/',
'@openzeppelin/=../../../node_modules/@openzeppelin/'
]
cache_path = 'cache/forge'
allow_paths = ["../../../node_modules"]
Expand Down
1 change: 1 addition & 0 deletions packages/contracts/evm-contracts/lib/forge-std
Submodule forge-std added at 155d54
84 changes: 0 additions & 84 deletions packages/contracts/evm-contracts/test-lib/cheatcodes.sol

This file was deleted.

Loading