-
-
Notifications
You must be signed in to change notification settings - Fork 821
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
feat: support Panic
& custom contract errors
#57
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
fb167e2
feat: multicall + contract error cleanup
jxom b4a4d87
tests: fix
jxom 320c67a
feat: support Panic & custom contract errors
jxom 9c71b4b
ci: refactor actions
jxom 66e2744
Delete foundry.toml
jxom a3f9f6a
chore: changeset
jxom bf0ee4d
refactor
jxom File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"viem": patch | ||
--- | ||
|
||
support `Panic` & custom contract errors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: 'Setup' | ||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: pnpm/[email protected] | ||
with: | ||
version: ${{ matrix.pnpm-version }} | ||
- name: Set up Node ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
cache: 'pnpm' | ||
node-version: ${{ matrix.node-version }} | ||
- name: Cache pnpm | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.pnpm-store | ||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }} | ||
restore-keys: pnpm- | ||
- name: Cache node_modules | ||
uses: actions/cache@v3 | ||
id: cache-node-modules | ||
with: | ||
path: | | ||
dist | ||
node_modules | ||
playgrounds/**/node_modules | ||
site/node_modules | ||
key: modules-${{ hashFiles('pnpm-lock.yaml') }} | ||
- name: Install rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
target: wasm32-unknown-unknown | ||
profile: minimal | ||
override: true | ||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
- name: Install Dependencies | ||
shell: bash | ||
if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
run: pnpm i | ||
- name: Build Contracts | ||
shell: bash | ||
if: steps.cache-node-modules.outputs.cache-hit == 'true' | ||
run: pnpm contracts:build | ||
- name: Link Dependencies | ||
shell: bash | ||
if: steps.cache-node-modules.outputs.cache-hit == 'true' | ||
run: pnpm dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,36 +16,8 @@ jobs: | |
pnpm-version: [7] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: pnpm/[email protected] | ||
with: | ||
version: ${{ matrix.pnpm-version }} | ||
- name: Set up Node ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
cache: 'pnpm' | ||
node-version: ${{ matrix.node-version }} | ||
- name: Cache pnpm | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.pnpm-store | ||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }} | ||
restore-keys: pnpm- | ||
- name: Cache node_modules | ||
uses: actions/cache@v3 | ||
id: cache-node-modules | ||
with: | ||
path: | | ||
dist | ||
node_modules | ||
playgrounds/**/node_modules | ||
site/node_modules | ||
key: modules-${{ hashFiles('pnpm-lock.yaml') }} | ||
- name: Install Dependencies | ||
if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
run: pnpm i | ||
- name: Link Dependencies | ||
if: steps.cache-node-modules.outputs.cache-hit == 'true' | ||
run: pnpm dev | ||
- name: Setup | ||
uses: ./.github/actions/setup | ||
|
||
bench: | ||
name: Benchmark | ||
|
@@ -57,40 +29,8 @@ jobs: | |
pnpm-version: [7] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: pnpm/[email protected] | ||
with: | ||
version: ${{ matrix.pnpm-version }} | ||
- name: Set up Node ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
cache: 'pnpm' | ||
node-version: ${{ matrix.node-version }} | ||
- name: Cache node_modules | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
dist | ||
node_modules | ||
playgrounds/**/node_modules | ||
site/node_modules | ||
key: modules-${{ hashFiles('pnpm-lock.yaml') }} | ||
- name: Install rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
target: wasm32-unknown-unknown | ||
profile: minimal | ||
override: true | ||
- name: Install Anvil | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
- name: Launch Anvil | ||
run: anvil --fork-url $VITE_ANVIL_FORK_URL --fork-block-number $VITE_ANVIL_BLOCK_NUMBER --block-time $VITE_ANVIL_BLOCK_TIME & | ||
env: | ||
VITE_ANVIL_BLOCK_NUMBER: ${{ secrets.VITE_ANVIL_BLOCK_NUMBER }} | ||
VITE_ANVIL_BLOCK_TIME: ${{ secrets.VITE_ANVIL_BLOCK_TIME }} | ||
VITE_ANVIL_FORK_URL: ${{ secrets.VITE_ANVIL_FORK_URL }} | ||
- name: Setup | ||
uses: ./.github/actions/setup | ||
- name: Bench | ||
run: pnpm bench:ci | ||
env: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,36 +19,8 @@ jobs: | |
pnpm-version: [7] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: pnpm/[email protected] | ||
with: | ||
version: ${{ matrix.pnpm-version }} | ||
- name: Set up Node ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
cache: 'pnpm' | ||
node-version: ${{ matrix.node-version }} | ||
- name: Cache pnpm | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.pnpm-store | ||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }} | ||
restore-keys: pnpm- | ||
- name: Cache node_modules | ||
uses: actions/cache@v3 | ||
id: cache-node-modules | ||
with: | ||
path: | | ||
dist | ||
node_modules | ||
playgrounds/**/node_modules | ||
site/node_modules | ||
key: modules-${{ hashFiles('pnpm-lock.yaml') }} | ||
- name: Install Dependencies | ||
if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
run: pnpm i | ||
- name: Link Dependencies | ||
if: steps.cache-node-modules.outputs.cache-hit == 'true' | ||
run: pnpm dev | ||
- name: Setup | ||
uses: ./.github/actions/setup | ||
|
||
lint: | ||
name: Lint | ||
|
@@ -60,25 +32,8 @@ jobs: | |
pnpm-version: [7] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: pnpm/[email protected] | ||
with: | ||
version: ${{ matrix.pnpm-version }} | ||
- name: Set up Node ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
cache: 'pnpm' | ||
node-version: ${{ matrix.node-version }} | ||
- name: Cache node_modules | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
dist | ||
node_modules | ||
playgrounds/**/node_modules | ||
site/node_modules | ||
key: modules-${{ hashFiles('pnpm-lock.yaml') }} | ||
- name: Link | ||
run: pnpm dev | ||
- name: Setup | ||
uses: ./.github/actions/setup | ||
- name: Check types | ||
run: pnpm typecheck | ||
- name: Lint & format code | ||
|
@@ -107,23 +62,8 @@ jobs: | |
pnpm-version: [7] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: pnpm/[email protected] | ||
with: | ||
version: ${{ matrix.pnpm-version }} | ||
- name: Set up Node ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
cache: 'pnpm' | ||
node-version: ${{ matrix.node-version }} | ||
- name: Cache node_modules | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
dist | ||
node_modules | ||
playgrounds/**/node_modules | ||
site/node_modules | ||
key: modules-${{ hashFiles('pnpm-lock.yaml') }} | ||
- name: Setup | ||
uses: ./.github/actions/setup | ||
- name: Build | ||
run: pnpm build | ||
|
||
|
@@ -140,34 +80,8 @@ jobs: | |
transport-mode: ['http', 'webSocket'] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: pnpm/[email protected] | ||
with: | ||
version: ${{ matrix.pnpm-version }} | ||
- name: Set up Node ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
cache: 'pnpm' | ||
node-version: ${{ matrix.node-version }} | ||
- name: Cache node_modules | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
dist | ||
node_modules | ||
playgrounds/**/node_modules | ||
site/node_modules | ||
key: modules-${{ hashFiles('pnpm-lock.yaml') }} | ||
- name: Install rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
target: wasm32-unknown-unknown | ||
profile: minimal | ||
override: true | ||
- name: Install Anvil | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
- name: Setup | ||
uses: ./.github/actions/setup | ||
- name: Launch Anvil | ||
run: anvil --fork-url $VITE_ANVIL_FORK_URL --fork-block-number $VITE_ANVIL_BLOCK_NUMBER --block-time $VITE_ANVIL_BLOCK_TIME & | ||
env: | ||
|
@@ -201,30 +115,8 @@ jobs: | |
pnpm-version: [7] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: pnpm/[email protected] | ||
with: | ||
version: ${{ matrix.pnpm-version }} | ||
- name: Set up Node ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
cache: 'pnpm' | ||
node-version: ${{ matrix.node-version }} | ||
- name: Cache node_modules | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
dist | ||
node_modules | ||
playgrounds/**/node_modules | ||
site/node_modules | ||
key: modules-${{ hashFiles('pnpm-lock.yaml') }} | ||
- name: Install rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
target: wasm32-unknown-unknown | ||
profile: minimal | ||
override: true | ||
- name: Setup | ||
uses: ./.github/actions/setup | ||
- name: Install Anvil | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,33 +12,8 @@ jobs: | |
pnpm-version: [7] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: pnpm/[email protected] | ||
with: | ||
version: ${{ matrix.pnpm-version }} | ||
- name: Set up Node ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
cache: 'pnpm' | ||
node-version: ${{ matrix.node-version }} | ||
- name: Cache pnpm | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.pnpm-store | ||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }} | ||
restore-keys: pnpm- | ||
- name: Cache node_modules | ||
uses: actions/cache@v3 | ||
id: cache-node-modules | ||
with: | ||
path: | | ||
dist | ||
node_modules | ||
playgrounds/**/node_modules | ||
site/node_modules | ||
key: modules-${{ hashFiles('pnpm-lock.yaml') }} | ||
- name: Install Dependencies | ||
if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
run: pnpm i | ||
- name: Setup | ||
uses: ./.github/actions/setup | ||
- uses: preactjs/compressed-size-action@v2 | ||
with: | ||
repo-token: "${{ secrets.GITHUB_TOKEN }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,9 @@ bench | |
.env.production.local | ||
.envrc | ||
|
||
# @wagmi/cli | ||
generated.ts | ||
|
||
actions/** | ||
chains/** | ||
clients/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "contracts/lib/forge-std"] | ||
path = contracts/lib/forge-std | ||
url = https://github.com/foundry-rs/forge-std |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
cache/ | ||
out/ |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel like we use these steps in a lot of actions. Might make sense to create a composite action for them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea