Skip to content

Commit

Permalink
Merge branch 'main' of github.com:morpho-labs/morpho-blue-metamorpho …
Browse files Browse the repository at this point in the history
…into test/deposit-withdraw-tests
  • Loading branch information
Rubilmax committed Sep 12, 2023
2 parents b860e60 + 2e1c7cc commit 6df4999
Show file tree
Hide file tree
Showing 13 changed files with 456 additions and 717 deletions.
56 changes: 4 additions & 52 deletions .github/workflows/foundry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ jobs:
out
key: forge-${{ github.ref_name }}

test-local:
test:
needs: build-no-ir

name: Local tests
name: Tests
runs-on: ubuntu-latest

strategy:
Expand Down Expand Up @@ -105,59 +105,11 @@ jobs:

- uses: ./.github/actions/install-cache

- name: Run local tests in ${{ matrix.type }} mode
run: yarn test:forge:local
- name: Run tests in ${{ matrix.type }} mode
run: yarn test:forge
env:
FOUNDRY_FUZZ_RUNS: ${{ matrix.fuzz-runs }}
FOUNDRY_FUZZ_MAX_TEST_REJECTS: ${{ matrix.max-test-rejects }}
FOUNDRY_INVARIANT_RUNS: ${{ matrix.invariant-runs }}
FOUNDRY_INVARIANT_DEPTH: ${{ matrix.invariant-depth }}
FOUNDRY_FUZZ_SEED: 0x${{ github.event.pull_request.base.sha || github.sha }}

test-mainnet:
needs: build-no-ir

name: Ethereum tests
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
type: ["slow", "fast"]
include:
- type: "slow"
fuzz-runs: 1024
max-test-rejects: 65536
invariant-runs: 64
invariant-depth: 1024
- type: "fast"
fuzz-runs: 256
max-test-rejects: 65536
invariant-runs: 16
invariant-depth: 256

steps:
- name: Generate a token
id: generate-token
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}

- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ steps.generate-token.outputs.token }}
submodules: recursive

- uses: ./.github/actions/install-cache

- name: Run mainnet tests in ${{ matrix.type }} mode
run: yarn test:forge:mainnet
env:
ALCHEMY_KEY: ${{ secrets.ALCHEMY_KEY }}
FOUNDRY_FUZZ_RUNS: ${{ matrix.fuzz-runs }}
FOUNDRY_FUZZ_MAX_TEST_REJECTS: ${{ matrix.max-test-rejects }}
FOUNDRY_INVARIANT_RUNS: ${{ matrix.invariant-runs }}
FOUNDRY_INVARIANT_DEPTH: ${{ matrix.invariant-depth }}
FOUNDRY_FUZZ_SEED: 0x${{ github.event.pull_request.base.sha || github.sha }}
2 changes: 1 addition & 1 deletion contracts/SupplyVault.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity 0.8.19;
pragma solidity 0.8.21;

import {IMorphoMarketParams} from "./interfaces/IMorphoMarketParams.sol";
import {MarketAllocation, Pending, ISupplyVault} from "./interfaces/ISupplyVault.sol";
Expand Down
2 changes: 1 addition & 1 deletion lib/morpho-blue
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@
"scripts": {
"prepare": "husky install",
"postinstall": "forge install",
"build:ts": "yarn build:hardhat && tsc --build ./tsconfig.build.json",
"build:ts": "tsc --build ./tsconfig.build.json",
"build:forge": "FOUNDRY_PROFILE=build forge build",
"build:hardhat": "npx hardhat compile",
"build:blue": "cd lib/morpho-blue/ && yarn build:forge && cd ../..",
"typecheck": "tsc --noEmit",
"test:forge": "yarn build:blue && FOUNDRY_PROFILE=test forge test",
"test:forge:local": "FOUNDRY_MATCH_CONTRACT=LocalTest yarn test:forge",
"test:forge:mainnet": "FOUNDRY_MATCH_CONTRACT=EthereumTest yarn test:forge",
"test:hardhat": "yarn build:blue && npx hardhat test",
"lint": "yarn lint:forge && yarn lint:ts",
"lint:ts": "prettier --check src test/hardhat",
Expand Down
134 changes: 0 additions & 134 deletions test/forge/BaseTest.sol

This file was deleted.

Loading

0 comments on commit 6df4999

Please sign in to comment.