-
Notifications
You must be signed in to change notification settings - Fork 5k
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/docs/plugin-middleware #7158
Conversation
Bundle StatsHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset No files were changed View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger No assets were bigger Smaller No assets were smaller Unchanged
|
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.
Benchmark
Benchmark suite | Current: eb29499 | Previous: 5f6deeb | Ratio |
---|---|---|---|
processingTx |
8887 ops/sec (±4.94% ) |
9233 ops/sec (±3.97% ) |
1.04 |
processingContractDeploy |
39097 ops/sec (±7.05% ) |
40168 ops/sec (±4.88% ) |
1.03 |
processingContractMethodSend |
16534 ops/sec (±7.46% ) |
16302 ops/sec (±6.45% ) |
0.99 |
processingContractMethodCall |
28387 ops/sec (±6.22% ) |
28306 ops/sec (±6.19% ) |
1.00 |
abiEncode |
43396 ops/sec (±6.78% ) |
42794 ops/sec (±8.67% ) |
0.99 |
abiDecode |
30773 ops/sec (±5.83% ) |
31117 ops/sec (±7.21% ) |
1.01 |
sign |
1525 ops/sec (±3.92% ) |
1588 ops/sec (±0.64% ) |
1.04 |
verify |
366 ops/sec (±0.47% ) |
367 ops/sec (±0.70% ) |
1.00 |
This comment was automatically generated by workflow using github-action-benchmark.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 4.x #7158 +/- ##
=======================================
Coverage 94.45% 94.46%
=======================================
Files 215 215
Lines 8391 8396 +5
Branches 2313 2315 +2
=======================================
+ Hits 7926 7931 +5
Misses 465 465
Flags with carried forward coverage won't be shown. Click here to find out more. |
|
||
### Request Middleware | ||
|
||
Request middleware allows plugins to modify RPC requests before they are sent to the network and modify RPC responses before they are returned to the user. Request middleware must implement the [`RequestManagerMiddleware`](/api/web3-core/interface/RequestManagerMiddleware) interface, which specifies two functions: [`processRequest`](/api/web3-core/interface/RequestManagerMiddleware#processRequest) and [`processResponse`](/api/web3-core/interface/RequestManagerMiddleware#processResponse). Here is a simple example of request middleware that prints RPC requests and responses to the console: |
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.
Request middleware allows plugins to modify RPC requests before they are sent to the network and modify RPC responses before they are returned to the user. Request middleware must implement the [`RequestManagerMiddleware`](/api/web3-core/interface/RequestManagerMiddleware) interface, which specifies two functions: [`processRequest`](/api/web3-core/interface/RequestManagerMiddleware#processRequest) and [`processResponse`](/api/web3-core/interface/RequestManagerMiddleware#processResponse). Here is a simple example of request middleware that prints RPC requests and responses to the console: | |
Request middleware allows plugins to modify RPC requests before they are sent to the network and modify RPC responses before they are returned to the web3.js lib's other packages for internal processing. Request middleware must implement the [`RequestManagerMiddleware`](/api/web3-core/interface/RequestManagerMiddleware) interface, which specifies two functions: [`processRequest`](/api/web3-core/interface/RequestManagerMiddleware#processRequest) and [`processResponse`](/api/web3-core/interface/RequestManagerMiddleware#processResponse). Here is a simple example of request middleware that prints RPC requests and responses to the console: |
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.
@danforbes looks good, thanks.
I suggested a change before merging.
Add plugin middleware documentation
Closes #6963