Skip to content

Commit

Permalink
Speed up testing by turning off optimizer on dev mode (#272)
Browse files Browse the repository at this point in the history
running `yarn dev` in the root runs test in all projects in watch mode without optimizer, and running `yarn dev` in a project folder does it for that project
  • Loading branch information
oveddan authored Oct 17, 2023
1 parent 7a106c0 commit 49f971f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 24 deletions.
18 changes: 4 additions & 14 deletions packages/1155-contracts/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,15 @@ libs = ['_imagine', 'node_modules', 'script']
allow_paths = ["node_modules/@zoralabs/protocol-rewards"]
optimizer = true
optimizer_runs = 50
out = 'out'
solc_version = '0.8.17'
src = 'src'
via_ir = true

[profile.optimized]
optimizer = true
optimizer_runs = 50
out = 'out'
script = 'src'
solc_version = '0.8.17'
out = 'out'
src = 'src'
test = 'src'
via_ir = true

[profile.fast_compilation]
optimizer_runs = 50
[profile.dev]
optimizer = false
optimizer_runs = 0
via_ir = false
solc_version = '0.8.17'

[rpc_endpoints]
goerli = "https://eth-goerli.g.alchemy.com/v2/${ALCHEMY_KEY}"
Expand Down
2 changes: 1 addition & 1 deletion packages/1155-contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"type": "module",
"scripts": {
"test": "forge test",
"dev": "forge test --watch -vvv",
"dev": "FOUNDRY_PROFILE=dev forge test --watch -vvv",
"test:fork": "forge test -vvv --match-test fork",
"test-gas": "forge test --gas-report",
"prettier:check": "prettier --check 'src/**/*.sol' 'test/**/*.sol' 'package/**/*.ts' 'wagmi.config.ts'",
Expand Down
13 changes: 4 additions & 9 deletions packages/protocol-rewards/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,10 @@ script = 'script'
src = 'src'
via_ir = true

[profile.optimized]
auto_detect_solc = true
optimizer = true
optimizer_runs = 500000
out = 'out'
script = 'src'
src = 'src'
test = 'src'
via_ir = true
[profile.dev]
optimizer = false
optimizer_runs = 0
via_ir = false

[fmt]
bracket_spacing = true
Expand Down
1 change: 1 addition & 0 deletions packages/protocol-rewards/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"scripts": {
"build": "forge build",
"build:sizes": "forge build --sizes",
"dev": "FOUNDRY_PROFILE=dev forge test --watch -vvv",
"test": "forge test",
"build:contracts": "forge build",
"prettier:check": "prettier --check 'src/**/*.sol' 'test/**/*.sol' 'script/**/*.sol'",
Expand Down

0 comments on commit 49f971f

Please sign in to comment.