Verified incoming transfers against Monero Wallet PRC
This commit is contained in:
@@ -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 }[] = [];
|
||||
|
||||
Reference in New Issue
Block a user