Skip to content

Commit

Permalink
test: fusdc multichain (#10618)
Browse files Browse the repository at this point in the history
closes: #10597

## Description
Adds `multichain-testing` test for FUSDC happy path. Includes: 
 - accepting oracle operator invitations
 - funding liquidity pool with bridged USDC
 - simulating advance request via `mockCctpTxEvidence` submissions
 - simulating CCTP mint and settlement flow
 - LP returns shares for more USDC than deposited

Ensures advance appears in EUD account, Liquidity Pool is repaid, and corresponding TxStatus updates are recorded in vstorage. 
 
### Security Considerations
None, test code.

### Scaling Considerations
None really. For CI load, the test takes about 32 seconds after setup.

### Documentation Considerations
None

### Testing Considerations
PR only includes tests and test support.

### Upgrade Considerations
None
  • Loading branch information
mergify[bot] authored Dec 13, 2024
2 parents 254e849 + a56f407 commit c7a005e
Show file tree
Hide file tree
Showing 21 changed files with 572 additions and 96 deletions.
1 change: 1 addition & 0 deletions multichain-testing/ava.main.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ export default {
concurrency: 1,
serial: true,
timeout: '125s',
failFast: true,
};
2 changes: 1 addition & 1 deletion multichain-testing/test/account-balance-queries.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const contractBuilder =

test.before(async t => {
const { deleteTestKeys, setupTestKeys, ...rest } = await commonSetup(t);
deleteTestKeys(accounts).catch();
await deleteTestKeys(accounts).catch();
const wallets = await setupTestKeys(accounts);
t.context = { ...rest, wallets, deleteTestKeys };
const { startContract } = rest;
Expand Down
10 changes: 3 additions & 7 deletions multichain-testing/test/auto-stake-it.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,11 @@ const contractBuilder =

test.before(async t => {
const { setupTestKeys, ...common } = await commonSetup(t);
const { assetInfo, chainInfo, deleteTestKeys, startContract } = common;
deleteTestKeys(accounts).catch();
const { commonBuilderOpts, deleteTestKeys, startContract } = common;
await deleteTestKeys(accounts).catch();
const wallets = await setupTestKeys(accounts);
t.context = { ...common, wallets };

await startContract(contractName, contractBuilder, {
chainInfo,
assetInfo,
});
await startContract(contractName, contractBuilder, commonBuilderOpts);
});

test.after(async t => {
Expand Down
9 changes: 3 additions & 6 deletions multichain-testing/test/basic-flows.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,11 @@ const contractBuilder =

test.before(async t => {
const { setupTestKeys, ...common } = await commonSetup(t);
const { assetInfo, chainInfo, deleteTestKeys, startContract } = common;
deleteTestKeys(accounts).catch();
const { commonBuilderOpts, deleteTestKeys, startContract } = common;
await deleteTestKeys(accounts).catch();
const wallets = await setupTestKeys(accounts);
t.context = { ...common, wallets };
await startContract(contractName, contractBuilder, {
chainInfo,
assetInfo,
});
await startContract(contractName, contractBuilder, commonBuilderOpts);
});

test.after(async t => {
Expand Down
2 changes: 1 addition & 1 deletion multichain-testing/test/chain-queries.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const contractBuilder =

test.before(async t => {
const { deleteTestKeys, setupTestKeys, ...rest } = await commonSetup(t);
deleteTestKeys(accounts).catch();
await deleteTestKeys(accounts).catch();
const wallets = await setupTestKeys(accounts);
t.context = { ...rest, wallets, deleteTestKeys };
const { startContract } = rest;
Expand Down
9 changes: 3 additions & 6 deletions multichain-testing/test/deposit-withdraw-lca.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,11 @@ const contractBuilder =

test.before(async t => {
const { setupTestKeys, ...common } = await commonSetup(t);
const { assetInfo, chainInfo, deleteTestKeys, startContract } = common;
deleteTestKeys(accounts).catch();
const { commonBuilderOpts, deleteTestKeys, startContract } = common;
await deleteTestKeys(accounts).catch();
const wallets = await setupTestKeys(accounts);
t.context = { ...common, wallets };
await startContract(contractName, contractBuilder, {
chainInfo,
assetInfo,
});
await startContract(contractName, contractBuilder, commonBuilderOpts);
});

test.after(async t => {
Expand Down
9 changes: 3 additions & 6 deletions multichain-testing/test/deposit-withdraw-portfolio.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,11 @@ const contractBuilder =

test.before(async t => {
const { setupTestKeys, ...common } = await commonSetup(t);
const { assetInfo, chainInfo, deleteTestKeys, startContract } = common;
deleteTestKeys(accounts).catch();
const { commonBuilderOpts, deleteTestKeys, startContract } = common;
await deleteTestKeys(accounts).catch();
const wallets = await setupTestKeys(accounts);
t.context = { ...common, wallets };
await startContract(contractName, contractBuilder, {
chainInfo,
assetInfo,
});
await startContract(contractName, contractBuilder, commonBuilderOpts);
});

test.after(async t => {
Expand Down
28 changes: 28 additions & 0 deletions multichain-testing/test/fast-usdc/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import type { IBCChannelID } from '@agoric/vats';

export const oracleMnemonics = {
oracle1:
'cause eight cattle slot course mail more aware vapor slab hobby match',
oracle2:
'flower salute inspire label latin cattle believe sausage match total bless refuse',
oracle3:
'surge magnet typical drive cement artist stay latin chief obey word always',
};
harden(oracleMnemonics);

export const makeFeedPolicy = (nobleAgoricChannelId: IBCChannelID) => {
return {
nobleAgoricChannelId,
nobleDomainId: 4,
chainPolicies: {
Arbitrum: {
attenuatedCttpBridgeAddress:
'0xe298b93ffB5eA1FB628e0C0D55A43aeaC268e347',
cctpTokenMessengerAddress: '0x19330d10D9Cc8751218eaf51E8885D058642E08A',
chainId: 42161,
confirmations: 2,
},
},
};
};
harden(makeFeedPolicy);
Loading

0 comments on commit c7a005e

Please sign in to comment.