ethereumjs / eth-query

minimal rpc wrapper
28 stars 17 forks source link

error while attempting `eth_getCompilers` using TestRPC #2

Closed SilentCicero closed 7 years ago

SilentCicero commented 7 years ago
const EthQuery = require('eth-query');
const TestRPC = require('ethereumjs-testrpc');
const query = new EthQuery(TestRPC.provider());

query.getCompilers(function (err, result) {
    console.log(err, result);
});
ethquery failure { method: 'eth_getCompilers', params: [] } ReferenceError: cb is not defined
    at SolcSubprovider.handleRequest (/home/nick/github/ethjs-query/node_modules/web3-provider-engine/subproviders/solc.js:20:7)
    at next (/home/nick/github/ethjs-query/node_modules/web3-provider-engine/index.js:95:18)
    at VmSubprovider.handleRequest (/home/nick/github/ethjs-query/node_modules/web3-provider-engine/subproviders/vm.js:40:12)
    at next (/home/nick/github/ethjs-query/node_modules/web3-provider-engine/index.js:95:18)
    at GethDefaults.handleRequest (/home/nick/github/ethjs-query/node_modules/ethereumjs-testrpc/lib/subproviders/gethdefaults.js:17:12)
    at next (/home/nick/github/ethjs-query/node_modules/web3-provider-engine/index.js:95:18)
    at FilterSubprovider.handleRequest (/home/nick/github/ethjs-query/node_modules/web3-provider-engine/subproviders/filters.js:87:7)
    at next (/home/nick/github/ethjs-query/node_modules/web3-provider-engine/index.js:95:18)
    at DelayedBlockFilter.handleRequest (/home/nick/github/ethjs-query/node_modules/ethereumjs-testrpc/lib/subproviders/delayedblockfilter.js:27:3)
    at next (/home/nick/github/ethjs-query/node_modules/web3-provider-engine/index.js:95:18)
    at ReactiveBlockTracker.handleRequest (/home/nick/github/ethjs-query/node_modules/ethereumjs-testrpc/lib/subproviders/reactiveblocktracker.js:25:12)
    at next (/home/nick/github/ethjs-query/node_modules/web3-provider-engine/index.js:95:18)
    at RequestFunnel.handleRequest (/home/nick/github/ethjs-query/node_modules/ethereumjs-testrpc/lib/subproviders/requestfunnel.js:32:12)
    at next (/home/nick/github/ethjs-query/node_modules/web3-provider-engine/index.js:95:18)
    at Web3ProviderEngine._handleAsync (/home/nick/github/ethjs-query/node_modules/web3-provider-engine/index.js:82:3)
    at Timeout._onTimeout (/home/nick/github/ethjs-query/node_modules/web3-provider-engine/index.js:66:12)
    at tryOnTimeout (timers.js:232:11)
    at Timer.listOnTimeout (timers.js:202:5)
ReferenceError: cb is not defined
    at SolcSubprovider.handleRequest (/home/nick/github/ethjs-query/node_modules/web3-provider-engine/subproviders/solc.js:20:7)
    at next (/home/nick/github/ethjs-query/node_modules/web3-provider-engine/index.js:95:18)
    at VmSubprovider.handleRequest (/home/nick/github/ethjs-query/node_modules/web3-provider-engine/subproviders/vm.js:40:12)
    at next (/home/nick/github/ethjs-query/node_modules/web3-provider-engine/index.js:95:18)
    at GethDefaults.handleRequest (/home/nick/github/ethjs-query/node_modules/ethereumjs-testrpc/lib/subproviders/gethdefaults.js:17:12)
    at next (/home/nick/github/ethjs-query/node_modules/web3-provider-engine/index.js:95:18)
    at FilterSubprovider.handleRequest (/home/nick/github/ethjs-query/node_modules/web3-provider-engine/subproviders/filters.js:87:7)
    at next (/home/nick/github/ethjs-query/node_modules/web3-provider-engine/index.js:95:18)
    at DelayedBlockFilter.handleRequest (/home/nick/github/ethjs-query/node_modules/ethereumjs-testrpc/lib/subproviders/delayedblockfilter.js:27:3)
    at next (/home/nick/github/ethjs-query/node_modules/web3-provider-engine/index.js:95:18)
    at ReactiveBlockTracker.handleRequest (/home/nick/github/ethjs-query/node_modules/ethereumjs-testrpc/lib/subproviders/reactiveblocktracker.js:25:12)
    at next (/home/nick/github/ethjs-query/node_modules/web3-provider-engine/index.js:95:18)
    at RequestFunnel.handleRequest (/home/nick/github/ethjs-query/node_modules/ethereumjs-testrpc/lib/subproviders/requestfunnel.js:32:12)
    at next (/home/nick/github/ethjs-query/node_modules/web3-provider-engine/index.js:95:18)
    at Web3ProviderEngine._handleAsync (/home/nick/github/ethjs-query/node_modules/web3-provider-engine/index.js:82:3)
    at Timeout._onTimeout (/home/nick/github/ethjs-query/node_modules/web3-provider-engine/index.js:66:12)
    at tryOnTimeout (timers.js:232:11)
    at Timer.listOnTimeout (timers.js:202:5) undefined
      ✓ should function while eth_getCompilers

I'm assuming TestRPC is giving some kind of weird error that eth-query is not expecting in the sendAsync method. Could be on the provider level too.

jorpic commented 7 years ago

I think this is fixed in web3-provider-engine@8.1.10: https://github.com/MetaMask/provider-engine/pull/99