Skip to content

Commit

Permalink
chore: fix advance available condition
Browse files Browse the repository at this point in the history
  • Loading branch information
0xpatrickdev committed Jan 17, 2025
1 parent fdc566c commit 58c2291
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions multichain-testing/test/fast-usdc/fast-usdc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ const advanceAndSettleScenario = test.macro({
retryUntilCondition,
smartWalletKit,
useChain,
usdcDenom,
usdcOnOsmosis,
vstorageClient,
} = t.context;
Expand Down Expand Up @@ -352,10 +353,26 @@ const advanceAndSettleScenario = test.macro({
await useChain(eudChain).getRestEndpoint(),
);

const getUsdcDenom = (chainName: string) => {
switch (chainName) {
case 'agoric':
return usdcDenom;
case 'osmosis':
return usdcOnOsmosis;
case 'noble':
return 'uusdc';
default:
throw new Error(`${chainName} not supported in 'getUsdcDenom'`);
}
};

await t.notThrowsAsync(() =>
retryUntilCondition(
() => queryClient.queryBalance(EUD, usdcOnOsmosis),
({ balance }) => !!balance?.amount && BigInt(balance.amount) < mintAmt,
() => queryClient.queryBalance(EUD, getUsdcDenom(eudChain)),
({ balance }) =>
!!balance?.amount &&
BigInt(balance?.amount) > 0n &&
BigInt(balance.amount) < mintAmt,
`${EUD} advance available from fast-usdc`,
// this resolves quickly, so _decrease_ the interval so the timing is more apparent
{ retryIntervalMs: 500 },
Expand Down

0 comments on commit 58c2291

Please sign in to comment.