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

Minor Chores #12

Merged
merged 6 commits into from
Apr 3, 2024
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
39 changes: 26 additions & 13 deletions .gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
PoolLensTest:testFuzz_GetPositions(int24,int24) (runs: 16, μ: 971375, ~: 998911)
PoolLensTest:test_GetPopulatedTicksInRange() (gas: 4109615)
PoolLensTest:test_GetPositions() (gas: 712285)
PoolLensTest:test_GetSlots() (gas: 3380493)
PoolLensTest:test_GetTickBitmap() (gas: 3092280)
PositionLensTest:testFuzz_GetPosition(uint256) (runs: 16, μ: 155236, ~: 155452)
PositionLensTest:test_AllPositions() (gas: 874498)
PositionLensTest:test_GetFeesOwed() (gas: 809236)
PositionLensTest:test_GetPositions() (gas: 1015301)
PositionLensTest:test_GetTotalAmounts() (gas: 825164)
StorageLensTest:testFuzz_extsload(bytes32) (runs: 16, μ: 11779, ~: 11779)
StorageLensTest:test_extsload() (gas: 40663)
TickLensTest:test_GetPopulatedTicksInRange() (gas: 10239511)
PCSV3PoolLensTest:testFuzz_GetPositions(int24,int24) (runs: 17, μ: 1274402, ~: 1320751)
PCSV3PoolLensTest:test_GetPopulatedTicksInRange() (gas: 495259)
PCSV3PoolLensTest:test_GetPositions() (gas: 1231579)
PCSV3PoolLensTest:test_GetSlots() (gas: 148865)
PCSV3PoolLensTest:test_GetTickBitmap() (gas: 3140056)
PCSV3PositionLensTest:testFuzz_GetPosition(uint256) (runs: 17, μ: 263786, ~: 262928)
PCSV3PositionLensTest:test_AllPositions() (gas: 17634985)
PCSV3PositionLensTest:test_GetFeesOwed() (gas: 2770490)
PCSV3PositionLensTest:test_GetPositions() (gas: 1075793)
PCSV3PositionLensTest:test_GetTotalAmounts() (gas: 2774508)
PCSV3StorageLensTest:testFuzz_extsload(bytes32) (runs: 257, μ: 33505, ~: 33635)
PCSV3StorageLensTest:test_extsload() (gas: 63395)
PCSV3TickLensTest:test_GetPopulatedTicksInRange() (gas: 726747)
PoolLensTest:testFuzz_GetPositions(int24,int24) (runs: 17, μ: 1272927, ~: 1302846)
PoolLensTest:test_GetPopulatedTicksInRange() (gas: 4194371)
PoolLensTest:test_GetPositions() (gas: 1015456)
PoolLensTest:test_GetSlots() (gas: 3455641)
PoolLensTest:test_GetTickBitmap() (gas: 3155317)
PositionLensTest:testFuzz_GetPosition(uint256) (runs: 17, μ: 260687, ~: 260219)
PositionLensTest:test_AllPositions() (gas: 1027910)
PositionLensTest:test_GetFeesOwed() (gas: 2424302)
PositionLensTest:test_GetPositions() (gas: 839875)
PositionLensTest:test_GetTotalAmounts() (gas: 2436715)
StorageLensTest:testFuzz_extsload(bytes32) (runs: 17, μ: 33500, ~: 33635)
StorageLensTest:test_extsload() (gas: 63395)
TickLensTest:test_GetPopulatedTicksInRange() (gas: 10322483)
114 changes: 57 additions & 57 deletions .github/workflows/foundry.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
name: Foundry
on:
push:
branches:
- main
pull_request:
env:
FOUNDRY_PROFILE: ci
MAINNET_RPC_URL: ${{ secrets.MAINNET_RPC_URL }}
BNB_RPC_URL: ${{ secrets.BNB_RPC_URL }}
jobs:
check:
name: Forge Tests
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: "yarn"
cache-dependency-path: "yarn.lock"
- name: Install dependencies 📦
run: yarn install --frozen-lockfile
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Run Forge build
run: |
forge --version
forge build
id: build
- name: Run Forge tests on Ethereum mainnet
run: |
forge test -vvv
env:
CHAIN_ID: 1
id: testMainnet
- name: Run Forge tests on BNB mainnet
run: |
forge test -vvv
env:
CHAIN_ID: 56
id: testBNB
name: Foundry

on:
push:
branches:
- main
pull_request:

env:
FOUNDRY_PROFILE: ci
MAINNET_RPC_URL: ${{ secrets.MAINNET_RPC_URL }}
BNB_RPC_URL: ${{ secrets.BNB_RPC_URL }}

jobs:
check:
name: Forge Tests
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "yarn"
cache-dependency-path: "yarn.lock"

- name: Install dependencies 📦
run: yarn install --frozen-lockfile

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Run Forge build
run: |
forge --version
forge build
id: build

- name: Run Forge tests on Ethereum mainnet
run: |
forge test -vvv
env:
CHAIN_ID: 1
id: testMainnet

- name: Run Forge tests on BNB mainnet
run: |
forge test -vvv
env:
CHAIN_ID: 56
id: testBNB
8 changes: 4 additions & 4 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ jobs: # each workflow consists of 1+ jobs; by default, all jobs run in parallel
runs-on: ubuntu-latest # host's operating system
steps: # each job consists of 1+ steps
- name: Checkout commit # download the code from triggering commit
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Use Node.js 18.x
uses: actions/setup-node@v3
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 18.x
node-version: 20.x
cache: "yarn"
cache-dependency-path: "yarn.lock"

Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
npm_publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: '18.x'
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
scope: '@aperture_finance'

Expand All @@ -37,14 +37,14 @@ jobs:
cargo_publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Use Node.js 18.x
uses: actions/setup-node@v3
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 18.x
node-version: 20.x
cache: "yarn"
cache-dependency-path: "yarn.lock"

Expand Down
36 changes: 17 additions & 19 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Use Node.js 18.x
uses: actions/setup-node@v3
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 18.x
node-version: 20.x
cache: "yarn"
cache-dependency-path: "yarn.lock"

Expand All @@ -38,7 +38,7 @@ jobs:
run: forge bind -b src/bindings/ --module --overwrite

- name: Cache Cargo registry
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
Expand All @@ -48,30 +48,28 @@ jobs:
restore-keys: |
${{ runner.os }}-cargo-registry-

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: clippy
- name: Install Rust toolchain via rustup
run: |
rustup override set nightly
rustup component add clippy --toolchain nightly

- name: Check lint
run: cargo clippy -- -D warnings
- name: Check linting
run: cargo clippy --all-targets --all-features -- -D warnings

test:
needs: lint
name: Test
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Use Node.js 18.x
uses: actions/setup-node@v3
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 18.x
node-version: 20.x
cache: "yarn"
cache-dependency-path: "yarn.lock"

Expand All @@ -87,7 +85,7 @@ jobs:
run: forge bind -b src/bindings/ --module --overwrite

- name: Cache Cargo registry
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
Expand Down
Loading
Loading