Skip to content

Commit

Permalink
test: localOrchAccount.getBalance and localOrchAccount.getBalances
Browse files Browse the repository at this point in the history
  • Loading branch information
0xpatrickdev committed Sep 4, 2024
1 parent 812ad8e commit 2fdcddc
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions multichain-testing/test/account-balance-queries.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,15 @@ const queryAccountBalances = test.macro({
const { icqEnabled } = (chainInfo as Record<string, CosmosChainInfo>)[
chainName
];
const expectValidResult = icqEnabled || chainName === 'agoric';
t.log(
icqEnabled
? 'ICQ Enabled expecting offer result.'
: 'ICQ Disabled expecting offer error',
`Expecting offer ${expectValidResult ? 'result' : 'error'} for ${chainName}`,
);

const {
status: { result, error },
} = offerResult;
if (icqEnabled) {
if (expectValidResult) {
t.is(error, undefined, 'No error observed for supported chain');
const balances = JSON.parse(result);
t.truthy(balances, 'Result is parsed successfully');
Expand Down Expand Up @@ -156,16 +155,16 @@ const queryAccountBalance = test.macro({
const { icqEnabled } = (chainInfo as Record<string, CosmosChainInfo>)[
chainName
];

const expectValidResult = icqEnabled || chainName === 'agoric';
t.log(
icqEnabled
? 'ICQ Enabled, expecting offer result.'
: 'ICQ Disabled, expecting offer error',
`Expecting offer ${expectValidResult ? 'result' : 'error'} for ${chainName}`,
);

const {
status: { result, error },
} = offerResult;
if (icqEnabled) {
if (expectValidResult) {
t.is(error, undefined, 'No error observed for supported chain');
const parsedBalance = JSON.parse(result);
t.truthy(parsedBalance, 'Result is parsed successfully');
Expand All @@ -186,5 +185,7 @@ const queryAccountBalance = test.macro({

test.serial(queryAccountBalances, 'osmosis');
test.serial(queryAccountBalances, 'cosmoshub');
test.serial(queryAccountBalances, 'agoric');
test.serial(queryAccountBalance, 'osmosis');
test.serial(queryAccountBalance, 'cosmoshub');
test.serial(queryAccountBalance, 'agoric');

0 comments on commit 2fdcddc

Please sign in to comment.