Skip to content

Commit

Permalink
#20 Fixed imports
Browse files Browse the repository at this point in the history
  • Loading branch information
anilhelvaci committed Sep 9, 2022
1 parent 299c312 commit 0b29ead
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion contract/src/assertionHelper.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { assert, details as X } from '@agoric/assert';
import { assertIsRatio } from '@agoric/zoe/src/contractSupport/ratio.js';
import { makeTracer } from '@agoric/run-protocol/src/makeTracer.js';
import { makeTracer } from '@agoric/inter-protocol/src/makeTracer.js';

const tracer = makeTracer('assertionHelper');

Expand Down
2 changes: 1 addition & 1 deletion contract/src/boundaryWatcher.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { E } from '@endo/far';
import { makePromiseKit } from '@endo/promise-kit';
import { BOUNDARY_WATCHER_STATUS, UPDATED_BOUNDARY_MESSAGE } from './constants.js';
import { makeTracer } from '@agoric/run-protocol/src/makeTracer.js';
import { makeTracer } from '@agoric/inter-protocol/src/makeTracer.js';
import { assertBoundaryShape } from './assertionHelper.js';

const trace = makeTracer('Boundary Watcher Module');
Expand Down
2 changes: 1 addition & 1 deletion contract/src/stopLoss.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { assertBoundaryShape, assertExecutionMode } from './assertionHelper.js';
import { makeBoundaryWatcher } from './boundaryWatcher.js';
import { makeNotifierKit } from '@agoric/notifier';
import { ALLOCATION_PHASE, BOUNDARY_WATCHER_STATUS } from './constants.js';
import { makeTracer } from '@agoric/run-protocol/src/makeTracer.js';
import { makeTracer } from '@agoric/inter-protocol/src/makeTracer.js';

const tracer = makeTracer('StopLoss');

Expand Down
8 changes: 4 additions & 4 deletions contract/test/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ import {
makeAgoricNamesAccess,
makePromiseSpace,
} from '@agoric/vats/src/core/utils.js';
import * as Collect from '@agoric/run-protocol/src/collect.js';
import * as Collect from '@agoric/inter-protocol/src/collect.js';
import {
setupAmm,
startEconomicCommittee,
} from '@agoric/run-protocol/src/econ-behaviors.js';
} from '@agoric/inter-protocol/src/proposals/econ-behaviors.js';
import {
installGovernance,
provideBundle,
} from '@agoric/run-protocol/test/supports.js';
} from '@agoric/inter-protocol/test/supports.js';
import bundleSource from "@endo/bundle-source";
import { resolve as importMetaResolve } from 'import-meta-resolve';

Expand All @@ -30,7 +30,7 @@ import { resolve as importMetaResolve } from 'import-meta-resolve';
*/

const ammRoot =
'@agoric/run-protocol/src/vpool-xyk-amm/multipoolMarketMaker.js'; // package relative
'@agoric/inter-protocol/src/vpool-xyk-amm/multipoolMarketMaker.js'; // package relative

const stopLossRoot =
'../src/stopLoss.js'
Expand Down
3 changes: 1 addition & 2 deletions contract/test/test-ammLiquidity.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
import { test } from '@agoric/zoe/tools/prepare-test-env-ava.js';
import { E } from '@endo/far';
import { AmountMath } from '@agoric/ertp';
import { unsafeMakeBundleCache } from '@agoric/run-protocol/test/bundleTool.js';
import { unsafeMakeBundleCache } from '@agoric/swingset-vat/tools/bundleTool.js';
import {
addLiquidityToPool,
makeAssertPayouts,
removeLiquidityToPool,
startAmmPool,
startServices,
swap,
} from './helper.js';

