Commit 087dba63 authored by Maurelian's avatar Maurelian

ctb: Split up burn tests

parent ba5742b5
...@@ -818,7 +818,11 @@ workflows: ...@@ -818,7 +818,11 @@ workflows:
requires: requires:
- bedrock-echidna-build - bedrock-echidna-build
- bedrock-echidna-run: - bedrock-echidna-run:
echidna_target: burn echidna_target: "burn:eth"
requires:
- bedrock-echidna-build
- bedrock-echidna-run:
echidna_target: "burn:gas"
requires: requires:
- bedrock-echidna-build - bedrock-echidna-build
- op-bindings-build: - op-bindings-build:
......
...@@ -3,9 +3,8 @@ pragma solidity 0.8.15; ...@@ -3,9 +3,8 @@ pragma solidity 0.8.15;
import { Burn } from "../libraries/Burn.sol"; import { Burn } from "../libraries/Burn.sol";
import { StdUtils } from "forge-std/Test.sol"; import { StdUtils } from "forge-std/Test.sol";
contract EchidnaFuzzBurn is StdUtils { contract EchidnaFuzzBurnEth is StdUtils {
bool failedEthBurn; bool failedEthBurn;
bool failedGasBurn;
/** /**
* @notice Takes an integer amount of eth to burn through the Burn library and * @notice Takes an integer amount of eth to burn through the Burn library and
...@@ -27,6 +26,15 @@ contract EchidnaFuzzBurn is StdUtils { ...@@ -27,6 +26,15 @@ contract EchidnaFuzzBurn is StdUtils {
} }
} }
function echidna_burn_eth() public view returns (bool) {
// ASSERTION: The amount burned should always match the amount passed exactly
return !failedEthBurn;
}
}
contract EchidnaFuzzBurnGas is StdUtils {
bool failedGasBurn;
/** /**
* @notice Takes an integer amount of gas to burn through the Burn library and * @notice Takes an integer amount of gas to burn through the Burn library and
* updates the contract state if at least that amount of gas was not burned * updates the contract state if at least that amount of gas was not burned
...@@ -54,11 +62,6 @@ contract EchidnaFuzzBurn is StdUtils { ...@@ -54,11 +62,6 @@ contract EchidnaFuzzBurn is StdUtils {
} }
} }
function echidna_burn_eth() public view returns (bool) {
// ASSERTION: The amount burned should always match the amount passed exactly
return !failedEthBurn;
}
function echidna_burn_gas() public view returns (bool) { function echidna_burn_gas() public view returns (bool) {
// ASSERTION: The amount of gas burned should be strictly greater than the // ASSERTION: The amount of gas burned should be strictly greater than the
// the amount passed as _value (minimum _value + whatever minor overhead to // the amount passed as _value (minimum _value + whatever minor overhead to
......
...@@ -39,7 +39,8 @@ ...@@ -39,7 +39,8 @@
"lint": "yarn lint:fix && yarn lint:check", "lint": "yarn lint:fix && yarn lint:check",
"typechain": "typechain --target ethers-v5 --out-dir dist/types --glob 'artifacts/!(build-info)/**/+([a-zA-Z0-9_]).json'", "typechain": "typechain --target ethers-v5 --out-dir dist/types --glob 'artifacts/!(build-info)/**/+([a-zA-Z0-9_]).json'",
"echidna:aliasing": "echidna-test --contract EchidnaFuzzAddressAliasing --config ./echidna.yaml .", "echidna:aliasing": "echidna-test --contract EchidnaFuzzAddressAliasing --config ./echidna.yaml .",
"echidna:burn": "echidna-test --contract EchidnaFuzzBurn --config ./echidna.yaml .", "echidna:burn:gas": "echidna-test --contract EchidnaFuzzBurnGas --config ./echidna.yaml .",
"echidna:burn:eth": "echidna-test --contract EchidnaFuzzBurnEth --config ./echidna.yaml .",
"echidna:encoding": "echidna-test --contract EchidnaFuzzEncoding --config ./echidna.yaml .", "echidna:encoding": "echidna-test --contract EchidnaFuzzEncoding --config ./echidna.yaml .",
"echidna:portal": "echidna-test --contract EchidnaFuzzOptimismPortal --config ./echidna.yaml .", "echidna:portal": "echidna-test --contract EchidnaFuzzOptimismPortal --config ./echidna.yaml .",
"echidna:hashing": "echidna-test --contract EchidnaFuzzHashing --config ./echidna.yaml .", "echidna:hashing": "echidna-test --contract EchidnaFuzzHashing --config ./echidna.yaml .",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment