-
Notifications
You must be signed in to change notification settings - Fork 372
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
⚡️ Add block refresher #795
Conversation
🦋 Changeset detectedLatest commit: 0cd09b0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
/** | ||
* Refresh standard calls each time the n-th block is mined. | ||
*/ | ||
refresh?: number | string |
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.
Specify available strings exactly, not string.
() => | ||
calls.map((call) => | ||
chainId !== undefined | ||
? encodeCallData(call, chainId, { ...queryParams, refresh: queryParams.refresh ?? refresh }) |
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.
Can it be simplified into { refresh, ...queryParams }
?
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.
No because refresh can be undefined and then we need to use queryParam's refresh.
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.
Yes, then queryParams will override.
await waitForCurrent((val) => val !== undefined) | ||
expect(result.error).to.be.undefined | ||
expect(result.current).to.eq(100) | ||
await sleep(1000) |
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.
How about moving the sleep into the mineBlock function, and explain why it is there?
@@ -82,6 +82,7 @@ export function MultiChainStateProvider({ children, multicallAddresses }: Props) | |||
|
|||
const callsOnThisChain = uniqueCalls.filter((call) => call.chainId === chainId) | |||
if (callsOnThisChain.length === 0) { | |||
dispatchCalls({ type: 'UPDATE_CALLS', calls, blockNumber, chainId }) |
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.
Comment why this is needed here?
1438389
to
0cd09b0
Compare
@@ -81,9 +81,7 @@ export function MultiChainStateProvider({ children, multicallAddresses }: Props) | |||
} | |||
|
|||
const callsOnThisChain = uniqueCalls.filter((call) => call.chainId === chainId) | |||
if (callsOnThisChain.length === 0) { |
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.
Why do we remove this?
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.
i put that on multicall function, to reduce duplicated code
closes #783
closes #156