Skip to content

Commit

Permalink
fixup! test: multichain test of auto-stake-it
Browse files Browse the repository at this point in the history
  • Loading branch information
0xpatrickdev committed Jul 12, 2024
1 parent 85c83dc commit 2277a95
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions multichain-testing/test/auto-stake-it.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {
} from './support.js';
import { createWallet } from '../tools/wallet.js';
import { makeQueryClient } from '../tools/query.js';
import { sleep } from '../tools/sleep.js';
import { makeDoOffer } from '../tools/e2e-tools.js';
import chainInfo from '../starship-chain-info.js';

Expand Down Expand Up @@ -159,7 +158,12 @@ test('auto-stake-it: creates accts, register tap, transfer to auto-delegate', as
t,
chainName,
);
await sleep(1500); // wait for wallet to instantiate
await retryUntilCondition(
() => client.getAllBalances(address),
coins => !!coins?.length,
'Faucet balances found',
);

console.log('Balances:', await client.getAllBalances(address));

const transferArgs = makeIBCTransferMsg(
Expand Down Expand Up @@ -197,15 +201,18 @@ test('auto-stake-it: creates accts, register tap, transfer to auto-delegate', as
const agoricQueryClient = makeQueryClient(
useChain('agoric').getRestEndpoint(),
);
const denomTrace = await agoricQueryClient.queryDenom(
`/${portId}/${channelId}`,
chainConfig['osmosis'].denom,
const { hash } = await retryUntilCondition(
() =>
agoricQueryClient.queryDenom(
`/${portId}/${channelId}`,
chainConfig['osmosis'].denom,
),
denomTrace => !!denomTrace.hash,
`local denom hash for uosmo found`,
);
t.log('found ibc denom hash for uosmo:', hash);

t.truthy(denomTrace.hash, 'ibc denom hash found');
t.log('ibc denom hash found', denomTrace.hash);

// 3. Find a osmosis validator to delegate to
// 3. Find an osmosis validator to delegate to
const osmosisQueryClient = makeQueryClient(
useChain('osmosis').getRestEndpoint(),
);
Expand Down Expand Up @@ -238,7 +245,7 @@ test('auto-stake-it: creates accts, register tap, transfer to auto-delegate', as
encoding: 'bech32',
chainId: osmosisChainInfo.chain.chain_id,
},
localDenom: `ibc/${denomTrace.hash}`,
localDenom: `ibc/${hash}`,
},
proposal: {},
});
Expand Down

0 comments on commit 2277a95

Please sign in to comment.