Skip to content

Commit

Permalink
wip: advance fail test
Browse files Browse the repository at this point in the history
  • Loading branch information
samsiegart committed Feb 9, 2025
1 parent 6024101 commit 3899813
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
9 changes: 4 additions & 5 deletions multichain-testing/test/fast-usdc/fast-usdc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ test.serial(advanceAndSettleScenario, LP_DEPOSIT_AMOUNT / 4n, 'osmosis');
test.serial(advanceAndSettleScenario, LP_DEPOSIT_AMOUNT / 8n, 'noble');
test.serial(advanceAndSettleScenario, LP_DEPOSIT_AMOUNT / 5n, 'agoric');

test.skip('advance failed (e.g. to missing chain)', async t => {
test.serial('advance failed', async t => {
const mintAmt = LP_DEPOSIT_AMOUNT / 10n;
const {
assertTxStatus,
Expand All @@ -451,7 +451,7 @@ test.skip('advance failed (e.g. to missing chain)', async t => {
} = t.context;

// EUD wallet on the specified chain
const eudWallet = await createWallet('cosmos');
const eudWallet = await createWallet('unreachable');
const EUD = (await eudWallet.getAccounts())[0].address;
t.log(`EUD wallet created: ${EUD}`);

Expand Down Expand Up @@ -487,13 +487,12 @@ test.skip('advance failed (e.g. to missing chain)', async t => {
// submit evidences
await Promise.all(txOracles.map(async o => o.submit(evidence)));

// XXX Not sure if the behavior should actually be ADVANCE_FAILED.
// It only reaches that state if the destination chain is valid.
await assertTxStatus(evidence.txHash, 'OBSERVED');
await assertTxStatus(evidence.txHash, 'ADVANCE_FAILED');

nobleTools.mockCctpMint(mintAmt, userForwardingAddr);

await assertTxStatus(evidence.txHash, 'FORWARD_FAILED');
await sleep(5000, { log: t.log, setTimeout });
});

test.serial('lp withdraws', async t => {
Expand Down
16 changes: 14 additions & 2 deletions multichain-testing/test/support.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { dirname, join } from 'path';
import { execa } from 'execa';
import fse from 'fs-extra';
import childProcess from 'node:child_process';
import { withChainCapabilities } from '@agoric/orchestration';
import {
withChainCapabilities,
type CosmosChainInfo,
} from '@agoric/orchestration';
import { makeAgdTools } from '../tools/agd-tools.js';
import { type E2ETools } from '../tools/e2e-tools.js';
import {
Expand Down Expand Up @@ -95,7 +98,16 @@ export const commonSetup = async (
const relayer = makeRelayer(childProcess);
const nobleTools = makeNobleTools(childProcess);
const assetInfo = makeAssetInfo(starshipChainInfo);
const chainInfo = withChainCapabilities(starshipChainInfo);

const unreachableChain: CosmosChainInfo = {
chainId: 'unreachable-chain',
bech32Prefix: 'unreachable',
};

const chainInfo = {
...withChainCapabilities(starshipChainInfo),
...withChainCapabilities({ unreachableChain }),
};
const faucetTools = makeFaucetTools(
t,
tools.agd,
Expand Down

0 comments on commit 3899813

Please sign in to comment.