Removed timeout from wait so we can use confirmations in the future instead and remain backwards compatible.

This commit is contained in:
Richard Moore 2018-08-13 16:54:32 +01:00
parent f9723c42cb
commit 2c1022cde1
No known key found for this signature in database
GPG Key ID: 525F70A6FCABC295

View File

@ -776,12 +776,13 @@ export class BaseProvider extends Provider {
// Check the hash we expect is the same as the hash the server reported // Check the hash we expect is the same as the hash the server reported
if (hash != null && tx.hash !== hash) { if (hash != null && tx.hash !== hash) {
errors.throwError('Transaction hash mismatch from Proivder.sendTransaction.', errors.UNKNOWN_ERROR, { expectedHash: tx.hash, returnedHash: hash }); errors.throwError('Transaction hash mismatch from Provider.sendTransaction.', errors.UNKNOWN_ERROR, { expectedHash: tx.hash, returnedHash: hash });
} }
this._emitted['t:' + tx.hash] = 'pending'; this._emitted['t:' + tx.hash] = 'pending';
result.wait = (timeout?: number) => { // @TODO: (confirmations? number, timeout? number)
return this.waitForTransaction(hash, timeout).then((receipt) => { result.wait = () => {
return this.waitForTransaction(hash).then((receipt) => {
if (receipt.status === 0) { if (receipt.status === 0) {
errors.throwError('transaction failed', errors.CALL_EXCEPTION, { errors.throwError('transaction failed', errors.CALL_EXCEPTION, {
transactionHash: hash, transactionHash: hash,