Skip to content

Commit

Permalink
test(boot): snapshot GTM Fast USDC feed policy
Browse files Browse the repository at this point in the history
  • Loading branch information
dckc committed Feb 28, 2025
1 parent 0743ad4 commit ab8149d
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 78 deletions.
39 changes: 36 additions & 3 deletions packages/boot/test/fast-usdc/fast-usdc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ test.serial(
},
);

test.serial('writes feed policy to vstorage', async t => {
test.skip('writes Beta feed policy to vstorage', async t => {
const { storage } = t.context;
const opts = {
node: 'fastUsdc.feedPolicy',
Expand All @@ -251,7 +251,7 @@ test.serial('writes feed policy to vstorage', async t => {
await documentStorageSchema(t, storage, opts);
});

test.serial('writes fee config to vstorage', async t => {
test.skip('writes Beta fee config to vstorage', async t => {
const { storage } = t.context;
const doc = {
node: 'fastUsdc.feeConfig',
Expand All @@ -261,7 +261,7 @@ test.serial('writes fee config to vstorage', async t => {
await documentStorageSchema(t, storage, doc);
});

test.serial('writes account addresses to vstorage', async t => {
test.skip('writes Beta account addresses to vstorage', async t => {
const { storage } = t.context;
const doc = {
node: 'fastUsdc',
Expand Down Expand Up @@ -402,6 +402,39 @@ test.serial('upgrade; update noble ICA', async t => {
);
});

test.serial('writes GTM feed policy to vstorage', async t => {
const { storage } = t.context;
const opts = {
node: 'fastUsdc.feedPolicy',
owner: 'the general and chain-specific policies for the Fast USDC feed',
showValue: defaultSerializer.parse,
};
await documentStorageSchema(t, storage, opts);
});

test.serial('writes GTM fee config to vstorage', async t => {
const { storage } = t.context;
const doc = {
node: 'fastUsdc.feeConfig',
owner: 'the fee configuration for Fast USDC',
showValue: defaultSerializer.parse,
};
await documentStorageSchema(t, storage, doc);
});

test.serial('writes GTM account addresses to vstorage', async t => {
const { storage } = t.context;
const doc = {
node: 'fastUsdc',
showValue: JSON.parse,
pattern: /published\.fastUsdc\.(feeConfig|feedPolicy|poolMetrics)/,
replacement: '',
note: 'Under "published", the "fastUsdc" node is delegated to FastUSDC contract.',
};

await documentStorageSchema(t, storage, doc);
});

test.serial('makes usdc advance', async t => {
const {
walletFactoryDriver: wfd,
Expand Down
151 changes: 76 additions & 75 deletions packages/boot/test/fast-usdc/snapshots/fast-usdc.test.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,62 @@ The actual snapshot is saved in `fast-usdc.test.ts.snap`.

Generated by [AVA](https://avajs.dev).

## writes feed policy to vstorage
## upgrade; update noble ICA

> Under "published", the "fastUsdc" node is delegated to Fast USDC.
> The example below illustrates the schema of the data published there.
>
> See also board marshalling conventions (_to appear_).
[
[
'published.fastUsdc',
{
nobleICA: 'noble1test1',
poolAccount: 'agoric1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqp7zqht',
settlementAccount: 'agoric1qyqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqc09z0g',
},
],
]

> feeConfig: 0.01USDC flat, 0.5% variable, 20% contract cut
> The example below illustrates the schema of the data published there.
>
> See also board marshalling conventions (_to appear_).
[
[
'published.fastUsdc.feeConfig',
{
contractRate: {
denominator: {
brand: Object @Alleged: USDC brand {},
value: 10n,
},
numerator: {
brand: Object @Alleged: USDC brand {},
value: 2n,
},
},
flat: {
brand: Object @Alleged: USDC brand {},
value: 10000n,
},
variableRate: {
denominator: {
brand: Object @Alleged: USDC brand {},
value: 100n,
},
numerator: {
brand: Object @Alleged: USDC brand {},
value: 1n,
},
},
},
],
]

## writes GTM feed policy to vstorage

> Under "published", the "fastUsdc.feedPolicy" node is delegated to the general and chain-specific policies for the Fast USDC feed.
> The example below illustrates the schema of the data published there.
Expand All @@ -22,11 +77,11 @@ Generated by [AVA](https://avajs.dev).
],
cctpTokenMessengerAddress: '0x19330d10D9Cc8751218eaf51E8885D058642E08A',
chainId: 42161,
confirmations: 2,
confirmations: 96,
rateLimits: {
blockWindow: 20000000000n,
blockWindowSize: 10,
tx: 10000000000n,
blockWindow: 50000000000n,
blockWindowSize: 480,
tx: 20000000000n,
},
},
Base: {
Expand All @@ -35,11 +90,11 @@ Generated by [AVA](https://avajs.dev).
],
cctpTokenMessengerAddress: '0x1682Ae6375C4E4A97e4B583BC394c861A46D8962',
chainId: 8453,
confirmations: 2,
confirmations: 12,
rateLimits: {
blockWindow: 20000000000n,
blockWindowSize: 10,
tx: 10000000000n,
blockWindow: 50000000000n,
blockWindowSize: 60,
tx: 20000000000n,
},
},
Ethereum: {
Expand All @@ -50,9 +105,9 @@ Generated by [AVA](https://avajs.dev).
chainId: 1,
confirmations: 2,
rateLimits: {
blockWindow: 20000000000n,
blockWindow: 50000000000n,
blockWindowSize: 10,
tx: 10000000000n,
tx: 20000000000n,
},
},
Optimism: {
Expand All @@ -61,11 +116,11 @@ Generated by [AVA](https://avajs.dev).
],
cctpTokenMessengerAddress: '0x2B4069517957735bE00ceE0fadAE88a26365528f',
chainId: 10,
confirmations: 2,
confirmations: 12,
rateLimits: {
blockWindow: 20000000000n,
blockWindowSize: 10,
tx: 10000000000n,
blockWindow: 50000000000n,
blockWindowSize: 60,
tx: 20000000000n,
},
},
Polygon: {
Expand All @@ -74,11 +129,11 @@ Generated by [AVA](https://avajs.dev).
],
cctpTokenMessengerAddress: '0x9daF8c91AEFAE50b9c0E69629D3F6Ca40cA3B3FE',
chainId: 137,
confirmations: 2,
confirmations: 12,
rateLimits: {
blockWindow: 20000000000n,
blockWindowSize: 10,
tx: 10000000000n,
blockWindow: 50000000000n,
blockWindowSize: 60,
tx: 20000000000n,
},
},
},
Expand All @@ -89,7 +144,7 @@ Generated by [AVA](https://avajs.dev).
],
]

## writes fee config to vstorage
## writes GTM fee config to vstorage

> Under "published", the "fastUsdc.feeConfig" node is delegated to the fee configuration for Fast USDC.
> The example below illustrates the schema of the data published there.
Expand Down Expand Up @@ -128,28 +183,11 @@ Generated by [AVA](https://avajs.dev).
],
]

## writes account addresses to vstorage
## writes GTM account addresses to vstorage

> Under "published", the "fastUsdc" node is delegated to FastUSDC contract.
> The example below illustrates the schema of the data published there.
>
> See also board marshalling conventions (_to appear_).
[
[
'published.fastUsdc',
{
poolAccount: 'agoric1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqp7zqht',
settlementAccount: 'agoric1qyqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqc09z0g',
},
],
]

## upgrade; update noble ICA

> Under "published", the "fastUsdc" node is delegated to Fast USDC.
> The example below illustrates the schema of the data published there.
>
> See also board marshalling conventions (_to appear_).
[
Expand All @@ -163,43 +201,6 @@ Generated by [AVA](https://avajs.dev).
],
]

> feeConfig: 0.01USDC flat, 0.5% variable, 20% contract cut
> The example below illustrates the schema of the data published there.
>
> See also board marshalling conventions (_to appear_).
[
[
'published.fastUsdc.feeConfig',
{
contractRate: {
denominator: {
brand: Object @Alleged: USDC brand {},
value: 10n,
},
numerator: {
brand: Object @Alleged: USDC brand {},
value: 2n,
},
},
flat: {
brand: Object @Alleged: USDC brand {},
value: 10000n,
},
variableRate: {
denominator: {
brand: Object @Alleged: USDC brand {},
value: 100n,
},
numerator: {
brand: Object @Alleged: USDC brand {},
value: 1n,
},
},
},
],
]

## makes usdc advance

> Under "published", the "fastUsdc.txns" node is delegated to the Ethereum transactions upon which Fast USDC is acting.
Expand Down
Binary file modified packages/boot/test/fast-usdc/snapshots/fast-usdc.test.ts.snap
Binary file not shown.

0 comments on commit ab8149d

Please sign in to comment.