Skip to content

Commit

Permalink
merge main/add snaps
Browse files Browse the repository at this point in the history
  • Loading branch information
nishim3 committed Apr 8, 2024
2 parents 06bb849 + 126ec86 commit 08e3181
Show file tree
Hide file tree
Showing 72 changed files with 1,150 additions and 418 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
141181
139992
2 changes: 1 addition & 1 deletion .forge-snapshots/DynamicFees.swap_withDynamicFee.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
90176
89366
2 changes: 1 addition & 1 deletion .forge-snapshots/PoolManager.addLiquidity.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
145959
144743
Original file line number Diff line number Diff line change
@@ -1 +1 @@
265799
264566
2 changes: 1 addition & 1 deletion .forge-snapshots/PoolManager.addLiquidity_withNative.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
140642
139426
2 changes: 1 addition & 1 deletion .forge-snapshots/PoolManager.bytecodeSize.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
23026
22598
Original file line number Diff line number Diff line change
@@ -1 +1 @@
24938
24961
Original file line number Diff line number Diff line change
@@ -1 +1 @@
36611
36634
2 changes: 1 addition & 1 deletion .forge-snapshots/PoolManager.donate_gasWith1Token.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
101654
101137
2 changes: 1 addition & 1 deletion .forge-snapshots/PoolManager.donate_gasWith2Tokens.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
128667
132127
2 changes: 1 addition & 1 deletion .forge-snapshots/PoolManager.initialize.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
51819
51266
2 changes: 1 addition & 1 deletion .forge-snapshots/PoolManager.removeLiquidity.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
150224
148876
Original file line number Diff line number Diff line change
@@ -1 +1 @@
56574
55226
Original file line number Diff line number Diff line change
@@ -1 +1 @@
148760
147412
2 changes: 1 addition & 1 deletion .forge-snapshots/PoolManager.swap_againstLiquidity.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
60874
60138
Original file line number Diff line number Diff line change
@@ -1 +1 @@
72868
72132
2 changes: 1 addition & 1 deletion .forge-snapshots/PoolManager.swap_burn6909ForInput.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
80988
80315
Original file line number Diff line number Diff line change
@@ -1 +1 @@
76943
76165
Original file line number Diff line number Diff line change
@@ -1 +1 @@
139268
138660
2 changes: 1 addition & 1 deletion .forge-snapshots/PoolManager.swap_mintOutputAs6909.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
156077
155291
2 changes: 1 addition & 1 deletion .forge-snapshots/PoolManager.swap_simple.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
147285
146476
2 changes: 1 addition & 1 deletion .forge-snapshots/PoolManager.swap_simpleWithNative.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
133409
132600
2 changes: 1 addition & 1 deletion .forge-snapshots/PoolManager.swap_withHooks.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
60849
60113
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
155723
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5409
5407
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22506
22504
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5515
5513
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2592
2578
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2592
2578
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2592
2578
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2591
2556
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2900
2865
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2591
2556
1 change: 1 addition & 0 deletions .forge-snapshots/swap against liquidity.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
60135
1 change: 1 addition & 0 deletions .forge-snapshots/swap burn 6909 for input.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
80312
1 change: 1 addition & 0 deletions .forge-snapshots/swap burn native 6909 for input.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
76162
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
155723
89 changes: 89 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: code coverage

on:
pull_request:
branches:
- main

jobs:
comment-forge-coverage:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Install foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Run Forge build
run: |
forge --version
forge build --sizes
id: build
- name: Run forge coverage
id: coverage
run: |
{
echo 'COVERAGE<<EOF'
forge coverage | grep -v 'test/' | tail -n +6
echo EOF
} >> "$GITHUB_OUTPUT"
env:
FOUNDRY_RPC_URL: '${{ secrets.RPC_URL }}'

- name: Check coverage is updated
uses: actions/github-script@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const fs = require('fs');
const file = "coverage.txt"
if(!fs.existsSync(file)) {
console.log("Nothing to check");
return
}
const currentCoverage = fs.readFileSync(file, "utf8").trim();
const newCoverage = (`${{ steps.coverage.outputs.COVERAGE }}`).trim();
if (newCoverage != currentCoverage) {
core.setFailed(`Code coverage not updated. Run : forge coverage | grep -v 'test/' | tail -n +6 > coverage.txt`);
}
- name: Comment on PR
id: comment
uses: actions/github-script@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const {data: comments} = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
})
const botComment = comments.find(comment => comment.user.id === 41898282)
const output = `${{ steps.coverage.outputs.COVERAGE }}`;
const commentBody = `Forge code coverage:\n${output}\n`;
if (botComment) {
github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: botComment.id,
body: commentBody
})
} else {
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: commentBody
});
}
29 changes: 0 additions & 29 deletions src/Owned.sol

This file was deleted.

Loading

0 comments on commit 08e3181

Please sign in to comment.