mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
6d1170f06c
Co-authored-by: Mark Stacey <markjstacey@gmail.com> Co-authored-by: ricky <ricky.miller@gmail.com> Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com> Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com> Co-authored-by: legobt <6wbvkn0j@anonaddy.me> Co-authored-by: Pedro Figueiredo <pedro.figueiredo@consensys.net>
28 lines
1.0 KiB
Diff
28 lines
1.0 KiB
Diff
diff --git a/index.js b/index.js
|
|
index 13e9f3c25e7d3bee6a4ec3c2c5e1eea31e86a377..18b050ded27baf3603708fd6d595a554ea3c19c8 100644
|
|
--- a/index.js
|
|
+++ b/index.js
|
|
@@ -1,9 +1,9 @@
|
|
const extend = require('xtend')
|
|
const createRandomId = require('json-rpc-random-id')()
|
|
+const debug = require('debug')('eth-query')
|
|
|
|
module.exports = EthQuery
|
|
|
|
-
|
|
function EthQuery(provider){
|
|
const self = this
|
|
self.currentProvider = provider
|
|
@@ -63,7 +63,10 @@ EthQuery.prototype.submitHashrate = generateFnFor('eth_subm
|
|
|
|
EthQuery.prototype.sendAsync = function(opts, cb){
|
|
const self = this
|
|
- self.currentProvider.sendAsync(createPayload(opts), function(err, response){
|
|
+ const payload = createPayload(opts)
|
|
+ debug('making request %o', payload)
|
|
+ self.currentProvider.sendAsync(payload, function(err, response){
|
|
+ debug('got err = %o, response = %o', err, response)
|
|
if (!err && response.error) err = new Error('EthQuery - RPC Error - '+response.error.message)
|
|
if (err) return cb(err)
|
|
cb(null, response.result)
|