/*
Expand Down
19 changes: 10 additions & 9 deletions contract/test/test-boundaryWatcher.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @ts-check
import { test } from '@agoric/zoe/tools/prepare-test-env-ava.js';
import { test as unknownTest} from '@agoric/zoe/tools/prepare-test-env-ava.js';
import { E } from '@endo/far';
import { getAmountIn, getAmountOut } from '@agoric/zoe/src/contractSupport/priceQuote.js';
import { AmountMath, makeIssuerKit, AssetKind } from '@agoric/ertp';
Expand All @@ -8,10 +8,11 @@ import { getBoundaries, makeAssets } from './helper.js';
import buildManualTimer from '@agoric/zoe/tools/manualTimer.js';
import { makeRatio, makeRatioFromAmounts } from '@agoric/zoe/src/contractSupport/ratio.js';
import { makeBoundaryWatcher } from '../src/boundaryWatcher.js';
import { waitForPromisesToSettle } from '@agoric/run-protocol/test/supports.js';
import { eventLoopIteration } from '@agoric/zoe/tools/eventLoopIteration.js';
import { BOUNDARY_WATCHER_STATUS, UPDATED_BOUNDARY_MESSAGE } from '../src/constants.js';
import { makeTracer } from '@agoric/run-protocol/src/makeTracer.js';
import { makeTracer } from '@agoric/inter-protocol/src/makeTracer.js';

const test = unknownTest;
const trace = makeTracer('Boundary Watcher Test');

test.before(async t => {
Expand Down Expand Up @@ -77,7 +78,7 @@ test('price-goes-above-upper', async t => {
);

E(fromCentralPriceAuthority).setPrice(newSecondaryPrice);
await waitForPromisesToSettle();
await eventLoopIteration();

});

Expand Down Expand Up @@ -137,7 +138,7 @@ test('price-goes-below-lower', async t => {
);

await E(fromCentralPriceAuthority).setPrice(lastSecondaryPrice);
await waitForPromisesToSettle();
await eventLoopIteration();

});

Expand Down Expand Up @@ -220,7 +221,7 @@ test('update-upper-boundary-then-price-goes-above-upper', async t => {

await E(fromCentralPriceAuthority).setPrice(lastSecondaryPrice);

await waitForPromisesToSettle();
await eventLoopIteration();

});

Expand Down Expand Up @@ -303,7 +304,7 @@ test('update-lower-boundary-then-price-goes-below-lower', async t => {

await E(fromCentralPriceAuthority).setPrice(lastSecondaryPrice);

await waitForPromisesToSettle();
await eventLoopIteration();

});

Expand Down Expand Up @@ -387,7 +388,7 @@ test('update-both-boundaries-then-price-goes-above-upper', async t => {

await E(fromCentralPriceAuthority).setPrice(lastSecondaryPrice);

await waitForPromisesToSettle();
await eventLoopIteration();

});

Expand Down Expand Up @@ -433,7 +434,7 @@ test('mutableQuote-promises-rejected', async t => {
});

await E(fromCentralPriceAuthority).setPrice(undefined);
await waitForPromisesToSettle();
await eventLoopIteration();

});

Expand Down
28 changes: 14 additions & 14 deletions contract/test/test-stopLoss.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// @ts-check

import { test } from '@agoric/zoe/tools/prepare-test-env-ava.js';
import { unsafeMakeBundleCache } from '@agoric/run-protocol/test/bundleTool.js';
import { makeTracer } from '@agoric/run-protocol/src/makeTracer.js';
import { unsafeMakeBundleCache } from '@agoric/swingset-vat/tools/bundleTool.js';
import { makeTracer } from '@agoric/inter-protocol/src/makeTracer.js';
import {
addLiquidityToPool,
startAmmPool,
Expand All @@ -13,7 +13,7 @@ import {
} from './helper.js';
import { E } from '@endo/far';
import { makeRatioFromAmounts } from '@agoric/zoe/src/contractSupport/ratio.js';
import { waitForPromisesToSettle } from '@agoric/run-protocol/test/supports.js';
import { eventLoopIteration } from '@agoric/zoe/tools/eventLoopIteration.js';
import { AmountMath } from '@agoric/ertp';
import { ALLOCATION_PHASE, UPDATED_BOUNDARY_MESSAGE } from '../src/constants.js';
import { makeManualPriceAuthority } from '@agoric/zoe/tools/manualPriceAuthority.js';
Expand Down Expand Up @@ -363,7 +363,7 @@ test('trigger-lp-removal-price-moves-above-upper', async (t) => {

trace('Input price after', inputPriceAfter);

await waitForPromisesToSettle();
await eventLoopIteration();

const [liquidityAmountAllocated, liquidityBrand, centralAmountAllocated, secondaryAmountAllocated, { value: notificationAfterPriceAboveUpper }] = await Promise.all([
E(publicFacet).getBalanceByBrand('Liquidity', liquidityIssuer),
Expand Down Expand Up @@ -493,7 +493,7 @@ test('trigger-lp-removal-price-moves-below-lower', async (t) => {
console.log('Done.');
trace('InputPriceAfter', inputPriceAfter);

await waitForPromisesToSettle();
await eventLoopIteration();

const [liquidityAmountAllocated, liquidityBrand, centralAmountAllocated, secondaryAmountAllocated, { value: notificationAfterPriceExceedsLimit }] = await Promise.all([
E(publicFacet).getBalanceByBrand('Liquidity', liquidityIssuer),
Expand Down Expand Up @@ -640,7 +640,7 @@ test('update-boundaries-price-moves-below-old-lower-boundary', async (t) => {
t.truthy(AmountMath.isGTE(boundaries.lower.numerator, inputPriceAfter));
t.truthy(AmountMath.isGTE(inputPriceAfter, newBoundaries.lower.numerator));

await waitForPromisesToSettle();
await eventLoopIteration();

const [liquidityAmountAllocated, centralAmountAllocated, secondaryAmountAllocated, { value: notificationAfterPriceExceedsLimit }] = await Promise.all([
E(publicFacet).getBalanceByBrand('Liquidity', liquidityIssuer),
Expand Down Expand Up @@ -788,7 +788,7 @@ test('update-boundaries-price-moves-above-old-upper-boundary', async (t) => {
t.truthy(AmountMath.isGTE(inputPriceAfter, boundaries.upper.numerator));
t.truthy(AmountMath.isGTE(newBoundaries.upper.numerator, inputPriceAfter));

await waitForPromisesToSettle();
await eventLoopIteration();

const [liquidityAmountAllocated, centralAmountAllocated, secondaryAmountAllocated, { value: notificationAfterPriceExceedsLimit }] = await Promise.all([
E(publicFacet).getBalanceByBrand('Liquidity', liquidityIssuer),
Expand Down Expand Up @@ -934,7 +934,7 @@ test('update-boundaries-price-moves-above-old-upper-then-new-upper', async (t) =
t.truthy(AmountMath.isGTE(newBoundaries.upper.numerator, inputPriceAfter));
t.truthy(AmountMath.isGTE(inputPriceAfter, boundaries.upper.numerator));

await waitForPromisesToSettle();
await eventLoopIteration();

const [liquidityAmountAllocated, centralAmountAllocated, secondaryAmountAllocated, { value: notificationAfterPriceExceedsOldLimit }] =
await Promise.all([
Expand Down Expand Up @@ -967,7 +967,7 @@ test('update-boundaries-price-moves-above-old-upper-then-new-upper', async (t) =
console.log('Done.');
trace('inputPriceAfterBoundariesUpdated', inputPriceAfterBoundariesUpdated);

await waitForPromisesToSettle();
await eventLoopIteration();

const [
liquidityAmountAllocatedAfterUpdate,
Expand Down Expand Up @@ -1117,7 +1117,7 @@ test('update-boundaries-price-moves-below-old-lower-then-new-lower', async (t) =
t.truthy(AmountMath.isGTE(boundaries.lower.numerator, inputPriceAfter));
t.truthy(AmountMath.isGTE(inputPriceAfter, newBoundaries.lower.numerator));

await waitForPromisesToSettle();
await eventLoopIteration();

const [liquidityAmountAllocated, centralAmountAllocated, secondaryAmountAllocated, { value: notificationAfterPriceExceedsOldLimit }] =
await Promise.all([
Expand Down Expand Up @@ -1150,7 +1150,7 @@ test('update-boundaries-price-moves-below-old-lower-then-new-lower', async (t) =
console.log('Done.');
trace('inputPriceAfterBoundariesUpdated', inputPriceAfterBoundariesUpdated);

await waitForPromisesToSettle();
await eventLoopIteration();

const [
liquidityAmountAllocatedAfterUpdate,
Expand Down Expand Up @@ -1300,7 +1300,7 @@ test('update-boundaries-price-moves-below-old-lower-then-new-upper', async (t) =
t.truthy(AmountMath.isGTE(boundaries.lower.numerator, inputPriceAfter));
t.truthy(AmountMath.isGTE(inputPriceAfter, newBoundaries.lower.numerator));

await waitForPromisesToSettle();
await eventLoopIteration();

const [liquidityAmountAllocated, centralAmountAllocated, secondaryAmountAllocated, { value: notificationAfterPriceExceedsOldLimit }] =
await Promise.all([
Expand Down Expand Up @@ -1333,7 +1333,7 @@ test('update-boundaries-price-moves-below-old-lower-then-new-upper', async (t) =
console.log('Done.');
trace('inputPriceAfterBoundariesUpdated', inputPriceAfterBoundariesUpdated);

await waitForPromisesToSettle();
await eventLoopIteration();

const [
liquidityAmountAllocatedAfterUpdate,
Expand Down Expand Up @@ -1601,7 +1601,7 @@ test('boundaryWatcher-failed-no-tokens-locked', async (t) => {
t.deepEqual(initialNotification.phase, ALLOCATION_PHASE.SCHEDULED);

E(devPriceAuthority).setPrice(undefined);
await waitForPromisesToSettle();
await eventLoopIteration();

const [liquidityAmountAllocated, liquidityBrand, centralAmountAllocated, secondaryAmountAllocated, { value: notificationAfterBadPrice }] = await Promise.all([
E(publicFacet).getBalanceByBrand('Liquidity', liquidityIssuer),
Expand Down

0 comments on commit 0b29ead

Please sign in to comment.