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

Ethereumex.HttpClient.eth_send_transaction doesnt work for testrpc #1

Closed
izelnakri opened this issue Aug 26, 2017 · 3 comments
Closed

Comments

@izelnakri
Copy link
Collaborator

izelnakri commented Aug 26, 2017

Thanks for writing an API that one-to-one matches the Ethereum JSON RPC. The send transaction doesnt seem to work though:

error code:

{:error,
 %{"code" => -32000,
   "message" => "TypeError: callback is not a function\n    at StateManager.queueTransaction (/usr/local/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:83065:5)\n    at GethApiDouble.eth_sendTransaction (/usr/local/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:82631:14)\n    at GethApiDouble.handleRequest (/usr/local/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:82434:10)\n    at next (/usr/local/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:52153:18)\n    at VmSubprovider.handleRequest (/usr/local/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:59291:12)\n    at next (/usr/local/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:52153:18)\n    at GethDefaults.handleRequest (/usr/local/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:82339:12)\n    at next (/usr/local/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:52153:18)\n    at FilterSubprovider.handleRequest (/usr/local/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:58850:7)\n    at next (/usr/local/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:52153:18)"}}
@ayrat555
Copy link
Member

ayrat555 commented Aug 26, 2017

@izelnakri can you give a little more information about your request? what parameters did you pass?

Request with geth client

params = [%{"data" => "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675",
   "from" => "0xc2b7b953C339c6ec4Bb88fAB5a4d19A033e6c4b1", "gas" => "0x76c0",
   "gasPrice" => "0x9184e72a000",
   "to" => "0xc2b7b953C339c6ec4Bb88fAB5a4d19A033e6c4b1",
   "value" => "0x9184e72a"}]

Ethereumex.HttpClient.eth_send_transaction(params)
{:error, %{"code" => -32000, "message" => "unknown account"}}

@izelnakri
Copy link
Collaborator Author

ohh so it is a map inside a list, not a list, keyword-list or a single map my bad sorry. Would be helpful if we had some typespecs and more tests though.

@ayrat555
Copy link
Member

@izelnakri yes, typespecs would be very helpful. I will add them soon. By the way, pull requests are welcome.

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

No branches or pull requests

2 participants