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

eth_sendTransaction data vs input #6074

Closed
mpetrunic opened this issue May 9, 2023 · 5 comments · Fixed by #6080
Closed

eth_sendTransaction data vs input #6074

mpetrunic opened this issue May 9, 2023 · 5 comments · Fixed by #6080
Assignees
Labels
4.x 4.0 related Bug Addressing a bug

Comments

@mpetrunic
Copy link
Contributor

Hardhat provider expects data field with eth_sendTransaction API which is inconsistent with the spec.

Expected behavior

For web3.js to work in the hardhat.

Actual behavior

The transaction gets reverted because of the missing data field. Alternatively, we can try to patch the provider in the hardhat-web3 package.

Steps to reproduce the behavior

  1. [First step]
  2. [Second step]
  3. [and so on...]

Logs

Environment

@mpetrunic mpetrunic added Bug Addressing a bug 4.x 4.0 related labels May 9, 2023
@mpetrunic
Copy link
Contributor Author

Potential solution, send both input and data

@mpetrunic
Copy link
Contributor Author

cc @spacesailor24

@mpetrunic
Copy link
Contributor Author

This is blocking: web3/hardhat#1

@spacesailor24 spacesailor24 self-assigned this May 10, 2023
@spacesailor24
Copy link
Contributor

Submitting both input and data seems to be fine for both Geth and Ganache. However, getTransaction only returns input for both clients

@mpetrunic @web3/web3-js Should we format the response for getTransaction to return data when only input is present and vice versa, or just leave it as whatever the client returns? One downside of leaving it as is, if a user submits tx.data, they'd probably expect to be able to access data like so: (await getTransaction(txHash)).data

@mpetrunic
Copy link
Contributor Author

@spacesailor24 I think it's fine to leave only "input" for getTransaction. We have return types (and docs) in place so if user tries to use .data it will get type error.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
4.x 4.0 related Bug Addressing a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants