tessl install tessl/pypi-web3@7.13.0A Python library for interacting with Ethereum blockchain
Agent Success
Agent success rate when using this tile
88%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.01x
Baseline
Agent success rate without this tile
87%
Implement a request logging system for Ethereum JSON-RPC calls that tracks all requests and responses through a custom middleware component.
Create a middleware component that:
The middleware should capture:
Implement a RequestLogger class with:
get_middleware() that returns the middleware functionget_request_count() that returns the total number of requests madeget_call_history() that returns a list of all logged callsEach entry in the call history should be a dictionary containing:
method: the JSON-RPC method nameparams: the request parametersresponse: the response datatimestamp: ISO format timestamp stringSetup:
Expected:
Setup:
Expected:
Setup:
Expected:
A Python library for interacting with Ethereum blockchain, providing middleware support for request pipeline customization.
Create the following files:
Implement the RequestLogger class with the required methods.
Implement the test cases to verify the middleware functionality.