Skip to content
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

🧪 Test: Add more procedures tests #1247

Merged
merged 5 commits into from
Jul 2, 2024

Conversation

roninjin10
Copy link
Collaborator

@roninjin10 roninjin10 commented Jun 27, 2024

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
    • Introduced getBlockFromRpc function in the blockchain package, enabling retrieval of blocks from an RPC server.
  • Documentation
    • Updated blockchain package documentation to include details on the new getBlockFromRpc function.

Copy link

vercel bot commented Jun 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
tevm-monorepo-tevm ❌ Failed (Inspect) Jul 2, 2024 3:02am

Copy link

changeset-bot bot commented Jun 27, 2024

⚠️ No Changeset found

Latest commit: b3f581f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

coderabbitai bot commented Jun 27, 2024

Warning

Rate limit exceeded

@roninjin10 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 21 minutes and 37 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Commits

Files that changed from the base of the PR and between 8b92838 and b3f581f.

Walkthrough

A new function getBlockFromRpc was introduced in the @tevm/blockchain package. This function retrieves a block from an RPC server using specified parameters. The function was documented and added to various documentation files to keep track of new exports and function summaries within the blockchain package.

Changes

Files Change Summary
packages/blockchain/src/index.ts Added export statement for getBlockFromRpc
packages/blockchain/docs/functions/getBlockFromRpc.md Documented the getBlockFromRpc function, its parameters, and return type
packages/blockchain/docs/globals.md Added getBlockFromRpc to the list of functions in globals
tevm/docs/blockchain/README.md Included getBlockFromRpc in the README related to blockchain operations
tevm/docs/blockchain/functions/getBlockFromRpc.md New file describing the getBlockFromRpc function, its parameters, and how it retrieves a block from an RPC server

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant BlockchainModule
  participant BlockchainRPC

  User->>BlockchainModule: Call getBlockFromRpc({ blockTag, transport }, common)
  BlockchainModule->>BlockchainRPC: Request block data (blockTag, transport)
  BlockchainRPC-->>BlockchainModule: Return block data (Block)
  BlockchainModule-->>User: Return Promise<Block>
Loading

Poem

In the realm of chains where data flows free,
A new path formed for all to see.
getBlockFromRpc now stands tall,
Summoning blocks at the user's call.
From nodes afar, to here it brings,
The essence of blocks, the lifeblood of things.


Tip

Early access features: enabled

We are currently testing the following features in early access:

  • OpenAI gpt-4o model for code reviews and chat: OpenAI claims that this model is better at understanding and generating code than the previous models. We seek your feedback over the next few weeks before making it generally available.

Note:

  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.
  • Please join our Discord Community to provide feedback and report issues.
  • OSS projects are currently opted into early access features by default.

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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@roninjin10 roninjin10 marked this pull request as ready for review June 27, 2024 22:24
Copy link
Collaborator Author

roninjin10 commented Jun 27, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @roninjin10 and the rest of your teammates on Graphite Graphite

@roninjin10 roninjin10 force-pushed the 06-27-_test_tube_test_add_more_procedures_tests branch from eae7aa4 to 2c8b698 Compare June 27, 2024 22:49
@roninjin10 roninjin10 changed the base branch from main to 06-27-_sparkles_feat_add_prefunded_accounts_to_tevm_utils June 27, 2024 22:50
Base automatically changed from 06-27-_sparkles_feat_add_prefunded_accounts_to_tevm_utils to main June 27, 2024 22:56
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 31

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 400bbe7 and 2c8b698.

Files ignored due to path filters (11)
  • packages/procedures/src/__snapshots__/createHandlers.spec.ts.snap is excluded by !**/*.snap
  • packages/procedures/src/dumpstate/__snapshots__/dumpStateProcedure.spec.ts.snap is excluded by !**/*.snap
  • packages/procedures/src/eth/__snapshots__/blockNumberProcedure.spec.ts.snap is excluded by !**/*.snap
  • packages/procedures/src/eth/__snapshots__/chainIdProcedure.spec.ts.snap is excluded by !**/*.snap
  • packages/procedures/src/eth/__snapshots__/ethBlobBaseFeeProcedure.spec.ts.snap is excluded by !**/*.snap
  • packages/procedures/src/eth/__snapshots__/ethCallProcedure.spec.ts.snap is excluded by !**/*.snap
  • packages/procedures/src/eth/__snapshots__/ethCoinbaseProcedure.spec.ts.snap is excluded by !**/*.snap
  • packages/procedures/src/eth/__snapshots__/ethEstimateGasProcedure.spec.ts.snap is excluded by !**/*.snap
  • packages/procedures/src/eth/__snapshots__/ethGetBlockByNumberProcedure.spec.ts.snap is excluded by !**/*.snap
  • packages/procedures/src/setaccount/__snapshots__/setAccountProcedure.spec.ts.snap is excluded by !**/*.snap
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing (31)
  • packages/blockchain/src/index.ts (1 hunks)
  • packages/procedures/package.json (1 hunks)
  • packages/procedures/src/call/callProcedure.spec.ts (1 hunks)
  • packages/procedures/src/createHandlers.spec.ts (1 hunks)
  • packages/procedures/src/dumpstate/dumpStateProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/blockNumberProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/chainIdProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/ethBlobBaseFeeProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/ethCallProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/ethCoinbaseProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/ethEstimateGasProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/ethGetBlockByHashProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/ethGetBlockByNumberProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/ethGetBlockTransactionCountByHashProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/ethGetBlockTransactionCountByNumberProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/ethGetFilterChangesProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/ethSignTransactionProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/ethUninstallFilterProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/gasPriceProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/getBalanceProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/getCodeProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/getStorageAtProcedure.spec.ts (1 hunks)
  • packages/procedures/src/getaccount/getAccountProcedure.spec.ts (1 hunks)
  • packages/procedures/src/loadstate/loadStateProcedure.spec.ts (1 hunks)
  • packages/procedures/src/mine/mineProcedure.spec.ts (1 hunks)
  • packages/procedures/src/script/scriptProcedure.spec.ts (1 hunks)
  • packages/procedures/src/setaccount/setAccountProcedure.spec.ts (1 hunks)
  • packages/procedures/src/utils/blockToJsonRpcBlock.spec.ts (1 hunks)
  • packages/procedures/src/utils/generateRandomId.spec.ts (1 hunks)
  • packages/procedures/src/utils/parseBlockTag.spec.ts (1 hunks)
  • packages/procedures/src/utils/txToJsonRpcTx.spec.ts (1 hunks)
