From 9a56730ec80f6861f8e40fa75096f516de81006d Mon Sep 17 00:00:00 2001 From: Samuel Siegart Date: Mon, 2 Dec 2024 16:26:22 -0800 Subject: [PATCH] fixup! test(fast-usdc): bootstrap test for advancement --- .../boot/test/fast-usdc/fast-usdc.test.ts | 35 ++---------------- .../fast-usdc/snapshots/fast-usdc.test.ts.md | 18 --------- .../snapshots/fast-usdc.test.ts.snap | Bin 1286 -> 1193 bytes .../scripts/fast-usdc/init-fast-usdc.js | 2 - 4 files changed, 3 insertions(+), 52 deletions(-) diff --git a/packages/boot/test/fast-usdc/fast-usdc.test.ts b/packages/boot/test/fast-usdc/fast-usdc.test.ts index 822397141fa..49da38cf01e 100644 --- a/packages/boot/test/fast-usdc/fast-usdc.test.ts +++ b/packages/boot/test/fast-usdc/fast-usdc.test.ts @@ -9,11 +9,11 @@ import { Fail } from '@endo/errors'; import { unmarshalFromVstorage } from '@agoric/internal/src/marshal.js'; import { makeMarshal } from '@endo/marshal'; import { defaultMarshaller } from '@agoric/internal/src/storage-test-utils.js'; +import { eventLoopIteration } from '@agoric/internal/src/testing-utils.js'; import { makeWalletFactoryContext, type WalletFactoryTestContext, } from '../bootstrapTests/walletFactory.js'; -import { eventLoopIteration } from '@agoric/internal/src/testing-utils.js'; const test: TestFn = anyTest; @@ -42,8 +42,6 @@ test.serial( } = t.context; const [watcherWallet] = await Promise.all([ - wd.provideSmartWallet('agoric144rrhh4m09mh7aaffhm6xy223ym76gve2x7y78'), - wd.provideSmartWallet('agoric19d6gnr9fyp6hev4tlrg87zjrzsd5gzr5qlfq2p'), wd.provideSmartWallet('agoric19uscwxdac6cf6z7d5e26e0jm0lgwstc47cpll8'), wd.provideSmartWallet('agoric1krunjcqfrf7la48zrvdfeeqtls5r00ep68mzkr'), wd.provideSmartWallet('agoric1n4fcxsnkxe4gj6e24naec99hzmc4pjfdccy5nj'), @@ -130,35 +128,9 @@ test.serial('writes fee config to vstorage', async t => { await documentStorageSchema(t, storage, doc); }); -test.serial('writes status updates to vstorage', async t => { - const { walletFactoryDriver: wd, storage } = t.context; - const wallet = await wd.provideSmartWallet( - 'agoric144rrhh4m09mh7aaffhm6xy223ym76gve2x7y78', - ); - await wallet.sendOffer({ - id: `submit-mock-evidence-dydx`, - invitationSpec: { - source: 'agoricContract', - instancePath: ['fastUsdc'], - callPipe: [ - ['makeTestPushInvitation', [MockCctpTxEvidences.AGORIC_PLUS_DYDX()]], - ], - }, - proposal: {}, - }); - - const doc = { - node: `fastUsdc.status`, - owner: `the statuses of fast USDC transfers identified by their tx hashes`, - }; - await documentStorageSchema(t, storage, doc); -}); - test.serial('makes usdc advance', async t => { const { walletFactoryDriver: wd, storage, agoricNamesRemotes } = t.context; const oracles = await Promise.all([ - wd.provideSmartWallet('agoric144rrhh4m09mh7aaffhm6xy223ym76gve2x7y78'), - wd.provideSmartWallet('agoric19d6gnr9fyp6hev4tlrg87zjrzsd5gzr5qlfq2p'), wd.provideSmartWallet('agoric19uscwxdac6cf6z7d5e26e0jm0lgwstc47cpll8'), wd.provideSmartWallet('agoric1krunjcqfrf7la48zrvdfeeqtls5r00ep68mzkr'), wd.provideSmartWallet('agoric1n4fcxsnkxe4gj6e24naec99hzmc4pjfdccy5nj'), @@ -176,9 +148,9 @@ test.serial('makes usdc advance', async t => { }), ), ); - await eventLoopIteration(); - const usdc = agoricNamesRemotes.vbankAsset.USDC.brand; + // @ts-expect-error it doesnt recognize usdc as a Brand type + const usdc = agoricNamesRemotes.vbankAsset.USDC.brand as Brand<'nat'>; await oracles[0].sendOffer({ id: 'deposit-lp-0', invitationSpec: { @@ -188,7 +160,6 @@ test.serial('makes usdc advance', async t => { }, proposal: { give: { - // @ts-expect-error it doesnt recognize usdc as a Brand type USDC: { brand: usdc, value: 150_000_000n }, }, }, diff --git a/packages/boot/test/fast-usdc/snapshots/fast-usdc.test.ts.md b/packages/boot/test/fast-usdc/snapshots/fast-usdc.test.ts.md index 4443dde49e2..1441f49490d 100644 --- a/packages/boot/test/fast-usdc/snapshots/fast-usdc.test.ts.md +++ b/packages/boot/test/fast-usdc/snapshots/fast-usdc.test.ts.md @@ -72,20 +72,6 @@ Generated by [AVA](https://avajs.dev). ], ] -## writes status updates to vstorage - -> Under "published", the "fastUsdc.status" node is delegated to the statuses of fast USDC transfers identified by their tx hashes. -> The example below illustrates the schema of the data published there. -> -> See also board marshalling conventions (_to appear_). - - [ - [ - 'published.fastUsdc.status.0xd81bc6105b60a234c7c50ac17816ebcd5561d366df8bf3be59ff387552761799', - 'OBSERVED', - ], - ] - ## makes usdc advance > Under "published", the "fastUsdc.status" node is delegated to the statuses of fast USDC transfers identified by their tx hashes. @@ -98,8 +84,4 @@ Generated by [AVA](https://avajs.dev). 'published.fastUsdc.status.0xc81bc6105b60a234c7c50ac17816ebcd5561d366df8bf3be59ff387552761702', 'ADVANCING', ], - [ - 'published.fastUsdc.status.0xd81bc6105b60a234c7c50ac17816ebcd5561d366df8bf3be59ff387552761799', - 'OBSERVED', - ], ] diff --git a/packages/boot/test/fast-usdc/snapshots/fast-usdc.test.ts.snap b/packages/boot/test/fast-usdc/snapshots/fast-usdc.test.ts.snap index 701eb14de7a6f49b502e00011487a8e9b78f0451..820fa8ddbf3bcfa3c1b40a990a2289fbb9915614 100644 GIT binary patch literal 1193 zcmV;a1XlY&RzVpL2 zz;^)f2LL=thPmcm@U9`(#2mjaFE0Z*2}z0v2-zkuPIr>GSP-Sb15`kk5;7y>sVMeB ztT$sB@J5S85r*f)$XMWmm5q{fNcO=Gyr-=CS-0Zq?IB0Am_TX9q(fFJSv4z6J=cpiAs$;p0NAQ zX1Qz&$KKj(@LJV%N=^-#?>c8|wVJzSyS2)h(pkG!&%~Zji#po6`TlLlR*1)uAILV- zK^&=Jg^VMs--shE8Q1@w9EQxpu>aRiBv8_|@%>s`r@Do7?TBl(Mx$6D4HOj^Vv}hU zNy{YeO^i^okg`b7bekKhgFNs9KIp9=>9km;zRxnH>CWY?M%sJD!gdQO_F20VBK0tg zuhSq5yGl!z^k;%lyoGH>V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