diff --git a/packages/fast-usdc/src/exos/settler.js b/packages/fast-usdc/src/exos/settler.js index ac74679cc06..72f1e1f9626 100644 --- a/packages/fast-usdc/src/exos/settler.js +++ b/packages/fast-usdc/src/exos/settler.js @@ -166,11 +166,13 @@ export const prepareSettler = ( this.state.mintedEarly.add(makeMintedEarlyKey(sender, amount)); return; - case undefined: case PendingTxStatus.Observed: case PendingTxStatus.AdvanceFailed: + return self.forward(found.txHash, sender, amount, EUD); + + case undefined: default: - return self.forward(found?.txHash, sender, amount, EUD); + log('⚠️ tap: no status for ', sender, amount); } }, }, @@ -247,7 +249,7 @@ export const prepareSettler = ( statusManager.disbursed(txHash); }, /** - * @param {EvmHash | undefined} txHash + * @param {EvmHash} txHash * @param {NobleAddress} sender * @param {NatValue} fullValue * @param {string} EUD @@ -275,7 +277,7 @@ export const prepareSettler = ( * @param {SettlerTransferCtx} ctx * * @typedef {{ - * txHash: EvmHash | undefined; + * txHash: EvmHash; * sender: NobleAddress; * fullValue: NatValue; * }} SettlerTransferCtx diff --git a/packages/fast-usdc/test/exos/settler.test.ts b/packages/fast-usdc/test/exos/settler.test.ts index d4c82a7652b..c970f55eaed 100644 --- a/packages/fast-usdc/test/exos/settler.test.ts +++ b/packages/fast-usdc/test/exos/settler.test.ts @@ -79,6 +79,7 @@ const makeTestContext = async t => { feeConfig: common.commonPrivateArgs.feeConfig, vowTools: common.bootstrap.vowTools, chainHub, + log, }); const defaultSettlerParams = harden({ @@ -307,7 +308,6 @@ test('Settlement for unknown transaction', async t => { peekCalls, inspectLogs, } = t.context; - const { usdc } = common.brands; const settler = makeSettler({ repayer, @@ -319,22 +319,19 @@ test('Settlement for unknown transaction', async t => { void settler.tap.receiveUpcall(MockVTransferEvents.AGORIC_PLUS_OSMO()); await eventLoopIteration(); - t.log('USDC was forwarded'); + t.log('Nothing was transferrred'); t.deepEqual(peekCalls(), []); - t.deepEqual(accounts.settlement.callLog, [ + t.deepEqual(accounts.settlement.callLog, []); + t.like(inspectLogs(), [ + ['config', { sourceChannel: 'channel-21' }], + ['upcall event'], + ['dequeued', undefined], [ - 'transfer', - { - chainId: 'osmosis-1', - encoding: 'bech32', - value: 'osmo183dejcnmkka5dzcu9xw6mywq0p2m5peks28men', - }, - usdc.units(150), + '⚠️ tap: no status for ', + 'noble1x0ydg69dh6fqvr27xjvp6maqmrldam6yfelqkd', + 150000000n, ], ]); - t.deepEqual(inspectLogs(0), [ - '⚠️ Forwarded minted amount 150000000 from account noble1x0ydg69dh6fqvr27xjvp6maqmrldam6yfelqkd before it was observed.', - ]); }); test.todo("StatusManager does not receive update when we can't settle");