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

Data is missing from methods.myMethod #6355

Closed
luu-alex opened this issue Aug 14, 2023 · 1 comment · Fixed by moshmage/web3.js#1
Closed

Data is missing from methods.myMethod #6355

luu-alex opened this issue Aug 14, 2023 · 1 comment · Fixed by moshmage/web3.js#1
Assignees
Labels
4.x 4.0 related Bug Addressing a bug Estimate Investigate

Comments

@luu-alex
Copy link
Contributor

needs investigation, from discord user. Looks like the change from data/input has affected methods.mymethod:
Is there a way to force the format of the jsonRPC calls made by methods.myMethod to include the right fields?

Currently generates (4.1.0rc)

{"jsonrpc":"2.0","id":"b4c23746-97b2-4512-9dc2-2492d81151ce","method":"eth_call","params":[{"to":"0x5FbDB2315678afecb367f032d93F642f64180aa3","input":"0x70a082310000000000000000000000007a06dcfb82c84eb0e94bec11161012a3374ad98f"},"latest"]}

4.0.3

{"jsonrpc":"2.0","id":"b4c23746-97b2-4512-9dc2-2492d81151ce","method":"eth_call","params":[{"to":"0x5FbDB2315678afecb367f032d93F642f64180aa3","input":"0x70a082310000000000000000000000007a06dcfb82c84eb0e94bec11161012a3374ad98f","data":"0x70a082310000000000000000000000007a06dcfb82c84eb0e94bec11161012a3374ad98f"},"latest"]}

When it should be generating

{"jsonrpc":"2.0","id":"b4c23746-97b2-4512-9dc2-2492d81151ce","method":"eth_call","params":[{"to":"0x5FbDB2315678afecb367f032d93F642f64180aa3","data":"0x70a082310000000000000000000000007a06dcfb82c84eb0e94bec11161012a3374ad98f"},"latest"]}

Using either option currently gets met with:

{
    "jsonrpc": "2.0",
    "id": "b4c23746-97b2-4512-9dc2-2492d81151ce",
    "error": {
        "code": -32602,
        "message": "unknown field `input`, expected one of `from`, `to`, `gasPrice`, `maxFeePerGas`, `maxPriorityFeePerGas`, `gas`, `value`, `data`, `nonce`, `chainId`, `accessList`, `type`"
    }
}

Expected behavior

Actual behavior

Steps to reproduce the behavior

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

Logs

Environment

@luu-alex
Copy link
Contributor Author

This will be included in the next release which will be a minor version update. In the meantime you can use the dev branch which includes all the latest merges https://www.npmjs.com/package/web3?activeTab=versions latest dev version is 4.1.2-dev.e4ba45c.0 . As well updated docs for this

@jdevcs jdevcs mentioned this issue Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x 4.0 related Bug Addressing a bug Estimate Investigate
Projects
None yet
2 participants