Skip to content

Commit

Permalink
fix(a3p): remove call to register oracle and push price from test
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorge-Lopes committed Oct 29, 2024
1 parent c975b72 commit f6481e1
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions a3p-integration/proposals/z:acceptance/vaults.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,53 +8,15 @@ import {
adjustVault,
closeVault,
getISTBalance,
getPriceQuote,
pushPrices,
getContractInfo,
ATOM_DENOM,
USER1ADDR,
waitForBlock,
registerOraclesForBrand,
generateOracleMap,
} from '@agoric/synthetic-chain';
import { getBalances, agopsVaults } from './test-lib/utils.js';
import { retryUntilCondition } from './test-lib/sync-tools.js';

export const scale6 = x => BigInt(x * 1_000_000);

// There may be a new vaultFactory that doesn't have prices yet, so we publish
// prices now
test.before(async t => {
const pushPriceRetryOpts = {
maxRetries: 5, // arbitrary
retryIntervalMs: 5000, // in ms
};
t.context = {
roundId: 1,
retryOpts: {
pushPriceRetryOpts,
},
};
const oraclesByBrand = generateOracleMap('z-acc', ['ATOM']);
await registerOraclesForBrand('ATOM', oraclesByBrand);

const price = 15.2;
// @ts-expect-error t.context is fine
await pushPrices(price, 'ATOM', oraclesByBrand, t.context.roundId);

await retryUntilCondition(
() => getPriceQuote('ATOM'),
res => res === `+${scale6(price).toString()}`,
'price not pushed yet',
{
log: t.log,
setTimeout: global.setTimeout,
// @ts-expect-error t.context is fine
...t.context.pushPriceRetryOpts,
},
);
});

test.serial('attempt to open vaults under the minimum amount', async t => {
const activeVaultsBefore = await agopsVaults(USER1ADDR);
await bankSend(USER1ADDR, `20000000${ATOM_DENOM}`);
Expand Down

0 comments on commit f6481e1

Please sign in to comment.