Files not reviewed due to errors (2)
  • packages/procedures/src/setaccount/setAccountProcedure.spec.ts (no review received)
  • packages/procedures/src/eth/getStorageAtProcedure.spec.ts (no review received)
Files skipped from review due to trivial changes (1)
  • packages/blockchain/src/index.ts
Additional context used
Biome
packages/procedures/src/createHandlers.spec.ts

[error] 10-10: This variable implicitly has the any type.

Variable declarations without type annotation and initialization implicitly have the any type. Declare a type or initialize the variable with some value.

(lint/suspicious/noImplicitAnyLet)

Additional comments not posted (41)
packages/procedures/src/utils/generateRandomId.spec.ts (1)

4-15: Well-structured tests for generateRandomId.

The tests adequately verify both the format and the uniqueness of the IDs generated by the generateRandomId function.

packages/procedures/src/utils/blockToJsonRpcBlock.spec.ts (1)

7-19: Tests use snapshot matching for complex outputs.

While snapshot tests are effective for complex data structures, they can be brittle if the underlying data changes often. Consider adding more granular assertions if the output format is stable.

packages/procedures/src/script/scriptProcedure.spec.ts (1)

14-33: Basic assertions in place for scriptProcedure.

The test effectively checks for error-free execution and result definition. Consider adding more detailed assertions to capture specific behaviors or outputs of the script execution process.

packages/procedures/src/utils/txToJsonRpcTx.spec.ts (1)

9-29: Comprehensive test for txToJsonRpcTx.

The setup and execution of the test are thorough, effectively capturing the transformation of transaction data into the JSON-RPC format. Snapshot testing is appropriately used here given the complexity and variety of the data involved.
[APROVED]

packages/procedures/src/dumpstate/dumpStateProcedure.spec.ts (1)

13-40: Detailed and comprehensive test for dumpStateProcedure.

The test thoroughly sets up the state and validates the procedure's response, ensuring that all aspects of the state dumping process are covered. The assertions are well-targeted, checking for both the presence of expected results and the correctness of response properties.

packages/procedures/src/utils/parseBlockTag.spec.ts (1)

5-43: Comprehensive Test Coverage for parseBlockTag

The test suite covers a variety of cases, ensuring that the function handles different types of inputs correctly. This includes hex numbers, block hashes, special tags, and direct number inputs. It's good to see thorough testing, especially for utility functions that are critical in blockchain operations.

packages/procedures/src/eth/chainIdProcedure.spec.ts (1)

12-43: Effective Testing of chainIdProcedure

The tests validate the functionality of the chainIdProcedure effectively, ensuring that both scenarios with and without an ID are handled correctly. Using toMatchSnapshot is a good choice for ensuring that the output remains consistent across tests. However, ensure that the snapshots are up-to-date and accurately reflect the expected results.

packages/procedures/src/eth/blockNumberProcedure.spec.ts (1)

12-43: Thorough Testing of blockNumberProcedure

The test suite for blockNumberProcedure is well-structured, covering scenarios with and without an ID effectively. Using toMatchSnapshot ensures that the responses are consistent with expectations. It's important to keep these snapshots up-to-date to avoid false positives in future tests.

packages/procedures/src/eth/ethCoinbaseProcedure.spec.ts (1)

12-43: Comprehensive Testing of ethCoinbaseJsonRpcProcedure

The test cases for ethCoinbaseJsonRpcProcedure are comprehensive, covering both scenarios with and without an ID. The use of toMatchSnapshot is appropriate here to ensure the consistency of the responses. Continue to monitor the accuracy of these snapshots to maintain test reliability.
[APROVED]

packages/procedures/src/eth/ethBlobBaseFeeProcedure.spec.ts (1)

11-58: Robust Testing of ethBlobBaseFeeJsonRpcProcedure

The tests for ethBlobBaseFeeJsonRpcProcedure effectively cover different scenarios, including those with additional parameters. This ensures that the procedure is robust against various types of inputs. The use of toMatchSnapshot here is crucial for maintaining consistency in the expected outputs.

packages/procedures/src/loadstate/loadStateProcedure.spec.ts (2)

1-4: Code Imports Review

The imports are correctly structured and relevant to the file's functionality.


8-10: Base Client Initialization in beforeEach

Initializing client in beforeEach ensures a clean state for each test, which is a good practice.

packages/procedures/src/mine/mineProcedure.spec.ts (2)

1-4: Code Imports Review

The imports are correctly structured and relevant to the file's functionality.


8-10: Base Client Initialization in beforeEach

Initializing client in beforeEach ensures a clean state for each test, which is a good practice.

packages/procedures/package.json (1)

70-76: Dependency Updates Review

The addition of @tevm/blockchain and the version update for @tevm/test-utils are consistent with the stated changes. Ensure that these versions are compatible with other parts of the project.

Verification successful

Dependency Updates Review

The addition of @tevm/blockchain and the version update for @tevm/test-utils are consistent with the stated changes. Ensure that these versions are compatible with other parts of the project.

  • The version for @tevm/blockchain is consistently set to "workspace:^" across the packages.
  • The version for @tevm/test-utils is updated to "2.0.0-next.86" in packages/procedures/package.json and is also mentioned as "workspace:^" in another package.

