Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Unhandled Exception: RPCError: got code -32602 with msg "too many arguments, want at most 1" #61

Closed
YDJSZY opened this issue Oct 14, 2019 · 7 comments

Comments

@YDJSZY
Copy link

YDJSZY commented Oct 14, 2019

I have upgraded the libary. This is my code:
var gas = await web3client.estimateGas();
It throw error "got code -32602 with msg "too many arguments, want at most 1".
This is detail error:
ui_dart_state.cc(148)] Unhandled Exception: RPCError: got code -32602 with msg "too many arguments, want at most 1".
#0 JsonRPC.call (package:web3dart/json_rpc.dart:49:7)

#1 Web3Client._makeRPCCall (package:web3dart/src/core/client.dart:58:35)

#2 Web3Client.estimateGas (package:web3dart/src/core/client.dart:325:29)

@hamza-imran75
Copy link

Check this code out:
8215178

@YDJSZY
Copy link
Author

YDJSZY commented Oct 14, 2019

@iceman750 What do you mean? Now my web3dart version is 1.2.0

@simolus3
Copy link
Owner

Which Ethereum client are you connecting to? The rpc docs specify two parameters on the eth_estimate call, so I'm wondering why a node would reject that

@YDJSZY
Copy link
Author

YDJSZY commented Oct 14, 2019

@simolus3 I connecting to test network.

@YDJSZY
Copy link
Author

YDJSZY commented Oct 14, 2019

I think that rpc specify one parameters. I found it in https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_estimategas

@simolus3
Copy link
Owner

The docs from eth_estimateGas say that they support the same parameters as eth_call, which has a second argument to specify the block number, so I assumed that the block number argument was supported on the estimate call as well.
The node I used to test this didn't complain about the second parameter, but infura does. I've just released 1.2.1 which deprecates the atBlock parameter and doesn't send it. This should fix the problem.

@YDJSZY
Copy link
Author

YDJSZY commented Oct 14, 2019

It work! Thank you very much!!!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants