Skip to content

Commit

Permalink
test: don't try to use bids that span auction upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
dckc committed Sep 9, 2024
1 parent 9d72014 commit 076c604
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions packages/boot/test/bootstrapTests/price-feed-replace.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,25 +49,18 @@ const outcome = {
bids: [{ payouts: { Bid: 0, Collateral: 1.800828 } }],
};

test.serial('1. setupVaults; placeBids', async t => {
const { placeBids, readLatest, setupVaults } = t.context;
await setupVaults(collateralBrandKey, managerIndex, setup);
await placeBids(collateralBrandKey, 'agoric1buyer', setup, 0);

t.like(readLatest('published.wallet.agoric1buyer.current'), {
liveOffers: [['ATOM-bid1', { id: 'ATOM-bid1' }]],
});
});

test.serial('run replace-price-feeds proposals', async t => {
test.serial('setupVaults; run replace-price-feeds proposals', async t => {
const {
agoricNamesRemotes,
buildProposal,
evalProposal,
priceFeedDrivers,
refreshAgoricNamesRemotes,
setupVaults,
} = t.context;

await setupVaults(collateralBrandKey, managerIndex, setup);

const instancePre = agoricNamesRemotes.instance['ATOM-USD price feed'];

const perFeedBuilder = '@agoric/builders/scripts/vats/priceFeedSupport.js';
Expand Down Expand Up @@ -103,8 +96,17 @@ test.serial('run replace-price-feeds proposals', async t => {
await priceFeedDrivers[collateralBrandKey].refreshInvitations();
});

test.serial('1. place bid', async t => {
const { placeBids, readLatest } = t.context;
await placeBids(collateralBrandKey, 'agoric1buyer', setup, 0);

t.like(readLatest('published.wallet.agoric1buyer.current'), {
liveOffers: [['ATOM-bid1', { id: 'ATOM-bid1' }]],
});
});

test.serial('2. trigger liquidation by changing price', async t => {
const { priceFeedDrivers, readLatest, refreshAgoricNamesRemotes } = t.context;
const { priceFeedDrivers, readLatest } = t.context;

await priceFeedDrivers[collateralBrandKey].setPrice(9.99);

Expand Down

0 comments on commit 076c604

Please sign in to comment.