From 8b6dd84181cf431beb73da5c06f4e97ca09e7326 Mon Sep 17 00:00:00 2001 From: Dan Connolly Date: Thu, 9 Feb 2023 10:38:29 -0600 Subject: [PATCH] test(smart-wallet): deposit unknown brand more than once fails --- .../test/smartWallet/test-psm-integration.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/inter-protocol/test/smartWallet/test-psm-integration.js b/packages/inter-protocol/test/smartWallet/test-psm-integration.js index 4f998b14d89c..87a0c5b0640a 100644 --- a/packages/inter-protocol/test/smartWallet/test-psm-integration.js +++ b/packages/inter-protocol/test/smartWallet/test-psm-integration.js @@ -360,6 +360,20 @@ test('deposit unknown brand', async t => { t.deepEqual(result, { brand: rial.brand, value: 0n }); }); +test.failing('deposit unknown brand more than once', async t => { + const rial = withAmountUtils(makeIssuerKit('rial')); + + const wallet = await t.context.simpleProvideWallet('agoric1queue'); + + for await (const _ of [1, 2]) { + const payment = rial.mint.mintPayment(rial.make(1_000n)); + // @ts-expect-error deposit does take a FarRef + const result = await wallet.getDepositFacet().receive(harden(payment)); + // successful request but not deposited + t.deepEqual(result, { brand: rial.brand, value: 0n }); + } +}); + test.todo('bad offer schema'); test.todo('not enough funds'); test.todo(