Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Set up environment
uses: ./.github/actions/setup
- name: Test
run: yarn test:forge
run: yarn test:forge-with-hardhat

test-hardhat:
runs-on: ubuntu-latest
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@
"lint:solidity": "npx prettier --check --plugin=prettier-plugin-solidity 'contracts/**/*.sol' ''test/**/*.sol'' && npx solhint 'contracts/**/*.sol'",
"lint:typescript": "NODE_NO_WARNINGS=1 eslint --ext .ts --ignore-path ./.eslintignore --max-warnings 0",
"prettier": "npx prettier --write --plugin=prettier-plugin-solidity 'contracts/**/*.sol' 'test/**/*.sol'",
"test": "yarn test:hardhat && yarn test:forge",
"test": "yarn test:forge",
"test:hardhat": "hardhat test",
"test:forge": "yarn build && REUSING_HARDHAT_ARTIFACTS=true forge test --ffi -vvv",
"test:forge": "forge test --ffi -vvv",
"test:forge-with-hardhat": "yarn build && REUSING_HARDHAT_ARTIFACTS=true forge test --ffi -vvv",
"coverage": "./coverage.sh forge",
"coverage:hardhat": "./coverage.sh hardhat",
"coverage:all": "./coverage.sh all"
Expand Down
19 changes: 18 additions & 1 deletion test/foundry/utils/BaseAngstromTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import { AngstromBalancer } from "../../../contracts/AngstromBalancer.sol";
contract BaseAngstromTest is BaseVaultTest {
using ArrayHelpers for *;

string private artifactsRootDir = "artifacts/";

AngstromBalancerMock internal angstromBalancer;

bytes internal aliceSignature;
Expand All @@ -33,7 +35,18 @@ contract BaseAngstromTest is BaseVaultTest {
}

function createHook() internal override returns (address) {
angstromBalancer = new AngstromBalancerMock(vault, weth, permit2, "AngstromBalancer Mock v1");
if (reusingArtifacts) {
angstromBalancer = AngstromBalancerMock(
payable(
deployCode(
_computeAngstromBalancerTestPath(type(AngstromBalancerMock).name),
abi.encode(vault, weth, permit2, "AngstromBalancer Mock v1")
)
)
);
} else {
angstromBalancer = new AngstromBalancerMock(vault, weth, permit2, "AngstromBalancer Mock v1");
}
authorizer.grantRole(angstromBalancer.getActionId(AngstromBalancer.toggleNodes.selector), admin);

return address(angstromBalancer);
Expand All @@ -59,4 +72,8 @@ contract BaseAngstromTest is BaseVaultTest {
signature = abi.encodePacked(r, s, v);
userData = abi.encodePacked(signer, signature);
}

function _computeAngstromBalancerTestPath(string memory name) private view returns (string memory) {
return string(abi.encodePacked(artifactsRootDir, "contracts/test/", name, ".sol/", name, ".json"));
}
}