Repository navigation
fix: pass the latest block to chain fee hooks in estimateFeesPerGas - #5613
Merged
Merged
Conversation
When estimateFeesPerGas was called without a block, the chain fees.estimateFeesPerGas hook received the caller's undefined block instead of the block the action had fetched, and fees.baseFeeMultiplier ran before any block was fetched. Both hooks now receive the latest block, as ChainFeesFnParameters and the chain fees docs describe.
Replace the separate proxy-backed describe block with assertions in the existing estimateFeesPerGas and baseFeeMultiplier hook tests, which now read the block they receive and fail when it is undefined. Amp-Thread-ID: https://ampcode.com/threads/T-01a1f5b7-efe8-7346-8db3-56d7c75548fe Co-authored-by: jxom <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
🦋 Changeset detectedLatest commit: f05dcc9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Contributor
|
Published pnpm add viem@pr-5613
pnpm add [email protected] |
Merged
This branch had an error being deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Supersedes #5611 by @mortezashojaei, keeping their commit.
ChainFeesFnParameters.blockis documented as the latest block, but whenestimateFeesPerGas(client)was called without ablock, the chainfees.estimateFeesPerGasand function-valuedfees.baseFeeMultiplierhooks receivedundefined. Both hooks now receive the block the action fetches.blockis still used as is.prepareTransactionRequestalways passes a block andfillTransactiondoes not use this action, so neither changes.baseFeeMultiplierbelow 1 now throwsBaseFeeScalarErrorafter the block request instead of before it.estimateFeesPerGasandbaseFeeMultiplierhook cases so the hooks read the received block; both fail onmainwithTypeError: Cannot read properties of undefined (reading 'baseFeePerGas').