Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Error when processing transaction before signing using the plugin middleware #7002

@itslesther

Description

@itslesther

Expected behavior

I want to edit the "data" field in the transaction object when calling web3.eth.call, web3.eth.estimateGas and web3.eth.SendTransaction. I'm using the middleware to intercept the rpc request and edit that field.

Actual behavior

web3.eth.call and web3.eth.estimateGas works fine but web3.eth.SendTransaction fails because the transaction is signed before it's intercepted by the middleware. Under the hood web3.eth.SendTransaction calls web3.eth.call and web3.eth.estimateGas (among other calls) which edits the "data" field fine, but when signing the transaction, it signes the transaction without the edited field

Steps to reproduce the behavior

  1. Create a plugin and middleware
  2. Intercept eth_estimateGas, eth_call, eth_sendTransaction rpc calls
  3. Register the plugin
  4. Call web3.eth.sendTransaction

Metadata

Metadata

Assignees

Labels

4.x4.0 related

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions