Skip to content

Commit

Permalink
chore(gas-report): update to use --json output for gas-report
Browse files Browse the repository at this point in the history
  • Loading branch information
3esmit committed Nov 12, 2024
1 parent e9126b9 commit a60a6c7
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 20 deletions.
18 changes: 0 additions & 18 deletions .gas-report

This file was deleted.

34 changes: 34 additions & 0 deletions .gas-report.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[
{
"contract" : "script/Deploy.s.sol:Deploy",
"deployment" : {
"gas" : 416048,
"size" : 2733
},
"functions" : {
"run()" : {
"calls" : 1,
"max" : 245006,
"mean" : 245006,
"median" : 245006,
"min" : 245006
}
}
},
{
"contract" : "src/Foo.sol:Foo",
"deployment" : {
"gas" : 0,
"size" : 0
},
"functions" : {
"id(uint256)" : {
"calls" : 1,
"max" : 235,
"mean" : 235,
"median" : 235,
"min" : 235
}
}
}
]
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"lint:sol": "forge fmt --check && pnpm solhint {script,src,test,certora}/**/*.sol",
"prettier:check": "prettier --check **/*.{json,md,yml} --ignore-path=.prettierignore",
"prettier:write": "prettier --write **/*.{json,md,yml} --ignore-path=.prettierignore",
"gas-report": "forge snapshot --gas-report 2>&1 | (tee /dev/tty | awk '/Suite result:/ {found=1; buffer=\"\"; next} found && !/Ran/ {buffer=buffer $0 ORS} /Ran/ {found=0} END {printf \"%s\", buffer}' > .gas-report)",
"gas-report": "forge snapshot --gas-report --json | tee .gas-report.tmp | awk 'NR<2' | json_pp > .gas-report.json && tail +4 .gas-report.tmp && rm .gas-report.tmp",
"release": "commit-and-tag-version",
"adorno": "pnpm prettier:write && forge fmt && pnpm gas-report"
}
}
}

0 comments on commit a60a6c7

Please sign in to comment.