aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/pending-tx-test.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/pending-tx-test.js')
-rw-r--r--test/unit/pending-tx-test.js18
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()
})