Socket
Socket
Sign inDemoInstall

ethjs

Package Overview
Dependencies
Maintainers
2
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ethjs - npm Package Compare versions

Comparing version 0.3.4 to 0.3.5

6

CHANGELOG.md

@@ -1,3 +0,7 @@

# 0.3.4 -- getTransactionSuccess
# 0.3.5 -- Fix getTransactionSuccess unhandled promise rejection
1. Fix getTx unhandled promise rejection
# 0.3.4 -- EthJS-RPC
1. Fix RPC unhandled promise rejection.

@@ -4,0 +8,0 @@

17

lib/lib/getTransactionSuccess.js

@@ -9,6 +9,4 @@ "use strict";

var interval = eth.options.interval || 7000;
var noop = function noop() {};
var cb = callback || noop;
return new Promise(function (resolve, reject) {
var prom = new Promise(function (resolve, reject) {
var txInterval = setInterval(function () {

@@ -18,3 +16,2 @@ eth.getTransactionReceipt(txHash, function (err, result) {

clearInterval(txInterval);
cb(err, null);
reject(err);

@@ -25,3 +22,2 @@ }

clearInterval(txInterval);
cb(null, result);
resolve(result);

@@ -34,3 +30,2 @@ }

var errMessage = "Receipt timeout waiting for tx hash: " + txHash;
cb(errMessage, null);
reject(errMessage);

@@ -42,3 +37,13 @@ }

});
if (callback) {
prom.then(function (res) {
return callback(null, res);
})["catch"](function (err) {
return callback(err, null);
});
}
return callback ? null : prom;
};
};

@@ -225,3 +225,3 @@ {

},
"version": "0.3.4"
"version": "0.3.5"
}

@@ -6,6 +6,4 @@ module.exports = eth => (txHash, callback) => {

const interval = eth.options.interval || 7000;
const noop = () => {};
const cb = callback || noop;
return new Promise((resolve, reject) => {
const prom = new Promise((resolve, reject) => {
const txInterval = setInterval(() => {

@@ -15,3 +13,2 @@ eth.getTransactionReceipt(txHash, (err, result) => {

clearInterval(txInterval);
cb(err, null);
reject(err);

@@ -22,3 +19,2 @@ }

clearInterval(txInterval);
cb(null, result);
resolve(result);

@@ -31,3 +27,2 @@ }

const errMessage = `Receipt timeout waiting for tx hash: ${txHash}`;
cb(errMessage, null);
reject(errMessage);

@@ -39,2 +34,8 @@ }

});
if (callback) {
prom.then(res => callback(null, res)).catch(err => callback(err, null));
}
return callback ? null : prom;
};

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc