Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
pedronfigueiredo committed Sep 22, 2023
1 parent 42fc661 commit d33a291
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions app/scripts/controllers/transactions/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3426,27 +3426,28 @@ describe('Transaction Controller', function () {
});
});

it('ignores new transactions if hash matches existing incoming transaction', async function () {
it.only('ignores new transactions if hash matches existing incoming transaction', async function () {
const existingTransaction = {
...TRANSACTION_META_MOCK,
id: 1,
type: TransactionType.incoming,
};
const existingTransaction2 = {
...TRANSACTION_META_MOCK,
id: 1,
id: 2,
type: TransactionType.simpleSend,
};

const incomingTransaction1 = {
...TRANSACTION_META_MOCK,
id: 2,
id: 3,
type: TransactionType.incoming,
};
const simpleSendTransaction2 = {
const incomingTransaction2 = {
...TRANSACTION_META_MOCK,
id: 3,
type: TransactionType.simpleSend,
id: 4,
hash: '0xNewHash',
type: TransactionType.incoming,
};

txController.store.getState().transactions = {
Expand All @@ -3455,15 +3456,13 @@ describe('Transaction Controller', function () {
};

await incomingTransactionHelperEventMock.firstCall.args[1]({
added: [incomingTransaction1, simpleSendTransaction2],
added: [incomingTransaction1, incomingTransaction2],
updated: [],
});

assert.deepEqual(txController.store.getState().transactions, {
[existingTransaction.id]: existingTransaction,
[existingTransaction2.id]: existingTransaction2,
[incomingTransaction1.id]: incomingTransaction1,
[simpleSendTransaction2.id]: simpleSendTransaction2,
});
});
});
Expand Down

0 comments on commit d33a291

Please sign in to comment.