Skip to content

Commit

Permalink
test: fix foundry tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Schlagonia committed Aug 29, 2024
1 parent 56629eb commit 4cd962a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 29 deletions.
29 changes: 1 addition & 28 deletions .github/workflows/foundry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,43 +19,16 @@ jobs:
- ubuntu-latest
architecture:
- "x64"
python-version:
- "3.10"
node_version:
- 16

steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}

- name: Install Ape
uses: ApeWorX/[email protected]
with:
python-version: '3.10'

- name: install vyper
run: pip install git+https://github.com/vyperlang/vyper

- name: Compile contracts
# Compile Ape contracts to get dependencies
run: ape compile --force --size


- name: Install Vyper
run: pip install vyper==0.3.7

- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ libs = ['lib']
remappings = [
'forge-std/=lib/forge-std/src/',
'erc4626-tests/=lib/erc4626-tests/',
"@tokenized-strategy=lib/tokenized-strategy/",
"@tokenized-strategy=lib/tokenized-strategy/src",
'@openzeppelin/=lib/openzeppelin-contracts/',
]
fs_permissions = [{ access = "read", path = "./"}]
Expand Down
18 changes: 18 additions & 0 deletions foundry_tests/tests/ERC4626Std.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,24 @@ contract VaultERC4626StdTest is ERC4626Test, Setup {
super.test_maxRedeem(init);
}

//Avoid special case for deposits of uint256 max
function test_previewDeposit(
Init memory init,
uint assets
) public override {
if (assets == type(uint256).max) assets -= 1;
super.test_previewDeposit(init, assets);
}

function test_deposit(
Init memory init,
uint assets,
uint allowance
) public override {
if (assets == type(uint256).max) assets -= 1;
super.test_deposit(init, assets, allowance);
}

function clamp(
Init memory init,
uint max
Expand Down

0 comments on commit 4cd962a

Please sign in to comment.