-
-
Notifications
You must be signed in to change notification settings - Fork 22
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: Add getBlockBy support #1114
✨ Feat: Add getBlockBy support #1114
Conversation
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: a52aa84 The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 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 |
Warning Rate Limit Exceeded@roninjin10 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 41 minutes and 14 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. WalkthroughThe recent updates across various packages bring significant enhancements, including the addition of generic parameters to types, field renaming for clarity, dependency version updates for compatibility, and the introduction of new utilities and functions. These changes aim to boost type flexibility, maintainability, and overall functionality within the codebase. Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @roninjin10 and the rest of your teammates on Graphite |
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.
Actionable comments posted: 3
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (2)
packages/memory-client/src/test/__snapshots__/viemPublicActions.spec.ts.snap
is excluded by!**/*.snap
pnpm-lock.yaml
is excluded by!pnpm-lock.yaml
Files selected for processing (11)
- packages/actions-types/src/common/BlockResult.ts (2 hunks)
- packages/actions-types/src/common/TransactionResult.ts (1 hunks)
- packages/base-client/package.json (1 hunks)
- packages/chains/package.json (1 hunks)
- packages/memory-client/package.json (1 hunks)
- packages/memory-client/src/test/viemPublicActions.spec.ts (4 hunks)
- packages/procedures/package.json (1 hunks)
- packages/procedures/src/requestProcedure.js (3 hunks)
- packages/procedures/src/utils/blockToJsonRpcBlock.js (1 hunks)
- packages/procedures/src/utils/txToJsonRpcTx.js (1 hunks)
- tevm/package.json (1 hunks)
Files skipped from review due to trivial changes (5)
- packages/actions-types/src/common/TransactionResult.ts
- packages/base-client/package.json
- packages/chains/package.json
- packages/memory-client/package.json
- tevm/package.json
Additional comments not posted (3)
packages/actions-types/src/common/BlockResult.ts (1)
Line range hint
8-37
: The introduction of a generic parameter to conditionally alter thetransactions
type enhances type safety and flexibility. Good improvement!packages/procedures/package.json (1)
68-69
: The addition of@tevm/tx
as a dependency is consistent with the new transaction-related functionalities introduced in the codebase.packages/procedures/src/requestProcedure.js (1)
377-433
: The implementation ofgetBlockByHash
andgetBlockByNumber
aligns well with the PR's objectives to enhance block retrieval functionalities. Well done!
import { bytesToHex, numberToHex } from '@tevm/utils' | ||
|
||
/** | ||
* @param {import('@tevm/tx').TypedTransaction | import('@tevm/tx').ImpersonatedTx} tx | ||
* @param {import('@tevm/block').Block} block | ||
* @param {number} [txIndex] | ||
* @returns {import('@tevm/actions-types').TransactionResult} | ||
*/ | ||
export const txToJsonRpcTx = (tx, block, txIndex) => { | ||
const txJSON = tx.toJSON() | ||
// TODO make this typing less janky | ||
return /** @type any*/ ({ | ||
blockHash: bytesToHex(block.hash()), | ||
blockNumber: numberToHex(block.header.number), | ||
from: /** @type {import('@tevm/utils').Address}*/ (tx.getSenderAddress().toString()), | ||
gas: /** @type {import('@tevm/utils').Hex} **/ (txJSON.gasLimit), | ||
gasPrice: /** @type {import('@tevm/utils').Hex}*/ (txJSON.gasPrice ?? txJSON.maxFeePerGas), | ||
// TODO add this to the type | ||
...{ maxFeePerGas: txJSON.maxFeePerGas }, | ||
// TODO add this to the type | ||
...{ maxPriorityFeePerGas: txJSON.maxPriorityFeePerGas }, | ||
// TODO add this to the type | ||
...{ type: numberToHex(tx.type) }, | ||
...(txJSON.accessList !== undefined ? { accessList: txJSON.accessList } : {}), | ||
hash: bytesToHex(tx.hash()), | ||
data: /** @type {import('@tevm/utils').Hex} */ (txJSON.data), | ||
nonce: /** @type {import('@tevm/utils').Hex}*/ (txJSON.nonce), | ||
// these toString existed in ethereumjs but I don't think are necessary | ||
...(txJSON.to !== undefined ? { to: /** @type {import('@tevm/utils').Address} */ (txJSON.to.toString()) } : {}), | ||
...(txIndex !== undefined ? { transactionIndex: numberToHex(txIndex) } : {}), | ||
...(txJSON.value !== undefined ? { value: txJSON.value } : {}), | ||
...('isImpersonated' in tx ? { isImpersonated: tx.isImpersonated } : {}), | ||
...(txJSON.v !== undefined ? { v: txJSON.v } : {}), | ||
...(txJSON.r !== undefined ? { r: txJSON.r } : {}), | ||
...(txJSON.s !== undefined ? { s: txJSON.s } : {}), | ||
// TODO add this to the type | ||
...{ maxFeePerBlobGas: txJSON.maxFeePerBlobGas }, | ||
// TODO add this to the type | ||
...{ blobVersionedHashes: txJSON.blobVersionedHashes }, | ||
}) |
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.
Consider completing the type definitions for the transaction fields marked with TODO comments to ensure type safety and maintainability.
import { bytesToHex, numberToHex, toBytes } from '@tevm/utils' | ||
import { txToJsonRpcTx } from './txToJsonRpcTx.js' | ||
|
||
/** | ||
* @param {import('@tevm/block').Block} block | ||
* @param {boolean} includeTransactions | ||
* @returns {Promise<import('@tevm/procedures-types').EthGetBlockByHashJsonRpcResponse['result']>} | ||
*/ | ||
export const blockToJsonRpcBlock = async (block, includeTransactions) => { | ||
const json = block.toJSON() | ||
const header = /** @type {import('@tevm/block').JsonHeader}*/ (json.header) | ||
const transactions = block.transactions.map((tx, txIndex) => | ||
includeTransactions ? txToJsonRpcTx(tx, block, txIndex) : bytesToHex(tx.hash()), | ||
) | ||
|
||
/** | ||
* @type {import('@tevm/procedures-types').EthGetBlockByHashJsonRpcResponse['result']} | ||
*/ | ||
const out = { | ||
number: /** @type {import('@tevm/utils').Hex}*/ (header.number), | ||
hash: bytesToHex(block.hash()), | ||
parentHash: /** @type {import('@tevm/utils').Hex}*/ (header.parentHash), | ||
// TODO add this to the type | ||
...{ mixHash: header.mixHash }, | ||
nonce: /** @type {import('@tevm/utils').Hex}*/ (header.nonce), | ||
sha3Uncles: /** @type {import('@tevm/utils').Hex}*/ (header.uncleHash), | ||
logsBloom: /** @type {import('@tevm/utils').Hex}*/ (header.logsBloom), | ||
transactionsRoot: /** @type {import('@tevm/utils').Hex}*/ (header.transactionsTrie), | ||
stateRoot: /** @type {import('@tevm/utils').Hex}*/ (header.stateRoot), | ||
miner: /** @type {import('@tevm/utils').Address}*/ (header.coinbase), | ||
difficulty: /** @type {import('@tevm/utils').Hex}*/ (header.difficulty), | ||
// TODO we need to actually add this | ||
totalDifficulty: /** @type {import('@tevm/utils').Hex}*/ ('0x0'), | ||
extraData: /** @type {import('@tevm/utils').Hex}*/ (header.extraData), | ||
size: numberToHex(toBytes(JSON.stringify(json)).byteLength), | ||
gasLimit: /** @type {import('@tevm/utils').Hex}*/ (header.gasLimit), | ||
gasUsed: /** @type {import('@tevm/utils').Hex}*/ (header.gasUsed), | ||
timestamp: /** @type {import('@tevm/utils').Hex}*/ (header.timestamp), | ||
uncles: block.uncleHeaders.map((uh) => bytesToHex(uh.hash())), | ||
// TODO fix this type | ||
transactions: /** @type any*/ (transactions), | ||
// TODO add this to the type | ||
...{ baseFeePerGas: header.baseFeePerGas }, | ||
...{ receiptsRoot: header.receiptTrie }, | ||
...(header.withdrawalsRoot !== undefined | ||
? { | ||
withdrawalsRoot: header.withdrawalsRoot, | ||
withdrawals: json.withdrawals, | ||
} | ||
: {}), | ||
...(header.blobGasUsed !== undefined ? { blobGasUsed: header.blobGasUsed } : {}), | ||
// TODO add this to the type | ||
...{ requestsRoot: header.requestsRoot }, | ||
// TODO add this to the type | ||
...{ requests: block.requests?.map((req) => bytesToHex(req.serialize())) }, | ||
// TODO add this to the type | ||
...{ excessBlobGas: header.excessBlobGas }, | ||
// TODO add this to the type | ||
...{ parentBeaconBlockRoot: header.parentBeaconBlockRoot }, | ||
} | ||
|
||
return out |
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.
Consider completing the type definitions for the block fields marked with TODO comments to ensure type safety and maintainability.
{ timeout: 40_000 }, | ||
) | ||
}, | ||
getEnsAvatar: async () => { | ||
const kzg = await loadKZG() | ||
const mainnetClient = createMemoryClient({ | ||
chainCommon: mainnet, | ||
fork: { | ||
url: getAlchemyUrl('mainnet'), | ||
}, | ||
customCrypto: { | ||
kzg, | ||
}, | ||
}) | ||
it( | ||
'should work', | ||
async () => { | ||
// wait to avoid throttling | ||
await new Promise((resolve) => setTimeout(resolve, 1_000)) | ||
expect(await mainnetClient.getEnsAvatar({ name: 'vitalik.eth' })).toBe( | ||
'https://ipfs.io/ipfs/QmSP4nq9fnN9dAiCj42ug9Wa79rqmQerZXZch82VqpiH7U/image.gif', | ||
) | ||
}, | ||
{ timeout: 40_000 }, | ||
) | ||
}, | ||
getEnsAvatar: () => { | ||
getEnsName: async () => { | ||
const kzg = await loadKZG() | ||
const mainnetClient = createMemoryClient({ | ||
chainCommon: mainnet, | ||
fork: { | ||
url: getAlchemyUrl('mainnet'), | ||
}, | ||
customCrypto: { | ||
kzg, | ||
}, | ||
}) | ||
it( | ||
'should work', | ||
async () => { | ||
// wait to avoid throttling | ||
await new Promise((resolve) => setTimeout(resolve, 1_000)) | ||
expect(await mainnetClient.getEnsName({ address: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045' })).toBe( | ||
'vitalik.eth', | ||
) | ||
}, | ||
{ timeout: 40_000 }, | ||
) |
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.
Consider replacing setTimeout
used for throttling with a more robust method or utility function that can handle rate limits more reliably in tests.
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.
Actionable comments posted: 2
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (9)
- .changeset/neat-dots-tap.md (1 hunks)
- .changeset/rude-lamps-sell.md (1 hunks)
- .changeset/soft-panthers-boil.md (1 hunks)
- .changeset/wet-ducks-speak.md (1 hunks)
- packages/actions-types/docs/type-aliases/BlockResult.md (3 hunks)
- packages/actions-types/docs/type-aliases/TransactionResult.md (2 hunks)
- packages/chains/docs/README.md (2 hunks)
- tevm/docs/actions-types/type-aliases/BlockResult.md (3 hunks)
- tevm/docs/actions-types/type-aliases/TransactionResult.md (2 hunks)
Files skipped from review due to trivial changes (1)
- .changeset/neat-dots-tap.md
Additional Context Used
Markdownlint (2)
packages/chains/docs/README.md (2)
9: null
Images should have alternate text (alt text)
41: null
Images should have alternate text (alt text)
Additional comments not posted (9)
.changeset/soft-panthers-boil.md (1)
6-6
: The changeset description clearly communicates the fix applied toTransactionResult
..changeset/wet-ducks-speak.md (1)
6-6
: The changeset description clearly communicates the fix applied toBlockResult
..changeset/rude-lamps-sell.md (1)
6-6
: The changeset description clearly communicates the addition of verification tests toViem PublicActions
.tevm/docs/actions-types/type-aliases/TransactionResult.md (1)
26-26
: The documentation accurately reflects the changes made to theTransactionResult
type.packages/actions-types/docs/type-aliases/TransactionResult.md (1)
26-26
: The documentation accurately reflects the changes made to theTransactionResult
type.tevm/docs/actions-types/type-aliases/BlockResult.md (2)
7-17
: The introduction and type parameters are clearly documented and provide a good understanding of theBlockResult
type's purpose and usage.
90-90
: The conditional type for thetransactions
property enhances flexibility and type safety, allowing users to specify the type of transactions they expect based on their needs.packages/actions-types/docs/type-aliases/BlockResult.md (2)
7-17
: The introduction and type parameters are clearly documented and provide a good understanding of theBlockResult
type's purpose and usage.
90-90
: The conditional type for thetransactions
property enhances flexibility and type safety, allowing users to specify the type of transactions they expect based on their needs.
@@ -6,8 +6,7 @@ | |||
<a href="https://tevm.sh/"> | |||
<picture> | |||
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/35039927/218812217-92f0f784-cb85-43b9-9ca6-e2b9effd9eb2.png"> | |||
<img alt="TEVM Chains Logo" src="https://user-images.githubusercontent.com/35039927/218812217-92f0f784-cb85-43b9-9ca6-e2b9effd9eb2.png" width="auto" height="300"> | |||
<img alt="License Information" src="https://user-images.githubusercontent.com/35039927/231030761-66f5ce58-a4e9-4695-b1fe-255b1bceac92.png" width="200" /> | |||
<img src="https://user-images.githubusercontent.com/35039927/218812217-92f0f784-cb85-43b9-9ca6-e2b9effd9eb2.png" width="auto" height="300"> |
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.
Please add alternate text (alt text) to the image for accessibility.
- <img src="https://user-images.githubusercontent.com/35039927/218812217-92f0f784-cb85-43b9-9ca6-e2b9effd9eb2.png" width="auto" height="300">
+ <img src="https://user-images.githubusercontent.com/35039927/218812217-92f0f784-cb85-43b9-9ca6-e2b9effd9eb2.png" alt="TEVM Chains Logo" width="auto" height="300">
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
<img src="https://user-images.githubusercontent.com/35039927/218812217-92f0f784-cb85-43b9-9ca6-e2b9effd9eb2.png" width="auto" height="300"> | |
<img src="https://user-images.githubusercontent.com/35039927/218812217-92f0f784-cb85-43b9-9ca6-e2b9effd9eb2.png" alt="TEVM Chains Logo" width="auto" height="300"> |
@@ -18,7 +17,7 @@ | |||
|
|||
[![CI](https://github.com/evmts/tevm-monorepo/actions/workflows/e2e.yml/badge.svg)](https://github.com/evmts/tevm-monorepo/actions/workflows/e2e.yml) | |||
[![CI](https://github.com/evmts/tevm-monorepo/actions/workflows/unit.yml/badge.svg)](https://github.com/evmts/tevm-monorepo/actions/workflows/unit.yml) | |||
<a href="https://www.npmjs.com/package/@tevm/chains" target="\_parent"> | |||
<a href="https://www.npmjs.com/package/@tevm/chains" target="_parent"> |
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.
Please add alternate text (alt text) to the image for accessibility.
- <img src="https://user-images.githubusercontent.com/35039927/231030761-66f5ce58-a4e9-4695-b1fe-255b1bceac92.png" width="200" />
+ <img src="https://user-images.githubusercontent.com/35039927/231030761-66f5ce58-a4e9-4695-b1fe-255b1bceac92.png" alt="TEVM Chains License" width="200" />
Committable suggestion was skipped due low confidence.
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.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
packages/memory-client/src/test/__snapshots__/viemPublicActions.spec.ts.snap
is excluded by!**/*.snap
Files selected for processing (9)
- .changeset/clever-wasps-fry.md (1 hunks)
- .changeset/green-coins-camp.md (1 hunks)
- packages/base-client/src/MockKzg.ts (1 hunks)
- packages/base-client/src/createBaseClient.js (3 hunks)
- packages/base-client/src/createMockKzg.js (1 hunks)
- packages/chains/src/index.ts (3 hunks)
- packages/memory-client/src/test/viemPublicActions.spec.ts (4 hunks)
- packages/procedures/.depcheckrc (1 hunks)
- packages/procedures/src/requestProcedure.js (3 hunks)
Files skipped from review due to trivial changes (2)
- .changeset/clever-wasps-fry.md
- packages/procedures/.depcheckrc
Additional comments not posted (15)
.changeset/green-coins-camp.md (1)
1-5
: LGTM! Clear description of the patch update for@tevm/base-client
.packages/base-client/src/createMockKzg.js (1)
1-16
: LGTM! The mock functions are appropriately defined for testing purposes.packages/base-client/src/MockKzg.ts (1)
1-9
: LGTM! The type definitions forMockKzg
are consistent with the implementation.packages/chains/src/index.ts (1)
Line range hint
30-45
: LGTM! The addition ofcustomCrypto
as an optional parameter enhances cryptographic customization per chain.packages/base-client/src/createBaseClient.js (1)
Line range hint
12-138
: LGTM! The integration ofcreateMockKzg
in thecustomCrypto
configuration is appropriate for testing environments.packages/memory-client/src/test/viemPublicActions.spec.ts (1)
Line range hint
7-343
: LGTM! The new tests inviemPublicActions.spec.ts
are well-structured and relevant to the PR objectives.packages/procedures/src/requestProcedure.js (9)
4-4
: Ensure the new utility functions are used appropriately.The addition of
hexToBytes
,hexToNumber
, and the new utility function imports are correctly placed and seem to be used appropriately in the context of the file.
26-27
: Validate the integration of new utility functions.The import statements for
blockToJsonRpcBlock
andtxToJsonRpcTx
are correctly added. Ensure that these functions are used effectively in the corresponding RPC method handlers.
377-390
: Review the implementation ofeth_getBlockByHash
.The implementation for
eth_getBlockByHash
correctly retrieves the block usinghexToBytes
to convert the hash and handles theincludeTransactions
parameter effectively. The use ofblockToJsonRpcBlock
to format the response is appropriate.
392-432
: Review the implementation ofeth_getBlockByNumber
.The method
eth_getBlockByNumber
is implemented with a clear structure. It handles different types of block identifiers (hex or tag) and correctly usesblockToJsonRpcBlock
for formatting the response. The error handling for non-existent blocks is also in place.
434-446
: Review the implementation ofeth_getBlockTransactionCountByHash
.This method correctly fetches the block and calculates the transaction count. The use of
numberToHex
for the result ensures the response format aligns with JSON-RPC specifications.
448-477
: Review the implementation ofeth_getBlockTransactionCountByNumber
.Similar to the hash variant, this method handles the block number input correctly, fetching the block and returning the transaction count in the expected format.
479-525
: Review the implementation ofeth_getTransactionByHash
.The method handles fetching the transaction by hash appropriately, using the receipts manager and formatting the response with
txToJsonRpcTx
. Error handling for missing transactions is also correctly implemented.
527-551
: Review the implementation ofeth_getTransactionByBlockHashAndIndex
.This method effectively retrieves a transaction based on block hash and index, using the utility functions for conversion and response formatting. The error handling and response structure are consistent with JSON-RPC standards.
553-596
: Review the implementation ofeth_getTransactionByBlockNumberAndIndex
.The implementation for fetching a transaction by block number and index is robust, with appropriate checks and usage of utility functions. The response formatting and error handling are well-handled.
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ `main` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run `changeset pre exit` on `main`.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ # Releases ## @tevm/[email protected] ### Minor Changes - [#1114](#1114) [`7ba5242`](7ba5242) Thanks [@roninjin10](https://github.com/roninjin10)! - Added customCrypto option ## @tevm/[email protected] ### Minor Changes - [#1114](#1114) [`7ba5242`](7ba5242) Thanks [@roninjin10](https://github.com/roninjin10)! - Added new JSON-RPC endpoints eth_getBlockByHash, eth_getBlockByNumber, eth_getBlockTransactionCountByHash, eth_getBlockTransactionCountByNumber, eth_getTransactionByHash, eth_getTransactionByBlockHashAndIndex, eth_getTransactionByBlockNumberAndIndex, and eth_blobBaseFee ### Patch Changes - [#1114](#1114) [`7ba5242`](7ba5242) Thanks [@roninjin10](https://github.com/roninjin10)! - Added verification tests to Viem PublicActions getEnsAvatar, getEnsName, getEnsResolver, getEnsText, , getTransactions, getTransactionConfirmations - Updated dependencies \[[`7ba5242`](7ba5242), [`7ba5242`](7ba5242)]: - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] ## @tevm/[email protected] ### Minor Changes - [#1114](#1114) [`7ba5242`](7ba5242) Thanks [@roninjin10](https://github.com/roninjin10)! - Added new JSON-RPC endpoints eth_getBlockByHash, eth_getBlockByNumber, eth_getBlockTransactionCountByHash, eth_getBlockTransactionCountByNumber, eth_getTransactionByHash, eth_getTransactionByBlockHashAndIndex, eth_getTransactionByBlockNumberAndIndex, and eth_blobBaseFee ### Patch Changes - Updated dependencies \[]: - @tevm/[email protected] ## [email protected] ### Minor Changes - [#1114](#1114) [`7ba5242`](7ba5242) Thanks [@roninjin10](https://github.com/roninjin10)! - Added new JSON-RPC endpoints eth_getBlockByHash, eth_getBlockByNumber, eth_getBlockTransactionCountByHash, eth_getBlockTransactionCountByNumber, eth_getTransactionByHash, eth_getTransactionByBlockHashAndIndex, eth_getTransactionByBlockNumberAndIndex, and eth_blobBaseFee ### Patch Changes - [#1114](#1114) [`7ba5242`](7ba5242) Thanks [@roninjin10](https://github.com/roninjin10)! - Added verification tests to Viem PublicActions getEnsAvatar, getEnsName, getEnsResolver, getEnsText, , getTransactions, getTransactionConfirmations - [#1114](#1114) [`7ba5242`](7ba5242) Thanks [@roninjin10](https://github.com/roninjin10)! - Fixed bug in TransactionResult returning input rather than data - [#1114](#1114) [`7ba5242`](7ba5242) Thanks [@roninjin10](https://github.com/roninjin10)! - Fixed BlockResult type to be correct when `includeTransactions` is true - Updated dependencies \[[`7ba5242`](7ba5242), [`7ba5242`](7ba5242), [`7ba5242`](7ba5242), [`7ba5242`](7ba5242), [`7ba5242`](7ba5242), [`7ba5242`](7ba5242)]: - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] ## @tevm/[email protected] ### Patch Changes - Updated dependencies \[]: - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] ## @tevm/[email protected] ### Patch Changes - Updated dependencies \[[`7ba5242`](7ba5242), [`7ba5242`](7ba5242)]: - @tevm/[email protected] ## @tevm/[email protected] ### Patch Changes - [#1114](#1114) [`7ba5242`](7ba5242) Thanks [@roninjin10](https://github.com/roninjin10)! - Fixed bug in TransactionResult returning input rather than data - [#1114](#1114) [`7ba5242`](7ba5242) Thanks [@roninjin10](https://github.com/roninjin10)! - Fixed BlockResult type to be correct when `includeTransactions` is true ## @tevm/[email protected] ### Patch Changes - [#1114](#1114) [`7ba5242`](7ba5242) Thanks [@roninjin10](https://github.com/roninjin10)! - Fixed bug with not passing in customCrypto correctly for non forked mode - Updated dependencies \[[`7ba5242`](7ba5242)]: - @tevm/[email protected] ## @tevm/[email protected] ### Patch Changes - Updated dependencies \[[`7ba5242`](7ba5242), [`7ba5242`](7ba5242), [`7ba5242`](7ba5242)]: - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
TL;DR
Uncomment more tests in viem public actions
Implement getBlockBy support
What changed?
How to test?
Run the tests in viemPublicActions
Why make this change?
To ensure all tests in viemPublicActions pass
Description
Concise description of proposed changes
Testing
Explain the quality checks that have been done on the code changes
Additional Information
Your ENS/address:
Summary by CodeRabbit
New Features
CustomCrypto
type andcustomCrypto
field toCommonOptions
increateChainCommon
function.MockKzg
type with functions for zero-knowledge proofs and commitments.Bug Fixes
TransactionResult
that caused it to return incorrect values.Dependencies