Skip to content

Commit

Permalink
Update broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
panleone committed Oct 10, 2024
1 parent d03eabe commit 4516976
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/unit/mempool.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,20 +121,20 @@ describe('mempool tests', () => {
vout: [],
});
mempool.addTransaction(spendTx);
expect(mempool.getDebit(spendTx)).toBe(5000000 + 4992400);
expect(mempool.getDebit(spendTx).debit).toBe(5000000 + 4992400);

expect(mempool.getDebit(new Transaction())).toBe(0);
expect(mempool.getDebit(new Transaction()).debit).toBe(0);
});

it('gives correct credit', () => {
expect(mempool.getCredit(tx)).toBe(5000000 + 4992400);
expect(mempool.getCredit(tx).credit).toBe(5000000 + 4992400);

// Result should stay the same even if the UTXOs are spent
mempool.setSpent(new COutpoint({ txid: tx.txid, n: 1 }));
expect(mempool.getCredit(tx)).toBe(5000000 + 4992400);
expect(mempool.getCredit(tx).credit).toBe(5000000 + 4992400);
mempool.setSpent(new COutpoint({ txid: tx.txid, n: 0 }));
expect(mempool.getCredit(tx)).toBe(5000000 + 4992400);
expect(mempool.getCredit(new Transaction())).toBe(0);
expect(mempool.getCredit(tx).credit).toBe(5000000 + 4992400);
expect(mempool.getCredit(new Transaction()).credit).toBe(0);
});

it('marks outpoint as spent correctly', () => {
Expand Down

0 comments on commit 4516976

Please sign in to comment.