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

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

Closed
itslesther opened this issue Apr 25, 2024 · 0 comments
Closed
Assignees
Labels
4.x 4.0 related

Comments

@itslesther
Copy link

itslesther commented Apr 25, 2024

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
@SantiagoDevRel SantiagoDevRel added the 4.x 4.0 related label Apr 25, 2024
@jdevcs jdevcs self-assigned this Jun 4, 2024
@jdevcs jdevcs mentioned this issue Jun 6, 2024
17 tasks
@jdevcs jdevcs closed this as completed Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x 4.0 related
Projects
None yet
Development

No branches or pull requests

3 participants