The updates appear consistent and compatible across the project.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify that the new dependency versions are compatible with other parts of the project.
cat packages/*/package.json | jq '.dependencies'

Length of output: 5449

packages/procedures/src/eth/ethUninstallFilterProcedure.spec.ts (2)

1-4: Code Imports Review

The imports are correctly structured and relevant to the file's functionality.


10-24: Filter Setup and Uninstallation Tests

The setup in beforeEach is thorough, preparing multiple filter states. The tests for uninstalling filters check both presence and absence, which is comprehensive.

packages/procedures/src/eth/ethGetBlockByHashProcedure.spec.ts (1)

1-4: Code Imports Review

The imports are correctly structured and relevant to the file's functionality.

packages/procedures/src/eth/ethEstimateGasProcedure.spec.ts (3)

12-33: Test Case Review: "should estimate gas successfully"

The test setup and execution seem correct and effectively validate the success path. However, using snapshots can sometimes lead to brittle tests if not managed carefully.

Consider verifying whether snapshot tests are the best approach here, or if explicit value checks could be more maintainable.


35-55: Test Case Review: "should handle errors from callProcedure"

The test case effectively simulates error conditions and checks for the absence of a result, which is good. However, consider adding more explicit checks on the nature of the error to ensure it matches expected error conditions.


57-76: Test Case Review: "should handle requests without an id"

The test is well-structured and checks important behavior when the 'id' field is missing. Again, consider the implications of using snapshots for testing and whether more explicit assertions could be beneficial.

Review the use of snapshot testing in this scenario for maintainability.

packages/procedures/src/eth/gasPriceProcedure.spec.ts (1)

61-85: Test Case Review: "should handle errors from gasPriceHandler"

The test case effectively simulates an error condition by manipulating the client's behavior. Consider adding more explicit checks on the nature of the error to ensure it matches expected error conditions.

packages/procedures/src/eth/ethGetBlockByNumberProcedure.spec.ts (3)

12-27: Test Case Review: "should return block details by number"

The test setup and execution seem correct and effectively validate the retrieval of block details based on the block number. However, using snapshots can sometimes lead to brittle tests if not managed carefully.

Consider verifying whether snapshot tests are the best approach here, or if explicit value checks could be more maintainable.


29-43: Test Case Review: "should include transactions if requested"

The test case effectively checks the inclusion of transactions in the block details, which is a critical aspect of blockchain functionality. Again, consider the implications of using snapshots for testing and whether more explicit assertions could be beneficial.

Review the use of snapshot testing in this scenario for maintainability.


45-58: Test Case Review: "should handle requests without an id"

The test is well-structured and checks important behavior when the 'id' field is missing. Again, consider the implications of using snapshots for testing and whether more explicit assertions could be beneficial.

Review the use of snapshot testing in this scenario for maintainability.

packages/procedures/src/eth/getBalanceProcedure.spec.ts (1)

53-62: Test Case Review: "should return an error if the block parameter is missing"

The test case effectively simulates an error condition by omitting the block parameter. Consider adding more explicit checks on the nature of the error to ensure it matches expected error conditions.

packages/procedures/src/eth/ethSignTransactionProcedure.spec.ts (3)

13-40: Test Case Review: "should sign a transaction successfully"

The test setup and execution seem correct and effectively validate the transaction signing process. However, using snapshots can sometimes lead to brittle tests if not managed carefully.

Consider verifying whether snapshot tests are the best approach here, or if explicit value checks could be more maintainable.


42-67: Test Case Review: "should handle requests without an id"

This test case effectively checks the procedure's behavior when the 'id' is missing, which is important for robustness. Again, consider the implications of using snapshots for testing and whether more explicit assertions could be beneficial.

Review the use of snapshot testing in this scenario for maintainability.


69-94: Test Case Review: "should handle errors from ethSignTransactionHandler"

The test case effectively simulates an error condition by providing an invalid address. Consider adding more explicit checks on the nature of the error to ensure it matches expected error conditions.

packages/procedures/src/eth/ethCallProcedure.spec.ts (3)

41-60: Good coverage for minimal input scenarios.

This test case effectively checks how ethCallProcedure handles requests with missing optional fields, ensuring the procedure's robustness in handling different types of input.


63-84: Proper testing of error handling in failure scenarios.

This test case correctly simulates an error condition by providing invalid parameters and checks for appropriate error handling, ensuring the procedure's reliability under failure conditions.


87-105: Effective testing of JSON-RPC compliance for requests without an ID.

This test case effectively ensures that ethCallProcedure can handle requests without an id, which is a crucial aspect of JSON-RPC where IDs are not strictly required for notifications.

packages/procedures/src/createHandlers.spec.ts (5)

27-42: Good coverage for typical eth_call scenarios.

This test case effectively checks how the handler processes an eth_call request with typical parameters, ensuring the handler's robustness in handling different types of input.


45-53: Proper testing of eth_getBalance handler functionality.

This test case correctly simulates a typical balance query scenario and checks for appropriate handling, ensuring the handler's reliability under typical use cases.


84-98: Good coverage for eth_estimateGas scenarios.

This test case effectively checks how the handler processes an eth_estimateGas request with typical parameters, ensuring the handler's robustness in handling different types of input.


122-128: Good coverage for eth_mining scenarios.

This test case effectively checks how the handler processes an eth_mining request, ensuring the handler's robustness in handling different types of input.


131-137: Good coverage for eth_syncing scenarios.

This test case effectively checks how the handler processes an eth_syncing request, ensuring the handler's robustness in handling different types of input.

packages/procedures/src/eth/getCodeProcedure.spec.ts (2)

59-82: Effective testing of JSON-RPC compliance for requests without an ID.

This test case effectively ensures that getCodeProcedure can handle requests without an id, which is a crucial aspect of JSON-RPC where IDs are not strictly required for notifications.


85-109: Proper testing of error handling in failure scenarios.

This test case correctly simulates an error condition by providing an invalid address and checks for appropriate error handling, ensuring the procedure's reliability under failure conditions.

packages/procedures/src/eth/ethGetBlockTransactionCountByHashProcedure.spec.ts (1)

60-99: Good Coverage for Requests without an ID

This test case effectively checks the procedure's handling of requests without an id. It ensures that the procedure adheres to the JSON-RPC specification by not requiring an id field.

packages/procedures/src/eth/ethGetBlockTransactionCountByNumberProcedure.spec.ts (1)

60-99: Good Coverage for Requests without an ID

This test case effectively checks the procedure's handling of requests without an id, ensuring compliance with the JSON-RPC specification.

Comment on lines +12 to +70
describe('loadStateProcedure', () => {
it('should load state successfully', async () => {
const request: LoadStateJsonRpcRequest = {
jsonrpc: '2.0',
method: 'tevm_loadState',
id: 1,
params: [
{
state: {
'0x1234567890abcdef1234567890abcdef12345678': {
nonce: '0x1',
balance: '0x10',
storageRoot: '0x1234',
codeHash: '0x5678',
},
},
},
],
}

const response = await loadStateProcedure(client)(request)
expect(response.error).toBeUndefined()
expect(response.result).toBeDefined()
expect(response.method).toBe('tevm_loadState')
expect(response.id).toBe(request.id as any)
})

it('should handle state loading with multiple accounts', async () => {
const request: LoadStateJsonRpcRequest = {
jsonrpc: '2.0',
method: 'tevm_loadState',
id: 1,
params: [
{
state: {
'0x1234567890abcdef1234567890abcdef12345678': {
nonce: '0x1',
balance: '0x10',
storageRoot: '0x1234',
codeHash: '0x5678',
},
'0xabcdefabcdefabcdefabcdefabcdefabcdefabcd': {
nonce: '0x2',
balance: '0x20',
storageRoot: '0x5678',
codeHash: '0x1234',
},
},
},
],
}

const response = await loadStateProcedure(client)(request)
expect(response.error).toBeUndefined()
expect(response.result).toBeDefined()
expect(response.method).toBe('tevm_loadState')
expect(response.id).toBe(request.id as any)
})
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comprehensive Testing of loadStateProcedure

The tests cover various scenarios, including single and multiple account states. The use of async/await is appropriate, and the assertions are well-placed to validate the behavior of the procedure.

However, consider adding negative test cases or edge cases to ensure the procedure's robustness under unexpected conditions.

Comment on lines +12 to +71
describe('mineProcedure', () => {
it('should mine a block successfully', async () => {
const request: MineJsonRpcRequest = {
jsonrpc: '2.0',
method: 'tevm_mine',
id: 1,
params: ['0x1', '0x0'],
}

const response = await mineProcedure(client)(request)
expect(response.error).toBeUndefined()
expect(response.result).toBeDefined()
expect(response.method).toBe('tevm_mine')
expect(response.id).toBe(request.id as any)
})

it('should handle mining multiple blocks', async () => {
const request: MineJsonRpcRequest = {
jsonrpc: '2.0',
method: 'tevm_mine',
id: 1,
params: ['0x5', '0x0'],
}

const response = await mineProcedure(client)(request)
expect(response.error).toBeUndefined()
expect(response.result).toBeDefined()
expect(response.method).toBe('tevm_mine')
expect(response.id).toBe(request.id as any)
})

it('should handle mining with interval', async () => {
const request: MineJsonRpcRequest = {
jsonrpc: '2.0',
method: 'tevm_mine',
id: 1,
params: ['0x1', '0x3E8'],
}

const response = await mineProcedure(client)(request)
expect(response.error).toBeUndefined()
expect(response.result).toBeDefined()
expect(response.method).toBe('tevm_mine')
expect(response.id).toBe(request.id as any)
})

it('should handle errors from mineHandler', async () => {
// Simulate an error in mineHandler by providing invalid parameters or mocking mineHandler
const request: MineJsonRpcRequest = {
jsonrpc: '2.0',
method: 'tevm_mine',
id: 1,
params: ['0x0', '0x0'],
}

const response = await mineProcedure(client)(request)
expect(response.error).toBeDefined()
expect(response.error).toMatchSnapshot()
})
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comprehensive Testing of mineProcedure

The tests cover various scenarios including single block mining, multiple blocks, and interval-based mining. The structure of the tests is consistent and logical.

Consider adding more detailed assertions to verify the state changes or effects of mining, beyond just checking the response structure.

Comment on lines +58 to +71
it('should handle requests without an id', async () => {
const request: EthUninstallFilterJsonRpcRequest = {
jsonrpc: '2.0',
method: 'eth_uninstallFilter',
params: [filterId],
}

const response = await ethUninstallFilterJsonRpcProcedure(client)(request)
expect(response.error).toBeUndefined()
expect(response.result).toBe(true)
expect(response.method).toBe('eth_uninstallFilter')
expect(response.id).toBeUndefined()
expect(client.getFilters().has(filterId)).toBe(false)
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handling Requests Without an ID

Testing the procedure's behavior without an ID is important for robustness, but also ensure that the system handles other types of malformed requests.

Comment on lines 12 to 80
describe('ethGetBlockByHashJsonRpcProcedure', () => {
it('should return block details by hash', async () => {
const request: EthGetBlockByHashJsonRpcRequest = {
jsonrpc: '2.0',
method: 'eth_getBlockByHash',
id: 1,
params: [
'0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef', // Example block hash
false, // Do not include transactions
],
}

const response = await ethGetBlockByHashJsonRpcProcedure(client)(request)
expect(response.error).toBeUndefined()
expect(response.result).toBeDefined()
expect(response.method).toBe('eth_getBlockByHash')
expect(response.id).toBe(request.id as any)
expect(response.result).toMatchSnapshot()
})

it('should include transactions if requested', async () => {
const request: EthGetBlockByHashJsonRpcRequest = {
jsonrpc: '2.0',
method: 'eth_getBlockByHash',
id: 1,
params: [
'0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef', // Example block hash
true, // Include transactions
],
}

const response = await ethGetBlockByHashJsonRpcProcedure(client)(request)
expect(response.error).toBeUndefined()
expect(response.result).toBeDefined()
expect(response.method).toBe('eth_getBlockByHash')
expect(response.id).toBe(request.id as any)
expect(response.result).toMatchSnapshot()
})

it('should handle requests without an id', async () => {
const request: EthGetBlockByHashJsonRpcRequest = {
jsonrpc: '2.0',
method: 'eth_getBlockByHash',
params: [
'0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef', // Example block hash
false, // Do not include transactions
],
}

const response = await ethGetBlockByHashJsonRpcProcedure(client)(request)
expect(response.error).toBeUndefined()
expect(response.result).toBeDefined()
expect(response.method).toBe('eth_getBlockByHash')
expect(response.id).toBeUndefined()
expect(response.result).toMatchSnapshot()
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comprehensive Testing of ethGetBlockByHashProcedure

The tests cover scenarios with and without transaction details and handle requests without an ID. Consider adding tests for invalid hash inputs to ensure error handling is robust.

Comment on lines 38 to 59
it('should handle requests without an id', async () => {
const request: EthGasPriceJsonRpcRequest = {
jsonrpc: '2.0',
method: 'eth_gasPrice',
params: [],
}

const response = await gasPriceProcedure({
getVm: client.getVm,
forkTransport: client.forkTransport,
} as any)(request)

expect(response.error).toBeUndefined()
expect(response.result).toBeDefined()
expect(response.method).toBe('eth_gasPrice')
expect(response.id).toBeUndefined()
expect(response.result).toBe(
numberToHex(
await client.getVm().then(async (vm) => (await vm.blockchain.getCanonicalHeadBlock()).header.gasLimit),
),
)
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test Case Review: "should handle requests without an id"

This test case effectively checks the procedure's behavior when the 'id' is missing, which is important for robustness. The same type safety concern applies here as in the previous test case.

Consider the same refactor suggestion to avoid using 'any' for better type safety.

Comment on lines +33 to +34
const response = await ethCallProcedure(client)(request)
expect(response.error).toBeUndefined()
expect(response.result).toBeDefined()
expect(response.method).toBe('eth_call')
expect(response.id).toBe(request.id as any)
expect(response.result).toMatchSnapshot()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider enhancing test assertions for specific result content.

While the use of snapshot testing in line 38 is beneficial for capturing output formats, adding assertions that check for specific values within the response.result could provide a more robust test, ensuring that the function not only returns a result but also the correct result.

Comment on lines +18 to +24
it('should handle eth_chainId', async () => {
const res = await handlers.eth_chainId({
jsonrpc: '2.0',
method: 'eth_chainId',
id: 1,
})
expect(res).toMatchSnapshot()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider enhancing test assertions for specific result content.

While using snapshot testing in line 24 captures the output format, adding assertions that check for specific values within the result could provide a more robust test, ensuring that the handler not only returns a result but also the correct result.

Comment on lines +111 to +120
it('should handle tevm_contract', async () => {
const res = await handlers.tevm_contract({
jsonrpc: '2.0',
method: 'tevm_contract',
id: 1,
})
expect(res).toMatchSnapshot()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider enhancing test assertions for specific result content.

While using snapshot testing in line 117 captures the output format, adding assertions that check for specific values within the result could provide a more robust test, ensuring that the handler not only returns a result but also the correct result.

Comment on lines 101 to 108
it('should handle tevm_mine', async () => {
const res = await handlers.tevm_miner({
jsonrpc: '2.0',
method: 'tevm_mine',
id: 1,
params: ['0x1', '0x1'],
})
expect(res).toMatchSnapshot()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix typo in handler method name for tevm_mine.

The method name tevm_miner on line 102 should be corrected to tevm_mine to match the correct handler name.

- const res = await handlers.tevm_miner({
+ const res = await handlers.tevm_mine({

Aside from the typo, this test case effectively checks the behavior of the tevm_mine handler, ensuring the procedure's reliability under typical use cases.

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. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
it('should handle tevm_mine', async () => {
const res = await handlers.tevm_miner({
jsonrpc: '2.0',
method: 'tevm_mine',
id: 1,
params: ['0x1', '0x1'],
})
expect(res).toMatchSnapshot()
it('should handle tevm_mine', async () => {
const res = await handlers.tevm_mine({
jsonrpc: '2.0',
method: 'tevm_mine',
id: 1,
params: ['0x1', '0x1'],
})
expect(res).toMatchSnapshot()

Comment on lines 32 to 56
it('should return the code of a contract', async () => {
const request: EthGetCodeJsonRpcRequest = {
jsonrpc: '2.0',
method: 'eth_getCode',
id: 1,
params: [contractAddress, 'latest'],
}

const response = await getCodeProcedure({
getVm: client.getVm,
forkClient: {
request: async (req) => {
if (req.method !== 'eth_getCode') {
throw new Error('Invalid method')
}
return SimpleContract.bytecode as any
},
},
})(request)

expect(response.error).toBeUndefined()
expect(response.result).toBeDefined()
expect(response.method).toBe('eth_getCode')
expect(response.id).toBe(request.id as any)
expect(response.result).toBe(SimpleContract.bytecode)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider enhancing test assertions for specific result content.

While the use of snapshot testing in line 56 is beneficial for capturing output formats, adding assertions that check for specific values within the response.result could provide a more robust test, ensuring that the function not only returns a result but also the correct result.

@roninjin10 roninjin10 force-pushed the 06-27-_test_tube_test_add_more_procedures_tests branch from 2c8b698 to d99be9a Compare July 1, 2024 18:58
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Commits

Files that changed from the base of the PR and between 2c8b698 and d99be9a.

Files ignored due to path filters (11)
  • packages/procedures/src/__snapshots__/createHandlers.spec.ts.snap is excluded by !**/*.snap
  • packages/procedures/src/dumpstate/__snapshots__/dumpStateProcedure.spec.ts.snap is excluded by !**/*.snap
  • packages/procedures/src/eth/__snapshots__/blockNumberProcedure.spec.ts.snap is excluded by !**/*.snap
  • packages/procedures/src/eth/__snapshots__/chainIdProcedure.spec.ts.snap is excluded by !**/*.snap
  • packages/procedures/src/eth/__snapshots__/ethBlobBaseFeeProcedure.spec.ts.snap is excluded by !**/*.snap
  • packages/procedures/src/eth/__snapshots__/ethCallProcedure.spec.ts.snap is excluded by !**/*.snap
  • packages/procedures/src/eth/__snapshots__/ethCoinbaseProcedure.spec.ts.snap is excluded by !**/*.snap
  • packages/procedures/src/eth/__snapshots__/ethEstimateGasProcedure.spec.ts.snap is excluded by !**/*.snap
  • packages/procedures/src/eth/__snapshots__/ethGetBlockByNumberProcedure.spec.ts.snap is excluded by !**/*.snap
  • packages/procedures/src/setaccount/__snapshots__/setAccountProcedure.spec.ts.snap is excluded by !**/*.snap
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing (31)
  • packages/blockchain/src/index.ts (1 hunks)
  • packages/procedures/package.json (1 hunks)
  • packages/procedures/src/call/callProcedure.spec.ts (1 hunks)
  • packages/procedures/src/createHandlers.spec.ts (1 hunks)
  • packages/procedures/src/dumpstate/dumpStateProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/blockNumberProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/chainIdProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/ethBlobBaseFeeProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/ethCallProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/ethCoinbaseProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/ethEstimateGasProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/ethGetBlockByHashProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/ethGetBlockByNumberProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/ethGetBlockTransactionCountByHashProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/ethGetBlockTransactionCountByNumberProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/ethGetFilterChangesProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/ethSignTransactionProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/ethUninstallFilterProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/gasPriceProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/getBalanceProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/getCodeProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/getStorageAtProcedure.spec.ts (1 hunks)
  • packages/procedures/src/getaccount/getAccountProcedure.spec.ts (1 hunks)
  • packages/procedures/src/loadstate/loadStateProcedure.spec.ts (1 hunks)
  • packages/procedures/src/mine/mineProcedure.spec.ts (1 hunks)
  • packages/procedures/src/script/scriptProcedure.spec.ts (1 hunks)
  • packages/procedures/src/setaccount/setAccountProcedure.spec.ts (1 hunks)
  • packages/procedures/src/utils/blockToJsonRpcBlock.spec.ts (1 hunks)
  • packages/procedures/src/utils/generateRandomId.spec.ts (1 hunks)
  • packages/procedures/src/utils/parseBlockTag.spec.ts (1 hunks)
  • packages/procedures/src/utils/txToJsonRpcTx.spec.ts (1 hunks)
Files skipped from review as they are similar to previous changes (30)
  • packages/blockchain/src/index.ts
  • packages/procedures/package.json
  • packages/procedures/src/call/callProcedure.spec.ts
  • packages/procedures/src/dumpstate/dumpStateProcedure.spec.ts
  • packages/procedures/src/eth/blockNumberProcedure.spec.ts
  • packages/procedures/src/eth/chainIdProcedure.spec.ts
  • packages/procedures/src/eth/ethBlobBaseFeeProcedure.spec.ts
  • packages/procedures/src/eth/ethCallProcedure.spec.ts
  • packages/procedures/src/eth/ethCoinbaseProcedure.spec.ts
  • packages/procedures/src/eth/ethEstimateGasProcedure.spec.ts
  • packages/procedures/src/eth/ethGetBlockByHashProcedure.spec.ts
  • packages/procedures/src/eth/ethGetBlockByNumberProcedure.spec.ts
  • packages/procedures/src/eth/ethGetBlockTransactionCountByHashProcedure.spec.ts
  • packages/procedures/src/eth/ethGetBlockTransactionCountByNumberProcedure.spec.ts
  • packages/procedures/src/eth/ethGetFilterChangesProcedure.spec.ts
  • packages/procedures/src/eth/ethSignTransactionProcedure.spec.ts
  • packages/procedures/src/eth/ethUninstallFilterProcedure.spec.ts
  • packages/procedures/src/eth/gasPriceProcedure.spec.ts
  • packages/procedures/src/eth/getBalanceProcedure.spec.ts
  • packages/procedures/src/eth/getCodeProcedure.spec.ts
  • packages/procedures/src/eth/getStorageAtProcedure.spec.ts
  • packages/procedures/src/getaccount/getAccountProcedure.spec.ts
  • packages/procedures/src/loadstate/loadStateProcedure.spec.ts
  • packages/procedures/src/mine/mineProcedure.spec.ts
  • packages/procedures/src/script/scriptProcedure.spec.ts
  • packages/procedures/src/setaccount/setAccountProcedure.spec.ts
  • packages/procedures/src/utils/blockToJsonRpcBlock.spec.ts
  • packages/procedures/src/utils/generateRandomId.spec.ts
  • packages/procedures/src/utils/parseBlockTag.spec.ts
  • packages/procedures/src/utils/txToJsonRpcTx.spec.ts
Additional context used
Biome
packages/procedures/src/createHandlers.spec.ts

[error] 10-10: This variable implicitly has the any type.

Variable declarations without type annotation and initialization implicitly have the any type. Declare a type or initialize the variable with some value.

(lint/suspicious/noImplicitAnyLet)

Additional comments not posted (8)
packages/procedures/src/createHandlers.spec.ts (8)

18-24: Consider enhancing test assertions for specific result content.

While using snapshot testing captures the output format, adding assertions that check for specific values within the result could provide a more robust test, ensuring that the handler not only returns a result but also the correct result.


27-43: Consider enhancing test assertions for specific result content.

While using snapshot testing captures the output format, adding assertions that check for specific values within the result could provide a more robust test, ensuring that the handler not only returns a result but also the correct result.


45-54: Consider enhancing test assertions for specific result content.

While using snapshot testing captures the output format, adding assertions that check for specific values within the result could provide a more robust test, ensuring that the handler not only returns a result but also the correct result.


84-99: Consider enhancing test assertions for specific result content.

While using snapshot testing captures the output format, adding assertions that check for specific values within the result could provide a more robust test, ensuring that the handler not only returns a result but also the correct result.


111-117: Consider enhancing test assertions for specific result content.

While using snapshot testing captures the output format, adding assertions that check for specific values within the result could provide a more robust test, ensuring that the handler not only returns a result but also the correct result.


122-129: Consider enhancing test assertions for specific result content.

While using snapshot testing captures the output format, adding assertions that check for specific values within the result could provide a more robust test, ensuring that the handler not only returns a result but also the correct result.


131-138: Consider enhancing test assertions for specific result content.

While using snapshot testing captures the output format, adding assertions that check for specific values within the result could provide a more robust test, ensuring that the handler not only returns a result but also the correct result.


101-108: Fix typo in handler method name for tevm_mine.

The method name tevm_miner on line 102 should be corrected to tevm_mine to match the correct handler name.

- const res = await handlers.tevm_miner({
+ const res = await handlers.tevm_mine({

Aside from the typo, this test case effectively checks the behavior of the tevm_mine handler, ensuring the procedure's reliability under typical use cases.

Likely invalid or redundant comment.

expect(res).toMatchSnapshot()
})

// Add more tests for other handlers as needed...
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reminder: Add more tests for other handlers.

The placeholder comment indicates that additional tests are needed for comprehensive coverage.

Do you want me to generate the additional test cases or open a GitHub issue to track this task?

const ERC20_ADDRESS = `0x${'69'.repeat(20)}` as const

describe('createHandlers', () => {
let client
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specify the type for client to enhance type safety.

The variable client is currently implicitly typed as any. Specifying the type explicitly as BaseClient will adhere to TypeScript best practices and improve type safety.

- let client
+ let client: BaseClient
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. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
let client
let client: BaseClient
Tools
Biome

[error] 10-10: This variable implicitly has the any type.

Variable declarations without type annotation and initialization implicitly have the any type. Declare a type or initialize the variable with some value.

(lint/suspicious/noImplicitAnyLet)

Comment on lines +56 to +82
it('should handle tevm_getAccount', async () => {
await handlers.tevm_setAccount({
jsonrpc: '2.0',
method: 'tevm_setAccount',
id: 1,
params: [
{
address: ERC20_ADDRESS,
deployedBytecode: ERC20.deployedBytecode,
balance: numberToHex(420n),
nonce: numberToHex(69n),
},
],
})
const res = await handlers.tevm_getAccount({
jsonrpc: '2.0',
method: 'tevm_getAccount',
id: 1,
params: [
{
address: ERC20_ADDRESS,
},
],
})
expect(res.error).toBeUndefined()
expect(res).toMatchSnapshot
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix typo in snapshot method and validate test for tevm_getAccount.

The method expect(res).toMatchSnapshot on line 81 is missing call parentheses. Correcting this will ensure the snapshot functionality is correctly invoked.

- expect(res).toMatchSnapshot
+ expect(res).toMatchSnapshot()

Aside from the typo, this test case effectively checks the integration of setting and getting account details in TEVM, ensuring the procedure's reliability under typical use cases.

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. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
it('should handle tevm_getAccount', async () => {
await handlers.tevm_setAccount({
jsonrpc: '2.0',
method: 'tevm_setAccount',
id: 1,
params: [
{
address: ERC20_ADDRESS,
deployedBytecode: ERC20.deployedBytecode,
balance: numberToHex(420n),
nonce: numberToHex(69n),
},
],
})
const res = await handlers.tevm_getAccount({
jsonrpc: '2.0',
method: 'tevm_getAccount',
id: 1,
params: [
{
address: ERC20_ADDRESS,
},
],
})
expect(res.error).toBeUndefined()
expect(res).toMatchSnapshot
})
it('should handle tevm_getAccount', async () => {
await handlers.tevm_setAccount({
jsonrpc: '2.0',
method: 'tevm_setAccount',
id: 1,
params: [
{
address: ERC20_ADDRESS,
deployedBytecode: ERC20.deployedBytecode,
balance: numberToHex(420n),
nonce: numberToHex(69n),
},
],
})
const res = await handlers.tevm_getAccount({
jsonrpc: '2.0',
method: 'tevm_getAccount',
id: 1,
params: [
{
address: ERC20_ADDRESS,
},
],
})
expect(res.error).toBeUndefined()
expect(res).toMatchSnapshot()
})

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Commits

Files that changed from the base of the PR and between d99be9a and 2aab79d.

Files ignored due to path filters (18)
  • packages/procedures/src/__snapshots__/createHandlers.spec.ts.snap is excluded by !**/*.snap
  • packages/procedures/src/call/__snapshots__/callProcedure.spec.ts.snap is excluded by !**/*.snap
  • packages/procedures/src/dumpstate/__snapshots__/dumpStateProcedure.spec.ts.snap is excluded by !**/*.snap
  • packages/procedures/src/eth/__snapshots__/blockNumberProcedure.spec.ts.snap is excluded by !**/*.snap
  • packages/procedures/src/eth/__snapshots__/chainIdProcedure.spec.ts.snap is excluded by !**/*.snap
  • packages/procedures/src/eth/__snapshots__/ethBlobBaseFeeProcedure.spec.ts.snap is excluded by !**/*.snap
  • packages/procedures/src/eth/__snapshots__/ethCallProcedure.spec.ts.snap is excluded by !**/*.snap
  • packages/procedures/src/eth/__snapshots__/ethCoinbaseProcedure.spec.ts.snap is excluded by !**/*.snap
  • packages/procedures/src/eth/__snapshots__/ethEstimateGasProcedure.spec.ts.snap is excluded by !**/*.snap
  • packages/procedures/src/eth/__snapshots__/ethGetBlockByHashProcedure.spec.ts.snap is excluded by !**/*.snap
  • packages/procedures/src/eth/__snapshots__/ethGetBlockByNumberProcedure.spec.ts.snap is excluded by !**/*.snap
  • packages/procedures/src/eth/__snapshots__/ethGetBlockTransactionCountByHashProcedure.spec.ts.snap is excluded by !**/*.snap
  • packages/procedures/src/eth/__snapshots__/ethGetFilterChangesProcedure.spec.ts.snap is excluded by !**/*.snap
  • packages/procedures/src/eth/__snapshots__/gasPriceProcedure.spec.ts.snap is excluded by !**/*.snap
  • packages/procedures/src/eth/__snapshots__/getBalanceProcedure.spec.ts.snap is excluded by !**/*.snap
  • packages/procedures/src/getaccount/__snapshots__/getAccountProcedure.spec.ts.snap is excluded by !**/*.snap
  • packages/procedures/src/mine/__snapshots__/mineProcedure.spec.ts.snap is excluded by !**/*.snap
  • packages/procedures/src/setaccount/__snapshots__/setAccountProcedure.spec.ts.snap is excluded by !**/*.snap
Files selected for processing (24)
  • packages/blockchain/src/index.ts (1 hunks)
  • packages/procedures/package.json (1 hunks)
  • packages/procedures/src/call/callProcedure.spec.ts (1 hunks)
  • packages/procedures/src/createHandlers.spec.ts (1 hunks)
  • packages/procedures/src/dumpstate/dumpStateProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/blockNumberProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/chainIdProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/ethBlobBaseFeeProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/ethCallProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/ethCoinbaseProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/ethEstimateGasProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/ethGetBlockByHashProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/ethGetBlockByNumberProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/ethGetBlockTransactionCountByHashProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/ethGetBlockTransactionCountByNumberProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/ethGetFilterChangesProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/ethUninstallFilterProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/gasPriceProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/getBalanceProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/getCodeProcedure.spec.ts (1 hunks)
  • packages/procedures/src/eth/getStorageAtProcedure.spec.ts (1 hunks)
  • packages/procedures/src/getaccount/getAccountProcedure.spec.ts (1 hunks)
  • packages/procedures/src/loadstate/loadStateProcedure.spec.ts (1 hunks)
  • packages/procedures/src/mine/mineProcedure.spec.ts (1 hunks)
Files skipped from review as they are similar to previous changes (24)
  • packages/blockchain/src/index.ts
  • packages/procedures/package.json
  • packages/procedures/src/call/callProcedure.spec.ts
  • packages/procedures/src/createHandlers.spec.ts
  • packages/procedures/src/dumpstate/dumpStateProcedure.spec.ts
  • packages/procedures/src/eth/blockNumberProcedure.spec.ts
  • packages/procedures/src/eth/chainIdProcedure.spec.ts
  • packages/procedures/src/eth/ethBlobBaseFeeProcedure.spec.ts
  • packages/procedures/src/eth/ethCallProcedure.spec.ts
  • packages/procedures/src/eth/ethCoinbaseProcedure.spec.ts
  • packages/procedures/src/eth/ethEstimateGasProcedure.spec.ts
  • packages/procedures/src/eth/ethGetBlockByHashProcedure.spec.ts
  • packages/procedures/src/eth/ethGetBlockByNumberProcedure.spec.ts
  • packages/procedures/src/eth/ethGetBlockTransactionCountByHashProcedure.spec.ts
  • packages/procedures/src/eth/ethGetBlockTransactionCountByNumberProcedure.spec.ts
  • packages/procedures/src/eth/ethGetFilterChangesProcedure.spec.ts
  • packages/procedures/src/eth/ethUninstallFilterProcedure.spec.ts
  • packages/procedures/src/eth/gasPriceProcedure.spec.ts
  • packages/procedures/src/eth/getBalanceProcedure.spec.ts
  • packages/procedures/src/eth/getCodeProcedure.spec.ts
  • packages/procedures/src/eth/getStorageAtProcedure.spec.ts
  • packages/procedures/src/getaccount/getAccountProcedure.spec.ts
  • packages/procedures/src/loadstate/loadStateProcedure.spec.ts
  • packages/procedures/src/mine/mineProcedure.spec.ts

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Commits

Files that changed from the base of the PR and between 2aab79d and 8b92838.

Files selected for processing (4)
  • packages/blockchain/docs/functions/getBlockFromRpc.md (1 hunks)
  • packages/blockchain/docs/globals.md (1 hunks)
  • tevm/docs/blockchain/README.md (1 hunks)
  • tevm/docs/blockchain/functions/getBlockFromRpc.md (1 hunks)
Files skipped from review due to trivial changes (1)
  • tevm/docs/blockchain/README.md
Additional context used
LanguageTool
tevm/docs/blockchain/functions/getBlockFromRpc.md

[uncategorized] ~9-~9: A punctuation mark might be missing here.
Context: ...namedParameters, common): Promise\<[Block`](../../block/classes/Block.md)> ## Parame...

(AI_EN_LECTOR_MISSING_PUNCTUATION)

Additional comments not posted (3)
packages/blockchain/docs/globals.md (1)

19-19: Ensure consistent formatting for added function entry.

The added function getBlockFromRpc is correctly included in the functions list. Ensure the link and formatting are consistent with other entries.

packages/blockchain/docs/functions/getBlockFromRpc.md (1)

1-29: Ensure clarity and consistency in function documentation.

The documentation for getBlockFromRpc is clear and detailed. Ensure the parameter descriptions are accurate and consistent with the function's implementation.

tevm/docs/blockchain/functions/getBlockFromRpc.md (1)

9-9: Add missing punctuation for clarity.

A punctuation mark might be missing here. Consider adding a period at the end of the line for better readability.

- > **getBlockFromRpc**(`__namedParameters`, `common`): `Promise`\<[`Block`](../../block/classes/Block.md)\>
+ > **getBlockFromRpc**(`__namedParameters`, `common`): `Promise`\<[`Block`](../../block/classes/Block.md)\>.
Tools
LanguageTool

[uncategorized] ~9-~9: A punctuation mark might be missing here.
Context: ...namedParameters, common): Promise\<[Block`](../../block/classes/Block.md)> ## Parame...

(AI_EN_LECTOR_MISSING_PUNCTUATION)

@roninjin10 roninjin10 force-pushed the 06-27-_test_tube_test_add_more_procedures_tests branch from 8b92838 to b3f581f Compare July 2, 2024 02:47
@roninjin10 roninjin10 merged commit d1d20e8 into main Jul 2, 2024
15 of 16 checks passed
@roninjin10 roninjin10 deleted the 06-27-_test_tube_test_add_more_procedures_tests branch July 2, 2024 02:56
@coderabbitai coderabbitai bot mentioned this pull request Sep 13, 2024
1 task
@coderabbitai coderabbitai bot mentioned this pull request Oct 1, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant