From 17197978b07d5138079acda43ddd87b269809b5a Mon Sep 17 00:00:00 2001 From: Dan Connolly Date: Tue, 26 Nov 2024 00:59:01 -0600 Subject: [PATCH] test: unknown transaction (WIP. failing) settler should Leave funds in SettlementAccount. --- .../fast-usdc/test/fast-usdc.contract.test.ts | 34 ++++++++++++++----- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/packages/fast-usdc/test/fast-usdc.contract.test.ts b/packages/fast-usdc/test/fast-usdc.contract.test.ts index fe54b1d8d81..db8507ec979 100644 --- a/packages/fast-usdc/test/fast-usdc.contract.test.ts +++ b/packages/fast-usdc/test/fast-usdc.contract.test.ts @@ -923,7 +923,7 @@ test.serial('racers', async t => { await Promise.all([mint(sent1), mint(sent2), mint(sent3)]); }); -test.serial('operator down', async t => { +test.serial('Settlement for unknown transaction (operator down)', async t => { const { sync, bridges: { snapshot, since }, @@ -940,14 +940,30 @@ test.serial('operator down', async t => { // what removeOperator will do await E(E.get(E(operators[1]).getKit()).admin).disable(); - { - const bridgePos = snapshot(); - const sent = await opDown.send(20_000_000n, 'osmo12345'); - const bridgeTraffic = since(bridgePos); - await mint(sent); - opDown.checkSent(bridgeTraffic, 'forward'); - await transmitTransferAck(); - } + const bridgePos = snapshot(); + const sent = await opDown.send(20_000_000n, 'osmo12345'); + await mint(sent); + const bridgeTraffic = since(bridgePos); + + t.like( + bridgeTraffic.bank, + [ + { + amount: '20000000', + sender: 'faucet', + type: 'VBANK_GRAB', + }, + { + amount: '20000000', + recipient: 'agoric1fakeLCAAddress1', + type: 'VBANK_GIVE', + }, + ], + '20 USDC arrive at the settlement account', + ); + t.deepEqual(bridgeTraffic.local, [], 'no IBC transfers'); + + await transmitTransferAck(); t.deepEqual(await E(operators[1]).getFailures(), [ 'submitEvidence for disabled operator', ]);