diff options
author | kumavis <kumavis@users.noreply.github.com> | 2017-09-28 04:58:54 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-28 04:58:54 +0800 |
commit | 4404dfc5d328d57c99190dbcf034102882487177 (patch) | |
tree | 5bae6617ea10d2920983b1bb27eabf01f7da0de4 /test/unit/pending-tx-test.js | |
parent | b41aad6d1ae894ab89380b1c7159da8545ad935b (diff) | |
parent | 5bbea78306f13415f85159f3d23c2b69d8f2a26c (diff) | |
download | tangerine-wallet-browser-4404dfc5d328d57c99190dbcf034102882487177.tar tangerine-wallet-browser-4404dfc5d328d57c99190dbcf034102882487177.tar.gz tangerine-wallet-browser-4404dfc5d328d57c99190dbcf034102882487177.tar.bz2 tangerine-wallet-browser-4404dfc5d328d57c99190dbcf034102882487177.tar.lz tangerine-wallet-browser-4404dfc5d328d57c99190dbcf034102882487177.tar.xz tangerine-wallet-browser-4404dfc5d328d57c99190dbcf034102882487177.tar.zst tangerine-wallet-browser-4404dfc5d328d57c99190dbcf034102882487177.zip |
Merge branch 'master' into direct-block-tracker
Diffstat (limited to 'test/unit/pending-tx-test.js')
-rw-r--r-- | test/unit/pending-tx-test.js | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/test/unit/pending-tx-test.js b/test/unit/pending-tx-test.js index 7937afa46..1af464656 100644 --- a/test/unit/pending-tx-test.js +++ b/test/unit/pending-tx-test.js @@ -62,7 +62,7 @@ describe('PendingTransactionTracker', function () { it('should emit \'txFailed\' if the txMeta does not have a hash', function (done) { const block = Proxy.revocable({}, {}).revoke() pendingTxTracker.getPendingTransactions = () => [txMetaNoHash] - pendingTxTracker.once('txFailed', (txId, err) => { + pendingTxTracker.once('tx:failed', (txId, err) => { assert(txId, txMetaNoHash.id, 'should pass txId') done() }) @@ -71,11 +71,11 @@ describe('PendingTransactionTracker', function () { it('should emit \'txConfirmed\' if the tx is in the block', function (done) { const block = { transactions: [txMeta]} pendingTxTracker.getPendingTransactions = () => [txMeta] - pendingTxTracker.once('txConfirmed', (txId) => { + pendingTxTracker.once('tx:confirmed', (txId) => { assert(txId, txMeta.id, 'should pass txId') done() }) - pendingTxTracker.once('txFailed', (_, err) => { done(err) }) + pendingTxTracker.once('tx:failed', (_, err) => { done(err) }) pendingTxTracker.checkForTxInBlock(block) }) }) @@ -108,7 +108,7 @@ describe('PendingTransactionTracker', function () { describe('#_checkPendingTx', function () { it('should emit \'txFailed\' if the txMeta does not have a hash', function (done) { - pendingTxTracker.once('txFailed', (txId, err) => { + pendingTxTracker.once('tx:failed', (txId, err) => { assert(txId, txMetaNoHash.id, 'should pass txId') done() }) @@ -122,11 +122,11 @@ describe('PendingTransactionTracker', function () { it('should emit \'txConfirmed\'', function (done) { providerResultStub.eth_getTransactionByHash = {blockNumber: '0x01'} - pendingTxTracker.once('txConfirmed', (txId) => { + pendingTxTracker.once('tx:confirmed', (txId) => { assert(txId, txMeta.id, 'should pass txId') done() }) - pendingTxTracker.once('txFailed', (_, err) => { done(err) }) + pendingTxTracker.once('tx:failed', (_, err) => { done(err) }) pendingTxTracker._checkPendingTx(txMeta) }) }) @@ -188,7 +188,7 @@ describe('PendingTransactionTracker', function () { ] const enoughForAllErrors = txList.concat(txList) - pendingTxTracker.on('txFailed', (_, err) => done(err)) + pendingTxTracker.on('tx:failed', (_, err) => done(err)) pendingTxTracker.getPendingTransactions = () => enoughForAllErrors pendingTxTracker._resubmitTx = async (tx) => { @@ -202,7 +202,7 @@ describe('PendingTransactionTracker', function () { pendingTxTracker.resubmitPendingTxs() }) it('should emit \'txFailed\' if it encountered a real error', function (done) { - pendingTxTracker.once('txFailed', (id, err) => err.message === 'im some real error' ? txList[id - 1].resolve() : done(err)) + pendingTxTracker.once('tx:failed', (id, err) => err.message === 'im some real error' ? txList[id - 1].resolve() : done(err)) pendingTxTracker.getPendingTransactions = () => txList pendingTxTracker._resubmitTx = async (tx) => { throw new TypeError('im some real error') } @@ -226,7 +226,7 @@ describe('PendingTransactionTracker', function () { // Stubbing out current account state: // Adding the fake tx: - pendingTxTracker.once('txFailed', (txId, err) => { + pendingTxTracker.once('tx:failed', (txId, err) => { assert(err, 'Should have a error') done() }) |