Verified incoming transfers against Monero Wallet PRC

This commit is contained in:
2026-10-21 21:34:46 -04:00
parent af646dcc32
commit 9f82f050b4
13 changed files with 605 additions and 17 deletions
+14
View File
@@ -114,6 +114,20 @@ test('observer fails closed on missing, duplicated, or misattributed incoming ou
await assert.rejects(createMoneroWalletObserver(config, malformed).scanIncoming(90));
});
test('observer tolerates v0.18.5.4 omission of empty incoming_transfers result fields', async () => {
const txid = 'd'.repeat(64);
const transport: MoneroFixtureTransport = async (_url, init) => {
const body = JSON.parse(init.body as string) as { id: string; method: string };
if (body.method === 'get_height') return response(body.id, { height: 100, status: 'OK' });
if (body.method === 'get_address') return response(body.id, { address: ADDITIONAL_MARKET_FEE.address, status: 'OK' });
if (body.method === 'get_transfers') return response(body.id, { in: [{ txid, address: ADDITIONAL_MARKET_FEE.address,
amount: '1', height: 91, timestamp: 1, unlock_time: 0, locked: false, double_spend_seen: false,
subaddr_index: { major: 0, minor: 7 } }], status: 'OK' });
return response(body.id, {}); // Actual empty result shape from the pinned Wallet RPC build.
};
await assert.rejects(createMoneroWalletObserver(config, transport).scanIncoming(90), /transaction amount/);
});
test('deposit-address RPC client is narrowly allow-listed and creates only one verified subaddress', async () => {
const subaddress = await syntheticSubaddress();
const calls: { method: string; params: unknown }[] = [];