Skip to content

Commit

Permalink
feat: add eth_call multicall aggregation
Browse files Browse the repository at this point in the history
  • Loading branch information
jxom committed Apr 18, 2023
1 parent d197914 commit 3010d16
Show file tree
Hide file tree
Showing 23 changed files with 1,047 additions and 24 deletions.
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ ALCHEMY_ID=
VITE_ANVIL_FORK_URL=
VITE_ANVIL_BLOCK_TIME=1
VITE_ANVIL_BLOCK_NUMBER=16280770
VITE_NETWORK_TRANSPORT_MODE=http
VITE_NETWORK_TRANSPORT_MODE=http
VITE_BATCH_MULTICALL=true
5 changes: 5 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ jobs:
shard: [1, 2, 3]
total-shards: [3]
transport-mode: ['http', 'webSocket']
include:
- batch-multicall: 'false'
- batch-multicall: 'true'
transport-mode: 'http'
steps:
- uses: actions/checkout@v3
- name: Setup
Expand All @@ -100,6 +104,7 @@ jobs:
VITE_ANVIL_BLOCK_TIME: ${{ vars.VITE_ANVIL_BLOCK_TIME }}
VITE_ANVIL_FORK_URL: ${{ vars.VITE_ANVIL_FORK_URL }}
VITE_NETWORK_TRANSPORT_MODE: ${{ matrix.transport-mode }}
VITE_BATCH_MULTICALL: ${{ matrix.batch-multicall }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
Expand Down
6 changes: 6 additions & 0 deletions src/_test/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,18 @@ const provider = {
}

export const httpClient = createPublicClient({
batch: {
multicall: process.env.VITE_BATCH_MULTICALL === 'true',
},
chain: anvilChain,
pollingInterval: 1_000,
transport: http(),
})

export const webSocketClient = createPublicClient({
batch: {
multicall: process.env.VITE_BATCH_MULTICALL === 'true',
},
chain: anvilChain,
pollingInterval: 1_000,
transport: webSocket(localWsUrl),
Expand Down
3 changes: 1 addition & 2 deletions src/actions/ens/getEnsAddress.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ test('invalid universal resolver address', async () => {
universalResolverAddress: '0xecb504d39723b0be0e3a9aa33d646642d1051ee1',
}),
).rejects.toThrowErrorMatchingInlineSnapshot(`
"The contract function \\"resolve\\" reverted with the following reason:
execution reverted
"The contract function \\"resolve\\" reverted.
Contract Call:
address: 0x0000000000000000000000000000000000000000
Expand Down
Loading

0 comments on commit 3010d16

Please sign in to comment.