Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⬆️ Added foundry-storage-check #1281

Merged
merged 4 commits into from
Oct 19, 2022
Merged
Show file tree
Hide file tree
Changes from 3 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
53 changes: 30 additions & 23 deletions .github/workflows/ci-storage-layout-aave-v2.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,50 @@
name: Storage layout check (Morpho-Compound)
name: Storage layout checks

on:
push:
branches:
- main
- dev
pull_request:
paths:
- lib/**
- contracts/common/**
- contracts/aave-v2/**
- "*.lock"
- remappings.txt
- .github/actions/ci-storage-layout/*
- .github/workflows/ci-storage-layout-aave-v2.yml

jobs:
check:
name: storage layout check
morpho-aave-v2:
name: morpho-aave-v2
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- uses: actions/setup-node@v3
with:
node-version: 16
cache: yarn
- uses: actions/setup-node@v3
with:
node-version: 16
cache: yarn

- name: Install dependencies
run: yarn install --frozen-lockfile
shell: bash

- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Install Foundry
uses: onbjerg/foundry-toolchain@v1
with:
version: nightly

- name: Install Foundry
uses: onbjerg/foundry-toolchain@v1
- name: Check Morpho storage layout
uses: Rubilmax/foundry-storage-check@v2
with:
version: nightly
contract: contracts/aave-v2/Morpho.sol:Morpho

- name: Foundry fork cache
uses: actions/cache@v3
- name: Check RewardsManager storage layout
uses: Rubilmax/foundry-storage-check@v2
with:
path: |
cache
out
key: foundry-${{ hashFiles('Makefile', 'foundry.toml') }} # where fork block numbers & RPC are stored

- name: Run tests
run: make storage-layout-check
env:
PROTOCOL: aave-v2
contract: contracts/aave-v2/RewardsManager.sol:RewardsManager

53 changes: 30 additions & 23 deletions .github/workflows/ci-storage-layout-compound.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,50 @@
name: Storage layout check (Morpho-Compound)
name: Storage layout checks

on:
push:
branches:
- main
- dev
pull_request:
paths:
- lib/**
- contracts/common/**
- contracts/compound/**
- "*.lock"
- remappings.txt
- .github/actions/ci-storage-layout/*
- .github/workflows/ci-storage-layout-compound.yml

jobs:
check:
name: storage layout check
morpho-compound:
name: morpho-compound
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- uses: actions/setup-node@v3
with:
node-version: 16
cache: yarn
- uses: actions/setup-node@v3
with:
node-version: 16
cache: yarn

- name: Install dependencies
run: yarn install --frozen-lockfile
shell: bash

- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Install Foundry
uses: onbjerg/foundry-toolchain@v1
with:
version: nightly

- name: Install Foundry
uses: onbjerg/foundry-toolchain@v1
- name: Check Morpho storage layout
uses: Rubilmax/foundry-storage-check@v2
with:
version: nightly
contract: contracts/compound/Morpho.sol:Morpho

- name: Foundry fork cache
uses: actions/cache@v3
- name: Check RewardsManager storage layout
uses: Rubilmax/foundry-storage-check@v2
with:
path: |
cache
out
key: foundry-${{ hashFiles('Makefile', 'foundry.toml') }} # where fork block numbers & RPC are stored

- name: Run tests
run: make storage-layout-check
env:
PROTOCOL: compound
contract: contracts/compound/RewardsManager.sol:RewardsManager

6 changes: 0 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,6 @@ single-% s-%:
@echo Running single test $* of Morpho-${PROTOCOL} on "${NETWORK}" at block "${FOUNDRY_FORK_BLOCK_NUMBER}"
@forge test -vvv --match-test $* | tee trace.ansi

storage-layout-generate:
@./scripts/storage-layout.sh generate snapshots/.storage-layout-${PROTOCOL} Morpho RewardsManager Lens

storage-layout-check:
@./scripts/storage-layout.sh check snapshots/.storage-layout-${PROTOCOL} Morpho RewardsManager Lens

config:
@forge config

Expand Down
50 changes: 0 additions & 50 deletions scripts/storage-layout.sh

This file was deleted.