-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
♻️ Chore: Move proxy behavior to base tevm class #816
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Current dependencies on/for this PR:
This stack of pull requests is managed by Graphite. |
WalkthroughThe changes across these files reflect a significant refactoring of the 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 (
|
6eb7d4b
to
2722a06
Compare
b9ebab9
to
cf5b390
Compare
2722a06
to
c02847d
Compare
cf5b390
to
337e147
Compare
c02847d
to
0b4869f
Compare
435e147
to
dcdf271
Compare
dcdf271
to
eee903c
Compare
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files ignored due to filter (6)
- extensions/viem/package.json
- nx.json
- pnpm-lock.yaml
- vm/client/package.json
- vm/server/package.json
- vm/vm/package.json
Files selected for processing (19)
- extensions/viem/src/tevmViemExtension.spec.ts (2 hunks)
- tevm/docs/modules/index.md (1 hunks)
- tevm/docs/modules/vm.md (4 hunks)
- vm/client/src/createRemoteClient.spec.ts (2 hunks)
- vm/server/docs/modules.md (1 hunks)
- vm/server/src/createHttpHandler.js (4 hunks)
- vm/server/src/test/DaiContract.sol.ts (1 hunks)
- vm/server/src/test/createHttpHandler.spec.ts (2 hunks)
- vm/vm/docs/classes/NoProxyConfiguredError.md (1 hunks)
- vm/vm/docs/classes/ProxyFetchError.md (1 hunks)
- vm/vm/docs/classes/UnexpectedInternalServerError.md (1 hunks)
- vm/vm/docs/modules.md (6 hunks)
- vm/vm/src/Tevm.ts (2 hunks)
- vm/vm/src/createTevm.js (2 hunks)
- vm/vm/src/errors/index.js (1 hunks)
- vm/vm/src/index.js (1 hunks)
- vm/vm/src/index.ts (1 hunks)
- vm/vm/src/processRequest.js (1 hunks)
- vm/vm/src/proxyRequest.js (1 hunks)
Files skipped from review due to trivial changes (2)
- tevm/docs/modules/index.md
- vm/server/docs/modules.md
Additional comments: 23
vm/vm/src/index.js (1)
- 1-2: The changes to the exports in
index.js
look good and are consistent with the refactoring effort to centralize error handling.vm/vm/src/errors/index.js (1)
- 1-3: The export of new error classes
NoProxyConfiguredError
,ProxyFetchError
, andUnexpectedInternalServerError
is correct and aligns with the refactoring to improve error handling.vm/vm/src/index.ts (1)
- 3-6: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [1-6]
The addition of the export for all entities from the 'errors' module in
index.ts
is consistent with the changes in the JavaScript index file and supports the centralized error handling strategy.vm/vm/src/processRequest.js (1)
- 1-1: The update to the import path for
UnexpectedInternalServerError
inprocessRequest.js
is correct and reflects the new location of the error classes.vm/vm/src/Tevm.ts (1)
- 1-1: The removal of the
createHttpHandler
import and property from theTevm
type is consistent with the refactoring to move proxy behavior to the basetevm
class.vm/vm/src/proxyRequest.js (1)
- 1-1: The consolidation of error imports in
proxyRequest.js
is correct and aligns with the centralized error handling approach.vm/server/src/test/createHttpHandler.spec.ts (1)
- 1-1: The renaming of the imported function to
createHttpHandler
and the update to the function call increateHttpHandler.spec.ts
are correct and reflect the changes in the HTTP handler creation process.extensions/viem/src/tevmViemExtension.spec.ts (1)
- 4-4: The addition of the
createHttpHandler
import from@tevm/server
and the modification to thecreateServer
function call intevmViemExtension.spec.ts
are correct and reflect the new way of creating the HTTP handler.tevm/docs/modules/vm.md (1)
- 83-83: The documentation update in
vm.md
correctly removes thecreateHttpHandler
property from theTevm
type, aligning with the code changes.vm/vm/src/createTevm.js (2)
2-2: The addition of the
processRequest
import increateTevm.js
is correct and necessary for the refactored request handling.80-80: The update to the
request
property to include theprocessRequest
function call with an additional argument is correct and reflects the new centralized request handling mechanism.vm/client/src/createRemoteClient.spec.ts (2)
5-5: The addition of the
createHttpHandler
import from@tevm/server
increateRemoteClient.spec.ts
is correct and reflects the changes in the HTTP handler creation process.18-20: The modification to the
createServer
call to use the newly importedcreateHttpHandler
with a modified configuration object is correct and aligns with the refactoring efforts.vm/vm/docs/modules.md (1)
- 9-11: The addition of new classes
NoProxyConfiguredError
,ProxyFetchError
, andUnexpectedInternalServerError
inmodules.md
is correct and provides the necessary documentation for the new error handling classes.vm/server/src/createHttpHandler.js (2)
6-6: The update to the
CreateHttpHandlerParameters
type to include arequest
property of typeTevmJsonRpcRequestHandler
is correct and reflects the new function signature.37-37: The refactoring of the
createHttpHandler
function to accept a singleparameters
object and use theparameters.request
function for processing requests is correct and aligns with the centralized request handling approach.vm/vm/docs/classes/ProxyFetchError.md (1)
- 1-1: The documentation for the
ProxyFetchError
class inProxyFetchError.md
is correct and provides the necessary information about the class hierarchy, constructors, properties, and methods.vm/vm/docs/classes/NoProxyConfiguredError.md (1)
- 1-1: The documentation for the
NoProxyConfiguredError
class inNoProxyConfiguredError.md
is correct and provides the necessary information about the class hierarchy, constructors, properties, and methods.vm/vm/docs/classes/UnexpectedInternalServerError.md (1)
- 1-1: The documentation for the
UnexpectedInternalServerError
class inUnexpectedInternalServerError.md
is correct and provides the necessary information about the class hierarchy, constructors, properties, and methods.vm/server/src/test/DaiContract.sol.ts (4)
1-1: The import statement for
Address
from 'viem' is correct and follows TypeScript conventions.3-4: The
deployedBytecode
variable is a string representing the bytecode of the contract. Ensure that this bytecode corresponds to the compiled result of the Solidity contract it represents.5-250: The ABI array is well-defined and matches the expected structure for an ERC20 token contract. Each function and event is correctly typed with appropriate inputs and outputs.
252-281: The exported
DaiContract
object correctly structures theread
andscript
methods to interact with the contract. The use of TypeScript'sas const
ensures that the object's structure is readonly and cannot be altered, which is a good practice for ABI definitions.
Description
We need this behavior in the base tevm class to implement ethers memory provider
Testing
Explain the quality checks that have been done on the code changes
Additional Information
Your ENS/address:
Summary by CodeRabbit
New Features
Documentation
Refactor
Bug Fixes
Style