Skip to content

Commit

Permalink
fixup! test(fast-usdc): bootstrap test for advancement
Browse files Browse the repository at this point in the history
  • Loading branch information
samsiegart committed Dec 3, 2024
1 parent 76ac3e4 commit 9a56730
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 52 deletions.
35 changes: 3 additions & 32 deletions packages/boot/test/fast-usdc/fast-usdc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<WalletFactoryTestContext> = anyTest;

Expand Down Expand Up @@ -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'),
Expand Down Expand Up @@ -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'),
Expand All @@ -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: {
Expand All @@ -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 },
},
},
Expand Down
18 changes: 0 additions & 18 deletions packages/boot/test/fast-usdc/snapshots/fast-usdc.test.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -98,8 +84,4 @@ Generated by [AVA](https://avajs.dev).
'published.fastUsdc.status.0xc81bc6105b60a234c7c50ac17816ebcd5561d366df8bf3be59ff387552761702',
'ADVANCING',
],
[
'published.fastUsdc.status.0xd81bc6105b60a234c7c50ac17816ebcd5561d366df8bf3be59ff387552761799',
'OBSERVED',
],
]
Binary file modified packages/boot/test/fast-usdc/snapshots/fast-usdc.test.ts.snap
Binary file not shown.
2 changes: 0 additions & 2 deletions packages/builders/scripts/fast-usdc/init-fast-usdc.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ const configurations = {
},
MAINNET: {
oracles: {
DSRV: 'agoric144rrhh4m09mh7aaffhm6xy223ym76gve2x7y78',
Stakin: 'agoric19d6gnr9fyp6hev4tlrg87zjrzsd5gzr5qlfq2p',
'01node': 'agoric19uscwxdac6cf6z7d5e26e0jm0lgwstc47cpll8',
'Simply Staking': 'agoric1krunjcqfrf7la48zrvdfeeqtls5r00ep68mzkr',
P2P: 'agoric1n4fcxsnkxe4gj6e24naec99hzmc4pjfdccy5nj',
Expand Down

0 comments on commit 9a56730

Please sign in to comment.