Skip to content

Commit

Permalink
lint: cleanup mechanical refactors
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed May 13, 2024
1 parent a0ac656 commit 18b48ba
Show file tree
Hide file tree
Showing 16 changed files with 55 additions and 46 deletions.
1 change: 0 additions & 1 deletion packages/SwingSet/tools/bootstrap-relay.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { assert } from '@endo/errors';
import { objectMap } from '@agoric/internal';
import { Far, E } from '@endo/far';
import { buildManualTimer } from './manual-timer.js';
Expand Down
12 changes: 8 additions & 4 deletions packages/boot/tools/supports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,21 @@ import { resolve as importMetaResolve } from 'import-meta-resolve';
import { basename, join } from 'path';
import { inspect } from 'util';

import { Fail } from '@endo/errors';
import { NonNullish } from '@agoric/internal';
import { buildSwingset } from '@agoric/cosmic-swingset/src/launch-chain.js';
import { BridgeId, VBankAccount, makeTracer } from '@agoric/internal';
import {
BridgeId,
NonNullish,
VBankAccount,
makeTracer,
} from '@agoric/internal';
import { unmarshalFromVstorage } from '@agoric/internal/src/marshal.js';
import { makeFakeStorageKit } from '@agoric/internal/src/storage-test-utils.js';
import { krefOf } from '@agoric/kmarshal';
import { initSwingStore } from '@agoric/swing-store';
import { loadSwingsetConfigFile } from '@agoric/swingset-vat';
import { makeSlogSender } from '@agoric/telemetry';
import { TimeMath, Timestamp } from '@agoric/time';
import { Fail } from '@endo/errors';

