Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
89fdbe1
fix: we should unspend transaction tx outputs when the tx spending it…
andreabadesso Aug 21, 2025
dc41675
fix: wallet_balance not being recalculated after a voided transaction
andreabadesso Aug 21, 2025
865a58f
fix: unlock tx outputs after a failure in tx proposal send
andreabadesso Aug 21, 2025
789d01b
fix: updated event tx output schema to match the fullnode message
andreabadesso Sep 4, 2025
c042b64
tests: added tests for the new transaction voiding chain scenario
andreabadesso Sep 4, 2025
bf6ff57
tests: inconsistent tests
andreabadesso Sep 4, 2025
5077356
chore: off-by-one error on unvoided tx scenario
andreabadesso Sep 5, 2025
4622f41
refactor(daemon): moved utils to the utils file
andreabadesso Sep 9, 2025
6297524
refactor(daemon): more strict balance checking and safer null check
andreabadesso Sep 9, 2025
864c58a
tests(daemon): tests should expect not to throw
andreabadesso Sep 10, 2025
a33b986
refactor(daemon): better comment on unlocked authorities calculation …
andreabadesso Sep 10, 2025
179605a
refactor(daemon): removed outdated comments
andreabadesso Sep 10, 2025
f7f41a6
tests(daemon): changed test structure to test wallet and address bala…
andreabadesso Sep 11, 2025
9d5ef79
fix(daemon): bug when voiding transactions that ADD authorities
andreabadesso Sep 11, 2025
32f1baf
tests(daemon): added the voided_token authority simulator balances
andreabadesso Sep 11, 2025
b255a29
tests(daemon): updated tests with correct locked balances
andreabadesso Sep 11, 2025
01a7a23
tests(daemon): refactor sql insert for the transction voiding chain s…
andreabadesso Sep 11, 2025
5708200
refactor(daemon): better handling of voided transactions
andreabadesso Sep 12, 2025
cffc902
tests(daemon): updated tests with new refactored voided transaction h…
andreabadesso Sep 12, 2025
dea6e49
docs(daemon): added critical doc
andreabadesso Sep 12, 2025
0380f76
tests(daemon): expect cafecafe balance
andreabadesso Sep 12, 2025
a237e5c
Merge branch 'master' into fix/unspend-tx-outputs
andreabadesso Sep 12, 2025
84ccea2
tests(daemon): removed .only
andreabadesso Sep 12, 2025
ee47926
refactor(daemon): changed console.log to console.warn
andreabadesso Sep 12, 2025
13def6f
tests(daemon): forceExit and other test cleanups
andreabadesso Sep 12, 2025
fcf0ea5
tests(daemon): using experimental docker image for new tests
andreabadesso Sep 12, 2025
ce6a19c
tests(daemon): temporarily disabled genesis tx check
andreabadesso Sep 12, 2025
d38d2be
tests(daemon): restore genesis balances
andreabadesso Sep 15, 2025
cd1c869
refactor(daemon): creating LRU cache on initializing state
andreabadesso Sep 15, 2025
7016f91
tests(daemon): properly mocking LRU cache
andreabadesso Sep 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/daemon/__tests__/actors/HealthCheckActor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ describe('HealthCheckActor', () => {

afterAll(() => {
jest.clearAllMocks();
jest.useRealTimers();
});

it('should not start pinging on initialization', () => {
Expand Down
10 changes: 6 additions & 4 deletions packages/daemon/__tests__/db/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ import {
updateTxOutputSpentBy,
updateWalletLockedBalance,
updateWalletTablesWithTx,
voidTransaction
voidTransaction,
voidAddressTransaction
} from '../../src/db';
import { Connection } from 'mysql2/promise';
import {
Expand Down Expand Up @@ -1223,7 +1224,8 @@ describe('voidTransaction', () => {
}),
};

await voidTransaction(mysql, txId, addressBalance);
await voidTransaction(mysql, txId);
await voidAddressTransaction(mysql, txId, addressBalance);

await expect(checkAddressBalanceTable(mysql, 2, addr1, token2, 1n, 0n, null, 3)).resolves.toBe(true);
await expect(checkAddressBalanceTable(mysql, 2, addr1, token1, 1n, 0n, null, 4)).resolves.toBe(true);
Expand All @@ -1247,15 +1249,15 @@ describe('voidTransaction', () => {

const addressBalance: StringMap<TokenBalanceMap> = {};

await expect(voidTransaction(mysql, txId, addressBalance)).resolves.not.toThrow();
await expect(voidTransaction(mysql, txId)).resolves.not.toThrow();
// Tx should be voided
await expect(checkTransactionTable(mysql, 1, txId, 0, constants.BLOCK_VERSION, true, 1)).resolves.toBe(true);
});

it('should throw an error if the transaction is not found in the database', async () => {
expect.hasAssertions();

await expect(voidTransaction(mysql, 'mysterious-transaction', {})).rejects.toThrow('Tried to void a transaction that is not in the database.');
await expect(voidTransaction(mysql, 'mysterious-transaction')).rejects.toThrow('Tried to void a transaction that is not in the database.');
});
});

Expand Down
Loading