From 6075d89ee5e7a66d9ac9c91a85eff48b7f34fb7c Mon Sep 17 00:00:00 2001 From: nivida Date: Tue, 15 Oct 2019 13:18:10 +0200 Subject: [PATCH 1/8] transactionBlockTimeout, transactionConfirmationBlock, and transactionPollingTimeout property added to the Eth, Contract, and Method class --- packages/web3-bzz/package-lock.json | 4 +- packages/web3-core-method/src/index.js | 17 ++++---- packages/web3-eth-contract/src/index.js | 6 +++ packages/web3-eth/src/index.js | 57 +++++++++++++++++++++++++ 4 files changed, 74 insertions(+), 10 deletions(-) diff --git a/packages/web3-bzz/package-lock.json b/packages/web3-bzz/package-lock.json index 4c1dbdc4cd6..d97a94d54fb 100644 --- a/packages/web3-bzz/package-lock.json +++ b/packages/web3-bzz/package-lock.json @@ -1,6 +1,8 @@ { - "requires": true, + "name": "web3-bzz", + "version": "1.2.1", "lockfileVersion": 1, + "requires": true, "dependencies": { "@sindresorhus/is": { "version": "0.14.0", diff --git a/packages/web3-core-method/src/index.js b/packages/web3-core-method/src/index.js index a67c62a2dcc..8880661596f 100644 --- a/packages/web3-core-method/src/index.js +++ b/packages/web3-core-method/src/index.js @@ -30,10 +30,6 @@ var utils = require('web3-utils'); var promiEvent = require('web3-core-promievent'); var Subscriptions = require('web3-core-subscriptions').subscriptions; -var TIMEOUTBLOCK = 50; -var POLLINGTIMEOUT = 15 * TIMEOUTBLOCK; // ~average block time (seconds) * TIMEOUTBLOCK -var CONFIRMATIONBLOCKS = 24; - var Method = function Method(options) { if(!options.call || !options.name) { @@ -55,6 +51,9 @@ var Method = function Method(options) { this.defaultBlock = options.defaultBlock || 'latest'; this.defaultAccount = options.defaultAccount || null; + this.transactionBlockTimeout = options.transactionBlockTimeout || 50; + this.transactionConfirmationBlocks = options.transactionConfirmationBlocks || 24; + this.transactionPollingTimeout = options.transactionPollingTimeout || 750; }; Method.prototype.setRequestManager = function (requestManager, accounts) { @@ -283,7 +282,7 @@ Method.prototype._confirmTransaction = function (defer, result, payload) { canUnsubscribe = false; confirmationCount++; - if (confirmationCount === CONFIRMATIONBLOCKS + 1) { // add 1 so we account for conf 0 + if (confirmationCount === method.transactionConfirmationBlocks + 1) { // add 1 so we account for conf 0 sub.unsubscribe(); defer.eventEmitter.removeAllListeners(); } @@ -383,14 +382,14 @@ Method.prototype._confirmTransaction = function (defer, result, payload) { // check to see if we are http polling if(!!isPolling) { - // polling timeout is different than TIMEOUTBLOCK blocks since we are triggering every second - if (timeoutCount - 1 >= POLLINGTIMEOUT) { + // polling timeout is different than transactionBlockTimeout blocks since we are triggering every second + if (timeoutCount - 1 >= method.transactionPollingTimeout) { sub.unsubscribe(); promiseResolved = true; - utils._fireError(new Error('Transaction was not mined within' + POLLINGTIMEOUT + ' seconds, please make sure your transaction was properly sent. Be aware that it might still be mined!'), defer.eventEmitter, defer.reject); + utils._fireError(new Error('Transaction was not mined within' + method.transactionPollingTimeout + ' seconds, please make sure your transaction was properly sent. Be aware that it might still be mined!'), defer.eventEmitter, defer.reject); } } else { - if (timeoutCount - 1 >= TIMEOUTBLOCK) { + if (timeoutCount - 1 >= method.transactionBlockTimeout) { sub.unsubscribe(); promiseResolved = true; utils._fireError(new Error('Transaction was not mined within 50 blocks, please make sure your transaction was properly sent. Be aware that it might still be mined!'), defer.eventEmitter, defer.reject); diff --git a/packages/web3-eth-contract/src/index.js b/packages/web3-eth-contract/src/index.js index b5bfdec1976..d85aa0e6fe8 100644 --- a/packages/web3-eth-contract/src/index.js +++ b/packages/web3-eth-contract/src/index.js @@ -180,6 +180,9 @@ var Contract = function Contract(jsonInterface, address, options) { // get default account from the Class var defaultAccount = this.constructor.defaultAccount; var defaultBlock = this.constructor.defaultBlock || 'latest'; + this.transactionBlockTimeout = this.constructor.transactionBlockTimeout; + this.transactionConfirmationBlocks = this.constructor.transactionConfirmationBlocks; + this.transactionPollingTimeout = this.constructor.transactionPollingTimeout; Object.defineProperty(this, 'defaultAccount', { get: function () { @@ -891,6 +894,9 @@ Contract.prototype._executeMethod = function _executeMethod(){ accounts: _this.constructor._ethAccounts || _this._ethAccounts, // is eth.accounts (necessary for wallet signing) defaultAccount: _this._parent.defaultAccount, defaultBlock: _this._parent.defaultBlock, + transactionBlockTimeout: _this._parent.transactionBlockTimeout, + transactionConfirmationBlocks: _this._parent.transactionConfirmationBlocks, + transactionPollingTimeout: _this._parent.transactionPollingTimeout, extraFormatters: extraFormatters })).createFunction(); diff --git a/packages/web3-eth/src/index.js b/packages/web3-eth/src/index.js index c6b1dec712f..77ddbca5520 100644 --- a/packages/web3-eth/src/index.js +++ b/packages/web3-eth/src/index.js @@ -81,7 +81,61 @@ var Eth = function Eth() { var defaultAccount = null; var defaultBlock = 'latest'; + var transactionBlockTimeout = 50; + var transactionConfirmationBlocks = 24; + var transactionPollingTimeout = 750; + Object.defineProperty(this, 'transactionPollingTimeout', { + get: function () { + return transactionPollingTimeout; + }, + set: function (val) { + transactionPollingTimeout = val; + + // also set on the Contract object + _this.Contract.transactionPollingTimeout = transactionPollingTimeout; + + // update defaultBlock + methods.forEach(function(method) { + method.transactionPollingTimeout = transactionPollingTimeout; + }); + }, + enumerable: true + }); + Object.defineProperty(this, 'transactionConfirmationBlocks', { + get: function () { + return transactionConfirmationBlocks; + }, + set: function (val) { + transactionConfirmationBlocks = val; + + // also set on the Contract object + _this.Contract.transactionConfirmationBlocks = transactionConfirmationBlocks; + + // update defaultBlock + methods.forEach(function(method) { + method.transactionConfirmationBlocks = transactionConfirmationBlocks; + }); + }, + enumerable: true + }); + Object.defineProperty(this, 'transactionBlockTimeout', { + get: function () { + return transactionBlockTimeout; + }, + set: function (val) { + transactionBlockTimeout = val; + + // also set on the Contract object + _this.Contract.transactionBlockTimeout = transactionBlockTimeout; + + // update defaultBlock + methods.forEach(function(method) { + method.transactionBlockTimeout = transactionBlockTimeout; + }); + }, + enumerable: true + }); Object.defineProperty(this, 'defaultAccount', { get: function () { return defaultAccount; @@ -461,6 +515,9 @@ var Eth = function Eth() { method.setRequestManager(_this._requestManager, _this.accounts); // second param means is eth.accounts (necessary for wallet signing) method.defaultBlock = _this.defaultBlock; method.defaultAccount = _this.defaultAccount; + method.transactionBlockTimeout = _this.transactionBlockTimeout; + method.transactionConfirmationBlocks = _this.transactionConfirmationBlocks; + method.transactionPollingTimeout = _this.transactionPollingTimeout; }); }; From f6ee923cb7b327b5bdaa368999e051bcf3066232 Mon Sep 17 00:00:00 2001 From: nivida Date: Tue, 15 Oct 2019 13:20:57 +0200 Subject: [PATCH 2/8] CHANGELOG.md updated --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a7b997fa2ed..4f9d3131c42 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,7 @@ Released with 1.0.0-beta.37 code base. - getNetworkType method extended with Görli testnet (#3095) - supportsSubscriptions method added to providers (#3116) - Add `eth.getChainId` method (#3113) +- The transaction confirmation workflow can now be configured (#3130) ### Fixed From 5034bf63a5a3fff3b15e99ffd1e12b8f1e4ad5ef Mon Sep 17 00:00:00 2001 From: nivida Date: Tue, 15 Oct 2019 13:34:31 +0200 Subject: [PATCH 3/8] documentation updated --- docs/web3-eth-contract.rst | 148 +++++++++++++++++++++++++++++++++++++ docs/web3-eth.rst | 63 ++++++++++++++++ 2 files changed, 211 insertions(+) diff --git a/docs/web3-eth-contract.rst b/docs/web3-eth-contract.rst index de710fba48c..271de565d27 100644 --- a/docs/web3-eth-contract.rst +++ b/docs/web3-eth-contract.rst @@ -77,6 +77,154 @@ Example = Properties = ========= +------------------------------------------------------------------------------ + +.. _eth-contract-defaultaccount + +defaultAccount +===================== + +.. code-block:: javascript + + web3.eth.Contract.defaultAccount + contract.defaultAccount // on contract instance + +This default address is used as the default ``"from"`` property, if no ``"from"`` property is specified in for the following methods: + +- :ref:`web3.eth.sendTransaction() ` +- :ref:`web3.eth.call() ` +- :ref:`new web3.eth.Contract() -> myContract.methods.myMethod().call() ` +- :ref:`new web3.eth.Contract() -> myContract.methods.myMethod().send() ` + +-------- +Property +-------- + + +``String`` - 20 Bytes: Any ethereum address. You should have the private key for that address in your node or keystore. (Default is ``undefined``) + + +------- +Example +------- + + +.. code-block:: javascript + + web3.eth.defaultAccount; + > undefined + + // set the default account + web3.eth.defaultAccount = '0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe'; + + +------------------------------------------------------------------------------ + +.. _eth-contract-defaultblock: + +defaultBlock +===================== + +.. code-block:: javascript + + web3.eth.Contract.defaultBlock + contract.defaultBlock // on contract instance + +The default block is used for certain methods. You can override it by passing in the defaultBlock as last parameter. +The default value of it is "latest". + +---------- +Property +---------- + + +Default block parameters can be one of the following: + +- ``Number``: A block number +- ``"genesis"`` - ``String``: The genesis block +- ``"latest"`` - ``String``: The latest block (current head of the blockchain) +- ``"pending"`` - ``String``: The currently mined block (including pending transactions) + +Default is ``"latest"`` + + +------- +Example +------- + +.. code-block:: javascript + + contract.defaultBlock; + > "latest" + + // set the default block + contract.defaultBlock = 231; + + +------------------------------------------------------------------------------ + +.. _eth-contract-transactionblocktimeout: + +transactionBlockTimeout +===================== + +.. code-block:: javascript + + web3.eth.Contract.transcationBlockTimeout + contract.transactionBlockTimeout // on contract instance + +The ``transactionBlockTimeout`` will be used over a socket based connection. This option does define the amount of new blocks it should wait until the first confirmation happens. +This means the PromiEvent rejects with a timeout error when the timeout got exceeded. + + +------- +Returns +------- + +``number``: The current value of transactionBlockTimeout + +------------------------------------------------------------------------------ + +.. _eth-contract-module-transactionconfirmationblocks: + +transactionConfirmationBlocks +===================== + +.. code-block:: javascript + + web3.eth.Contract.transactionConfirmationBlocks + contract.transactionConfirmationBlocks // on contract instance + +This defines the number of blocks it requires until a transaction will be handled as confirmed. + + +------- +Returns +------- + +``number``: The current value of transactionConfirmationBlocks + +------------------------------------------------------------------------------ + +.. _eth-contract-module-transactionpollingtimeout: + +transactionPollingTimeout +===================== + +.. code-block:: javascript + + web3.eth.Contract.transactionPollingTimeout + contract.transactionPollingTimeout // on contract instance + +The ``transactionPollingTimeout`` will be used over a HTTP connection. +This option does define the amount of polls (each second) it should wait until the first confirmation happens. + + +------- +Returns +------- + +``number``: The current value of transactionPollingTimeout ------------------------------------------------------------------------------ diff --git a/docs/web3-eth.rst b/docs/web3-eth.rst index 6b86ab07ffe..ca7da948c74 100644 --- a/docs/web3-eth.rst +++ b/docs/web3-eth.rst @@ -121,6 +121,7 @@ For ``web3.eth.net`` see the :ref:`net reference documentation ` ------------------------------------------------------------------------------ +.. _eth-defaultaccount defaultAccount ===================== @@ -207,6 +208,68 @@ Example web3.eth.defaultBlock = 231; +------------------------------------------------------------------------------ + +.. _web3-module-transactionblocktimeout: + +transactionBlockTimeout +===================== + +.. code-block:: javascript + + web3.eth.transactionBlockTimeout + +The ``transactionBlockTimeout`` will be used over a socket based connection. This option does define the amount of new blocks it should wait until the first confirmation happens. +This means the PromiEvent rejects with a timeout error when the timeout got exceeded. + + +------- +Returns +------- + +``number``: The current value of transactionBlockTimeout + +------------------------------------------------------------------------------ + +.. _web3-module-transactionconfirmationblocks: + +transactionConfirmationBlocks +===================== + +.. code-block:: javascript + + web3.eth.transactionConfirmationBlocks + +This defines the number of blocks it requires until a transaction will be handled as confirmed. + + +------- +Returns +------- + +``number``: The current value of transactionConfirmationBlocks + +------------------------------------------------------------------------------ + +.. _web3-module-transactionpollingtimeout: + +transactionPollingTimeout +===================== + +.. code-block:: javascript + + web3.eth.transactionPollingTimeout + +The ``transactionPollingTimeout`` will be used over a HTTP connection. +This option does define the amount of polls (each second) it should wait until the first confirmation happens. + + +------- +Returns +------- + +``number``: The current value of transactionPollingTimeout + ------------------------------------------------------------------------------ getProtocolVersion From d5206ad0025d08b5cc6628c713bbb49ecac53c1c Mon Sep 17 00:00:00 2001 From: nivida Date: Tue, 15 Oct 2019 13:38:02 +0200 Subject: [PATCH 4/8] default values added to the documentation for the newely introduced transaction fconfirmation workflow configuration properties --- docs/web3-eth-contract.rst | 6 +++--- docs/web3-eth.rst | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/web3-eth-contract.rst b/docs/web3-eth-contract.rst index 271de565d27..9df46dd1807 100644 --- a/docs/web3-eth-contract.rst +++ b/docs/web3-eth-contract.rst @@ -181,7 +181,7 @@ This means the PromiEvent rejects with a timeout error when the timeout got exce Returns ------- -``number``: The current value of transactionBlockTimeout +``number``: The current value of transactionBlockTimeout (default: 50) ------------------------------------------------------------------------------ @@ -202,7 +202,7 @@ This defines the number of blocks it requires until a transaction will be handle Returns ------- -``number``: The current value of transactionConfirmationBlocks +``number``: The current value of transactionConfirmationBlocks (default: 24) ------------------------------------------------------------------------------ @@ -224,7 +224,7 @@ This option does define the amount of polls (each second) it should wait until t Returns ------- -``number``: The current value of transactionPollingTimeout +``number``: The current value of transactionPollingTimeout (default: 750) ------------------------------------------------------------------------------ diff --git a/docs/web3-eth.rst b/docs/web3-eth.rst index ca7da948c74..d15142335ba 100644 --- a/docs/web3-eth.rst +++ b/docs/web3-eth.rst @@ -227,7 +227,7 @@ This means the PromiEvent rejects with a timeout error when the timeout got exce Returns ------- -``number``: The current value of transactionBlockTimeout +``number``: The current value of transactionBlockTimeout (default: 50) ------------------------------------------------------------------------------ @@ -247,7 +247,7 @@ This defines the number of blocks it requires until a transaction will be handle Returns ------- -``number``: The current value of transactionConfirmationBlocks +``number``: The current value of transactionConfirmationBlocks (default: 24) ------------------------------------------------------------------------------ @@ -268,7 +268,7 @@ This option does define the amount of polls (each second) it should wait until t Returns ------- -``number``: The current value of transactionPollingTimeout +``number``: The current value of transactionPollingTimeout (default: 750) ------------------------------------------------------------------------------ From b17791d4d8a083c0fc81d6f7fcc1b70f73fbb49d Mon Sep 17 00:00:00 2001 From: nivida Date: Tue, 15 Oct 2019 13:43:48 +0200 Subject: [PATCH 5/8] test cases for the new properties added and adding of the Contract reference in the Eth module fixed --- packages/web3-eth/src/index.js | 3 +++ test/eth.transactionBlockTimeout.js | 25 +++++++++++++++++++++++ test/eth.transactionConfirmationBlocks.js | 25 +++++++++++++++++++++++ test/eth.transactionPollingTimeout.js | 25 +++++++++++++++++++++++ 4 files changed, 78 insertions(+) create mode 100644 test/eth.transactionBlockTimeout.js create mode 100644 test/eth.transactionConfirmationBlocks.js create mode 100644 test/eth.transactionPollingTimeout.js diff --git a/packages/web3-eth/src/index.js b/packages/web3-eth/src/index.js index 77ddbca5520..5162ca305d2 100644 --- a/packages/web3-eth/src/index.js +++ b/packages/web3-eth/src/index.js @@ -227,6 +227,9 @@ var Eth = function Eth() { this.Contract = Contract; this.Contract.defaultAccount = this.defaultAccount; this.Contract.defaultBlock = this.defaultBlock; + this.Contract.transactionBlockTimeout = this.transactionBlockTimeout; + this.Contract.transactionConfirmationBlocks = this.transactionConfirmationBlocks; + this.Contract.transactionPollingTimeout= this.transactionPollingTimeout; this.Contract.setProvider(this.currentProvider, this.accounts); // add IBAN diff --git a/test/eth.transactionBlockTimeout.js b/test/eth.transactionBlockTimeout.js new file mode 100644 index 00000000000..901930f789e --- /dev/null +++ b/test/eth.transactionBlockTimeout.js @@ -0,0 +1,25 @@ +var chai = require('chai'); +var assert = chai.assert; +var Eth = require('../packages/web3-eth'); + +var eth = new Eth(); + +var setValue = 123; + +describe('web3.eth', function () { + describe('transactionBlockTimeout', function () { + it('should check if transactionBlockTimeout is set to proper value', function () { + assert.equal(eth.transactionBlockTimeout, 50); + assert.equal(eth.Contract.transactionBlockTimeout, 50); + assert.equal(eth.getCode.method.transactionBlockTimeout, 50); + }); + it('should set transactionBlockTimeout for all sub packages is set to proper value, if Eth package is changed', function () { + eth.transactionBlockTimeout = setValue; + + assert.equal(eth.transactionBlockTimeout, setValue); + assert.equal(eth.Contract.transactionBlockTimeout, setValue); + assert.equal(eth.getCode.method.transactionBlockTimeout, setValue); + }); + }); +}); + diff --git a/test/eth.transactionConfirmationBlocks.js b/test/eth.transactionConfirmationBlocks.js new file mode 100644 index 00000000000..abfb7065423 --- /dev/null +++ b/test/eth.transactionConfirmationBlocks.js @@ -0,0 +1,25 @@ +var chai = require('chai'); +var assert = chai.assert; +var Eth = require('../packages/web3-eth'); + +var eth = new Eth(); + +var setValue = 123; + +describe('web3.eth', function () { + describe('transactionConfirmationBlocks', function () { + it('should check if transactionConfirmationBlocks is set to proper value', function () { + assert.equal(eth.transactionConfirmationBlocks, 24); + assert.equal(eth.Contract.transactionConfirmationBlocks, 24); + assert.equal(eth.getCode.method.transactionConfirmationBlocks, 24); + }); + it('should set transactionConfirmationBlocks for all sub packages is set to proper value, if Eth package is changed', function () { + eth.transactionConfirmationBlocks = setValue; + + assert.equal(eth.transactionConfirmationBlocks, setValue); + assert.equal(eth.Contract.transactionConfirmationBlocks, setValue); + assert.equal(eth.getCode.method.transactionConfirmationBlocks, setValue); + }); + }); +}); + diff --git a/test/eth.transactionPollingTimeout.js b/test/eth.transactionPollingTimeout.js new file mode 100644 index 00000000000..bb8ab5569f3 --- /dev/null +++ b/test/eth.transactionPollingTimeout.js @@ -0,0 +1,25 @@ +var chai = require('chai'); +var assert = chai.assert; +var Eth = require('../packages/web3-eth'); + +var eth = new Eth(); + +var setValue = 123; + +describe('web3.eth', function () { + describe('transactionPollingTimeout', function () { + it('should check if transactionPollingTimeout is set to proper value', function () { + assert.equal(eth.transactionPollingTimeout, 750); + assert.equal(eth.Contract.transactionPollingTimeout, 750); + assert.equal(eth.getCode.method.transactionPollingTimeout, 750); + }); + it('should set transactionPollingTimeout for all sub packages is set to proper value, if Eth package is changed', function () { + eth.transactionPollingTimeout = setValue; + + assert.equal(eth.transactionPollingTimeout, setValue); + assert.equal(eth.Contract.transactionPollingTimeout, setValue); + assert.equal(eth.getCode.method.transactionPollingTimeout, setValue); + }); + }); +}); + From bd2904a8f35a5ab4c93948464a0629fb635843d9 Mon Sep 17 00:00:00 2001 From: nivida Date: Tue, 15 Oct 2019 13:44:25 +0200 Subject: [PATCH 6/8] missing space added --- packages/web3-eth/src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/web3-eth/src/index.js b/packages/web3-eth/src/index.js index 5162ca305d2..d2cd4608989 100644 --- a/packages/web3-eth/src/index.js +++ b/packages/web3-eth/src/index.js @@ -229,7 +229,7 @@ var Eth = function Eth() { this.Contract.defaultBlock = this.defaultBlock; this.Contract.transactionBlockTimeout = this.transactionBlockTimeout; this.Contract.transactionConfirmationBlocks = this.transactionConfirmationBlocks; - this.Contract.transactionPollingTimeout= this.transactionPollingTimeout; + this.Contract.transactionPollingTimeout = this.transactionPollingTimeout; this.Contract.setProvider(this.currentProvider, this.accounts); // add IBAN From 3c75bb03187fe37860bc0433d701e2623f2d662e Mon Sep 17 00:00:00 2001 From: Samuel Furter Date: Wed, 16 Oct 2019 16:08:23 +0900 Subject: [PATCH 7/8] Update docs/web3-eth.rst Co-Authored-By: cgewecke --- docs/web3-eth.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/web3-eth.rst b/docs/web3-eth.rst index d15142335ba..936780e5ac2 100644 --- a/docs/web3-eth.rst +++ b/docs/web3-eth.rst @@ -261,7 +261,7 @@ transactionPollingTimeout web3.eth.transactionPollingTimeout The ``transactionPollingTimeout`` will be used over a HTTP connection. -This option does define the amount of polls (each second) it should wait until the first confirmation happens. +This option defines the number of seconds Web3 will wait for a receipt which confirms that a transaction was mined by the network. NB: If this method times out, the transaction may still be pending. ------- From 7a806934acf99bf60799f240f011e44040e313a9 Mon Sep 17 00:00:00 2001 From: Samuel Furter Date: Wed, 16 Oct 2019 16:08:32 +0900 Subject: [PATCH 8/8] Update docs/web3-eth-contract.rst Co-Authored-By: cgewecke --- docs/web3-eth-contract.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/web3-eth-contract.rst b/docs/web3-eth-contract.rst index 9df46dd1807..774da49a2b6 100644 --- a/docs/web3-eth-contract.rst +++ b/docs/web3-eth-contract.rst @@ -217,7 +217,7 @@ transactionPollingTimeout contract.transactionPollingTimeout // on contract instance The ``transactionPollingTimeout`` will be used over a HTTP connection. -This option does define the amount of polls (each second) it should wait until the first confirmation happens. +This option defines the number of seconds Web3 will wait for a receipt which confirms that a transaction was mined by the network. NB: If this method times out, the transaction may still be pending. -------