From 8dae261d2015138243e7cf7d18e63d7b602a27d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Venturo?= Date: Thu, 29 Nov 2018 19:09:36 -0300 Subject: [PATCH] Deleted transactionMined (unused). (#1527) --- test/helpers/transactionMined.js | 34 -------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 test/helpers/transactionMined.js diff --git a/test/helpers/transactionMined.js b/test/helpers/transactionMined.js deleted file mode 100644 index 77401ead6..000000000 --- a/test/helpers/transactionMined.js +++ /dev/null @@ -1,34 +0,0 @@ -// From https://gist.github.com/xavierlepretre/88682e871f4ad07be4534ae560692ee6 -function transactionMined (txnHash, interval) { - interval = interval || 500; - const transactionReceiptAsync = function (txnHash, resolve, reject) { - try { - const receipt = web3.eth.getTransactionReceipt(txnHash); - if (receipt === null) { - setTimeout(function () { - transactionReceiptAsync(txnHash, resolve, reject); - }, interval); - } else { - resolve(receipt); - } - } catch (e) { - reject(e); - } - }; - - if (Array.isArray(txnHash)) { - return Promise.all(txnHash.map(hash => - web3.eth.getTransactionReceiptMined(hash, interval) - )); - } else { - return new Promise(function (resolve, reject) { - transactionReceiptAsync(txnHash, resolve, reject); - }); - } -} - -web3.eth.transactionMined = transactionMined; - -module.exports = { - transactionMined, -};