// XXX ambient types runtime imports until https://github.com/Agoric/agoric-sdk/issues/6512
import '@agoric/vats/exported.js';
Expand All @@ -29,8 +33,8 @@ import {

import type { ExecutionContext as AvaT } from 'ava';

import { makeRunUtils } from '@agoric/swingset-vat/tools/run-utils.js';
import type { CoreEvalSDKType } from '@agoric/cosmic-proto/swingset/swingset.js';
import { makeRunUtils } from '@agoric/swingset-vat/tools/run-utils.js';
import type { BridgeHandler, IBCMethod } from '@agoric/vats';
import { icaMocks, protoMsgMocks } from './ibc/mocks.js';

Expand Down
11 changes: 7 additions & 4 deletions packages/inter-protocol/test/auction/auctionContract.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,24 @@ import '@agoric/zoe/exported.js';

import { AmountMath, makeIssuerKit } from '@agoric/ertp';
import { documentStorageSchema } from '@agoric/governance/tools/storageDoc.js';
import { deeplyFulfilledObject, makeTracer } from '@agoric/internal';
import { subscribeEach } from '@agoric/notifier';
import {
deeplyFulfilledObject,
makeTracer,
NonNullish,
} from '@agoric/internal';
import { eventLoopIteration } from '@agoric/internal/src/testing-utils.js';
import { subscribeEach } from '@agoric/notifier';
import { buildManualTimer } from '@agoric/swingset-vat/tools/manual-timer.js';
import { TimeMath } from '@agoric/time';
import { makeScalarMapStore } from '@agoric/vat-data';
import { providePriceAuthorityRegistry } from '@agoric/vats/src/priceAuthorityRegistry.js';
import {
makeRatio,
makeRatioFromAmounts,
} from '@agoric/zoe/src/contractSupport/index.js';
import { assertPayoutAmount } from '@agoric/zoe/test/zoeTestHelpers.js';
import { makeManualPriceAuthority } from '@agoric/zoe/tools/manualPriceAuthority.js';
import { providePriceAuthorityRegistry } from '@agoric/vats/src/priceAuthorityRegistry.js';
import { E } from '@endo/eventual-send';
import { NonNullish } from '@agoric/internal';

import {
setupReserve,
Expand Down
7 changes: 3 additions & 4 deletions packages/inter-protocol/test/psm/psm.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,18 @@ import {
natSafeMath as NatMath,
} from '@agoric/zoe/src/contractSupport/index.js';

import { NonNullish } from '@agoric/internal';
import { documentStorageSchema } from '@agoric/governance/tools/storageDoc.js';
import { makeTracer } from '@agoric/internal';
import { makeTracer, NonNullish } from '@agoric/internal';
import { eventLoopIteration } from '@agoric/internal/src/testing-utils.js';
import { Stable } from '@agoric/internal/src/tokens.js';
import { makeAgoricNamesAccess, makePromiseSpace } from '@agoric/vats';
import {
produceDiagnostics,
produceStartUpgradable,
} from '@agoric/vats/src/core/basic-behaviors.js';
import { makeHeapZone } from '@agoric/zone';
import { E, Far } from '@endo/far';
import path from 'path';
import { makeHeapZone } from '@agoric/zone';
import { Stable } from '@agoric/internal/src/tokens.js';
import { makeAnchorAsset, startPSM } from '../../src/proposals/startPSM.js';
import {
makeMockChainStorageRoot,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import { test as anyTest } from '@agoric/zoe/tools/prepare-test-env-ava.js';

import { NonNullish } from '@agoric/internal';
import { AssetKind, makeIssuerKit } from '@agoric/ertp';
import { zip } from '@agoric/internal';
import { NonNullish, zip } from '@agoric/internal';
import { eventLoopIteration } from '@agoric/internal/src/testing-utils.js';
import { coalesceUpdates } from '@agoric/smart-wallet/src/utils.js';
import { TimeMath } from '@agoric/time';
import buildManualTimer from '@agoric/zoe/tools/manualTimer.js';
import { E } from '@endo/far';
import { oracleBrandFeedName } from '../../src/proposals/utils.js';
import { INVITATION_MAKERS_DESC as EC_INVITATION_MAKERS_DESC } from '../../src/econCommitteeCharter.js';
import { INVITATION_MAKERS_DESC as ORACLE_INVITATION_MAKERS_DESC } from '../../src/price/fluxAggregatorKit.js';
import { oracleBrandFeedName } from '../../src/proposals/utils.js';
import { headValue } from '../supports.js';
import { buildRootObject } from './boot-psm.js';
import {
Expand Down
16 changes: 8 additions & 8 deletions packages/inter-protocol/test/supports.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ import binaryVoteCounterBundle from '@agoric/governance/bundles/bundle-binaryVot
import committeeBundle from '@agoric/governance/bundles/bundle-committee.js';
import contractGovernorBundle from '@agoric/governance/bundles/bundle-contractGovernor.js';
import puppetContractGovernorBundle from '@agoric/governance/bundles/bundle-puppetContractGovernor.js';
import * as utils from '@agoric/vats/src/core/utils.js';
import { makePromiseSpace, makeAgoricNamesAccess } from '@agoric/vats';
import { makeFakeBoard } from '@agoric/vats/tools/board-utils.js';
import { makeTracer } from '@agoric/internal';
import { makeMockChainStorageRoot } from '@agoric/internal/src/storage-test-utils.js';
import { setUpZoeForTest as generalSetUpZoeForTest } from '@agoric/zoe/tools/setup-zoe.js';
import { makeRatio } from '@agoric/zoe/src/contractSupport/ratio.js';
import { eventLoopIteration } from '@agoric/internal/src/testing-utils.js';
import buildManualTimer from '@agoric/zoe/tools/manualTimer.js';
import { E } from '@endo/far';
import { makeTracer } from '@agoric/internal';
import {
makeNotifierFromAsyncIterable,
observeIteration,
subscribeEach,
} from '@agoric/notifier';
import { makeAgoricNamesAccess, makePromiseSpace } from '@agoric/vats';
import { produceDiagnostics } from '@agoric/vats/src/core/basic-behaviors.js';
import * as utils from '@agoric/vats/src/core/utils.js';
import { makeFakeBoard } from '@agoric/vats/tools/board-utils.js';
import { makeRatio } from '@agoric/zoe/src/contractSupport/ratio.js';
import buildManualTimer from '@agoric/zoe/tools/manualTimer.js';
import { setUpZoeForTest as generalSetUpZoeForTest } from '@agoric/zoe/tools/setup-zoe.js';
import { E } from '@endo/far';

/** @import {EconomyBootstrapPowers as Space} from '../src/proposals/econ-behaviors.js' */

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
// @ts-check

import { Fail } from '@endo/errors';
import { NonNullish } from '@agoric/internal';
import { AmountMath, makeIssuerKit } from '@agoric/ertp';
import { CONTRACT_ELECTORATE, ParamTypes } from '@agoric/governance';
import { deeplyFulfilledObject, makeTracer } from '@agoric/internal';
import {
deeplyFulfilledObject,
makeTracer,
NonNullish,
} from '@agoric/internal';
import { makeFakeStorageKit } from '@agoric/internal/src/storage-test-utils.js';
import { makeNotifierFromSubscriber } from '@agoric/notifier';
import { makeNameHubKit } from '@agoric/vats';
import { makeFakeBoard } from '@agoric/vats/tools/board-utils.js';
import buildManualTimer from '@agoric/zoe/tools/manualTimer.js';
import { Fail } from '@endo/errors';
import { E } from '@endo/eventual-send';
import { Far } from '@endo/marshal';
import { makePromiseKit } from '@endo/promise-kit';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
// @ts-check

import { Fail } from '@endo/errors';
import { NonNullish } from '@agoric/internal';
import { AmountMath, makeIssuerKit } from '@agoric/ertp';
import { CONTRACT_ELECTORATE, ParamTypes } from '@agoric/governance';
import { deeplyFulfilledObject, makeTracer } from '@agoric/internal';
import {
deeplyFulfilledObject,
makeTracer,
NonNullish,
} from '@agoric/internal';
import { makeFakeStorageKit } from '@agoric/internal/src/storage-test-utils.js';
import { mustMatch } from '@agoric/store';
import { makeFakeBoard } from '@agoric/vats/tools/board-utils.js';
import { makeRatio } from '@agoric/zoe/src/contractSupport/ratio.js';
import { PaymentPKeywordRecordShape } from '@agoric/zoe/src/typeGuards.js';
import buildManualTimer from '@agoric/zoe/tools/manualTimer.js';
import { Fail } from '@endo/errors';
import { E } from '@endo/eventual-send';
import { Far } from '@endo/marshal';
import { makePromiseKit } from '@endo/promise-kit';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
// @ts-check

import { Fail } from '@endo/errors';
import { NonNullish } from '@agoric/internal';
import { makeIssuerKit } from '@agoric/ertp';
import { CONTRACT_ELECTORATE, ParamTypes } from '@agoric/governance';
import { deeplyFulfilledObject, makeTracer } from '@agoric/internal';
import {
deeplyFulfilledObject,
makeTracer,
NonNullish,
} from '@agoric/internal';
import { makeFakeStorageKit } from '@agoric/internal/src/storage-test-utils.js';
import { makeNameHubKit } from '@agoric/vats';
import { makeFakeBoard } from '@agoric/vats/tools/board-utils.js';
import buildManualTimer from '@agoric/zoe/tools/manualTimer.js';
import { Fail } from '@endo/errors';
import { E } from '@endo/eventual-send';
import { Far } from '@endo/marshal';
import { makePromiseKit } from '@endo/promise-kit';
Expand Down
5 changes: 2 additions & 3 deletions packages/inter-protocol/test/vaultFactory/driver.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import '@agoric/zoe/exported.js';

import { AmountMath, AssetKind, makeIssuerKit } from '@agoric/ertp';
import { allValues, makeTracer, objectMap } from '@agoric/internal';
import { allValues, makeTracer, NonNullish, objectMap } from '@agoric/internal';
import { makeNotifierFromSubscriber } from '@agoric/notifier';
import { unsafeMakeBundleCache } from '@agoric/swingset-vat/tools/bundleTool.js';
import {
Expand All @@ -14,10 +14,9 @@ import buildManualTimer from '@agoric/zoe/tools/manualTimer.js';
import { E } from '@endo/eventual-send';
import { deeplyFulfilled } from '@endo/marshal';

import { NonNullish } from '@agoric/internal';
import { eventLoopIteration } from '@agoric/notifier/tools/testSupports.js';
import { providePriceAuthorityRegistry } from '@agoric/vats/src/priceAuthorityRegistry.js';
import { makeScalarBigMapStore } from '@agoric/vat-data/src/index.js';
import { providePriceAuthorityRegistry } from '@agoric/vats/src/priceAuthorityRegistry.js';

import {
setupReserve,
Expand Down
4 changes: 1 addition & 3 deletions packages/swingset-liveslots/src/liveslots.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
getInterfaceOf,
makeMarshal,
} from '@endo/marshal';
import { assert, Fail } from '@endo/errors';
import { Fail, X } from '@endo/errors';
import { isPromise } from '@endo/promise-kit';
import { E, HandledPromise } from '@endo/eventual-send';
import { insistVatType, makeVatSlot, parseVatSlot } from './parseVatSlots.js';
Expand All @@ -20,8 +20,6 @@ import { makeWatchedPromiseManager } from './watchedPromises.js';
const SYSCALL_CAPDATA_BODY_SIZE_LIMIT = 10_000_000;
const SYSCALL_CAPDATA_SLOTS_LENGTH_LIMIT = 10_000;

const { details: X } = assert;

// 'makeLiveSlots' is a dispatcher which uses javascript Maps to keep track
// of local objects which have been exported. These cannot be persisted
// beyond the runtime of the javascript environment, so this mechanism is not
Expand Down
1 change: 0 additions & 1 deletion packages/swingset-liveslots/src/watchedPromises.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import { Fail } from '@endo/errors';
import { E } from '@endo/eventual-send';
import { assert } from '@endo/errors';
import { initEmpty, M } from '@agoric/store';
import { parseVatSlot } from './parseVatSlots.js';

Expand Down
4 changes: 2 additions & 2 deletions packages/vats/src/core/basic-behaviors.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { AssetKind } from '@agoric/ertp';
import { CONTRACT_ELECTORATE, ParamTypes } from '@agoric/governance';
import { Stable, Stake } from '@agoric/internal/src/tokens.js';
import {
BridgeId,
deeplyFulfilledObject,
NonNullish,
VBankAccount,
WalletName,
} from '@agoric/internal';
import { Stable, Stake } from '@agoric/internal/src/tokens.js';
import { keyEQ, makeScalarMapStore } from '@agoric/store';
import { provideLazy } from '@agoric/store/src/stores/store-utils.js';
import { E, getInterfaceOf } from '@endo/far';
import { Nat } from '@endo/nat';

import { Fail } from '@endo/errors';
import { NonNullish } from '@agoric/internal';
import { makeNameHubKit } from '../nameHub.js';
import { PowerFlags } from '../walletFlags.js';
import { feeIssuerConfig, makeMyAddressNameAdminKit } from './utils.js';
Expand Down
5 changes: 2 additions & 3 deletions packages/vats/src/nameHub.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { NonNullish } from '@agoric/internal';
import { E } from '@endo/far';
import { makePromiseKit } from '@endo/promise-kit';
import { M, getInterfaceGuardPayload } from '@endo/patterns';
import { makePromiseKit } from '@endo/promise-kit';

/// <reference path="./types.js" />
import { NonNullish, deeplyFulfilledObject } from '@agoric/internal';
import {
makeSyncMethodCallback,
prepareGuardedAttenuator,
} from '@agoric/internal/src/callback.js';
import { makeHeapZone } from '@agoric/zone';
import { deeplyFulfilledObject } from '@agoric/internal';

const { Fail, quote: q } = assert;

Expand Down
1 change: 1 addition & 0 deletions packages/zoe/src/contractFacet/offerHandlerStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { canBeDurable, provideDurableWeakMapStore } from '@agoric/vat-data';
import { defineDurableHandle } from '../makeHandle.js';

/**
* @import {Details} from 'ses';
* @import {RemotableBrand} from '@endo/eventual-send';
* @import {RemotableObject} from '@endo/pass-style';
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/zoe/src/contracts/loan/updateDebt.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Far } from '@endo/marshal';
import { makeNotifierKit, observeNotifier } from '@agoric/notifier';
import { assert, X } from '@endo/errors';
import { X } from '@endo/errors';
import { AmountMath } from '@agoric/ertp';
import { TimeMath } from '@agoric/time';

Expand Down

0 comments on commit 18b48ba

Please sign in to comment.