diff --git a/.github/workflows/test-all-packages.yml b/.github/workflows/test-all-packages.yml
index 330c9332ab2..2e8d4f8b15d 100644
--- a/.github/workflows/test-all-packages.yml
+++ b/.github/workflows/test-all-packages.yml
@@ -152,9 +152,6 @@ jobs:
- name: yarn test (access-token)
if: (success() || failure())
run: cd packages/access-token && yarn ${{ steps.vars.outputs.test }} | $TEST_COLLECT
- - name: yarn test (assert)
- if: (success() || failure())
- run: cd packages/assert && yarn ${{ steps.vars.outputs.test }} | $TEST_COLLECT
- name: yarn test (benchmark)
if: (success() || failure())
run: cd packages/benchmark && yarn ${{ steps.vars.outputs.test }} | $TEST_COLLECT
diff --git a/a3p-integration/proposals/c:stake-bld/test-lib/rpc.js b/a3p-integration/proposals/c:stake-bld/test-lib/rpc.js
index 5e047204151..2cc3c34913f 100644
--- a/a3p-integration/proposals/c:stake-bld/test-lib/rpc.js
+++ b/a3p-integration/proposals/c:stake-bld/test-lib/rpc.js
@@ -3,11 +3,11 @@
// @ts-check
/* global Buffer */
+import { Fail } from '@endo/errors';
import {
boardSlottingMarshaller,
makeBoardRemote,
} from '@agoric/internal/src/marshal.js';
-import { Fail } from '@endo/errors';
export { boardSlottingMarshaller };
diff --git a/multichain-testing/package.json b/multichain-testing/package.json
index 56f41459839..4c031c1a489 100644
--- a/multichain-testing/package.json
+++ b/multichain-testing/package.json
@@ -17,7 +17,7 @@
},
"packageManager": "yarn@4.1.1",
"devDependencies": {
- "@agoric/assert": "^0.6.0",
+ "@endo/errors": "^1.2.2",
"@agoric/cosmic-proto": "0.4.1-dev-08f8549.0",
"@cosmjs/crypto": "^0.32.2",
"@cosmjs/proto-signing": "^0.32.2",
diff --git a/multichain-testing/tools/batchQuery.js b/multichain-testing/tools/batchQuery.js
index 085e9e632fd..64c1d1855b5 100644
--- a/multichain-testing/tools/batchQuery.js
+++ b/multichain-testing/tools/batchQuery.js
@@ -1,4 +1,4 @@
-import { assert } from '@agoric/assert';
+import { assert } from '@endo/errors';
import { E } from '@endo/far';
/** @typedef {'children' | 'data'} AgoricChainStoragePathKind */
diff --git a/multichain-testing/tools/e2e-tools.js b/multichain-testing/tools/e2e-tools.js
index fd5b70f4a9d..3d5b7417c41 100644
--- a/multichain-testing/tools/e2e-tools.js
+++ b/multichain-testing/tools/e2e-tools.js
@@ -1,5 +1,5 @@
/** global harden */
-import { assert } from '@agoric/assert';
+import { assert } from '@endo/errors';
import { E, Far } from '@endo/far';
import { Nat } from '@endo/nat';
import { makePromiseKit } from '@endo/promise-kit';
diff --git a/multichain-testing/tools/makeHttpClient.js b/multichain-testing/tools/makeHttpClient.js
index 4261cb2672b..e422f3f3c38 100644
--- a/multichain-testing/tools/makeHttpClient.js
+++ b/multichain-testing/tools/makeHttpClient.js
@@ -1,4 +1,4 @@
-import { assert } from '@agoric/assert';
+import { assert } from '@endo/errors';
import { Far } from '@endo/far';
const { freeze } = Object;
diff --git a/packages/ERTP/package.json b/packages/ERTP/package.json
index 76bc34e84e4..7b1da460cbd 100644
--- a/packages/ERTP/package.json
+++ b/packages/ERTP/package.json
@@ -39,7 +39,7 @@
},
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
"dependencies": {
- "@agoric/assert": "^0.6.0",
+ "@endo/errors": "^1.2.2",
"@agoric/notifier": "^0.6.2",
"@agoric/store": "^0.9.2",
"@agoric/vat-data": "^0.5.2",
diff --git a/packages/ERTP/src/amountMath.js b/packages/ERTP/src/amountMath.js
index a6e362ba045..002051cc3b2 100644
--- a/packages/ERTP/src/amountMath.js
+++ b/packages/ERTP/src/amountMath.js
@@ -1,3 +1,4 @@
+import { q, Fail } from '@endo/errors';
import { passStyleOf, assertRemotable, assertRecord } from '@endo/marshal';
import { M, matches } from '@agoric/store';
@@ -11,8 +12,6 @@ import { copyBagMathHelpers } from './mathHelpers/copyBagMathHelpers.js';
* @import {Amount, AssetKind, AmountValue, AssetKindForValue, AssetValueForKind, Brand, CopyBagAmount, CopySetAmount, MathHelpers, NatAmount, NatValue, SetAmount, SetValue} from './types.js';
*/
-const { quote: q, Fail } = assert;
-
/**
* Constants for the kinds of assets we support.
*
diff --git a/packages/ERTP/src/displayInfo.js b/packages/ERTP/src/displayInfo.js
index 3af7093f5f6..ab197558f15 100644
--- a/packages/ERTP/src/displayInfo.js
+++ b/packages/ERTP/src/displayInfo.js
@@ -1,6 +1,6 @@
// @jessie-check
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import { mustMatch } from '@agoric/store';
import { DisplayInfoShape } from './typeGuards.js';
diff --git a/packages/ERTP/src/issuerKit.js b/packages/ERTP/src/issuerKit.js
index 939d65b14df..479eff192f2 100644
--- a/packages/ERTP/src/issuerKit.js
+++ b/packages/ERTP/src/issuerKit.js
@@ -1,6 +1,6 @@
// @jessie-check
-import { assert, Fail } from '@agoric/assert';
+import { assert, Fail } from '@endo/errors';
import { assertPattern } from '@agoric/store';
import { makeScalarBigMapStore } from '@agoric/vat-data';
import { makeDurableZone } from '@agoric/zone/durable.js';
diff --git a/packages/ERTP/src/legacy-payment-helpers.js b/packages/ERTP/src/legacy-payment-helpers.js
index 55ca90f1c44..f52d2f92ee6 100644
--- a/packages/ERTP/src/legacy-payment-helpers.js
+++ b/packages/ERTP/src/legacy-payment-helpers.js
@@ -1,7 +1,8 @@
// @jessie-check
-import { mustMatch } from '@agoric/store';
+import { Fail } from '@endo/errors';
import { E } from '@endo/far';
+import { mustMatch } from '@agoric/store';
import { AmountMath } from './amountMath.js';
/**
@@ -9,8 +10,6 @@ import { AmountMath } from './amountMath.js';
* @import {Amount, AssetKind, AmountValue, AssetKindForValue, Payment, Brand, Purse} from './types.js'
*/
-const { Fail } = assert;
-
/**
* @file This file contains safer helper function alternatives to the similarly
* named methods on issuer. These are parameterized by a purse used for
diff --git a/packages/ERTP/src/mathHelpers/natMathHelpers.js b/packages/ERTP/src/mathHelpers/natMathHelpers.js
index b15bc14b5d0..969ed7b4630 100644
--- a/packages/ERTP/src/mathHelpers/natMathHelpers.js
+++ b/packages/ERTP/src/mathHelpers/natMathHelpers.js
@@ -1,10 +1,10 @@
// @jessie-check
+import { Fail } from '@endo/errors';
import { Nat, isNat } from '@endo/nat';
/** @import {MathHelpers, NatValue} from '../types.js' */
-const { Fail } = assert;
const empty = 0n;
/**
diff --git a/packages/ERTP/src/paymentLedger.js b/packages/ERTP/src/paymentLedger.js
index 681ddd2eb20..dcf3baffcc6 100644
--- a/packages/ERTP/src/paymentLedger.js
+++ b/packages/ERTP/src/paymentLedger.js
@@ -3,6 +3,7 @@
///
/* eslint-disable no-use-before-define */
+import { X, q, Fail, annotateError } from '@endo/errors';
import { isPromise } from '@endo/promise-kit';
import { mustMatch, M, keyEQ } from '@agoric/store';
import { AmountMath } from './amountMath.js';
@@ -17,8 +18,6 @@ import { BrandI, makeIssuerInterfaces } from './typeGuards.js';
* @import {Key} from '@endo/patterns';
*/
-const { details: X, quote: q, Fail } = assert;
-
/**
* @param {Brand} brand
* @param {AssetKind} assetKind
@@ -133,7 +132,7 @@ export const preparePaymentLedger = (
try {
optShutdownWithFailure(reason);
} catch (errInShutdown) {
- assert.note(errInShutdown, X`Caused by: ${reason}`);
+ annotateError(errInShutdown, X`Caused by: ${reason}`);
throw errInShutdown;
}
}
diff --git a/packages/ERTP/src/purse.js b/packages/ERTP/src/purse.js
index cc4f073f668..323b7c8d24a 100644
--- a/packages/ERTP/src/purse.js
+++ b/packages/ERTP/src/purse.js
@@ -1,3 +1,4 @@
+import { Fail } from '@endo/errors';
import { M, makeCopySet } from '@agoric/store';
import { AmountMath } from './amountMath.js';
import { makeTransientNotifierKit } from './transientNotifier.js';
@@ -5,8 +6,6 @@ import { makeAmountStore } from './amountStore.js';
/** @import {Amount, AssetKind, AmountValue, AssetKindForValue, RecoverySetsOption, Brand, Payment} from './types.js' */
-const { Fail } = assert;
-
const EMPTY_COPY_SET = makeCopySet([]);
// TODO Type InterfaceGuard better than InterfaceGuard
diff --git a/packages/ERTP/test/swingsetTests/basicFunctionality/bootstrap.js b/packages/ERTP/test/swingsetTests/basicFunctionality/bootstrap.js
index 7fc825aff33..eee1378397a 100644
--- a/packages/ERTP/test/swingsetTests/basicFunctionality/bootstrap.js
+++ b/packages/ERTP/test/swingsetTests/basicFunctionality/bootstrap.js
@@ -1,5 +1,5 @@
import { E } from '@endo/eventual-send';
-import { assert, details as X } from '@agoric/assert';
+import { assert, X } from '@endo/errors';
import { Far } from '@endo/marshal';
import { makeIssuerKit, AmountMath } from '../../../src/index.js';
diff --git a/packages/ERTP/test/swingsetTests/ertpService/ertp-service-upgrade.test.js b/packages/ERTP/test/swingsetTests/ertpService/ertp-service-upgrade.test.js
index a686df41deb..186c0d3fb2a 100644
--- a/packages/ERTP/test/swingsetTests/ertpService/ertp-service-upgrade.test.js
+++ b/packages/ERTP/test/swingsetTests/ertpService/ertp-service-upgrade.test.js
@@ -1,6 +1,6 @@
import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava.js';
-import { assert } from '@agoric/assert';
+import { assert } from '@endo/errors';
import { buildVatController } from '@agoric/swingset-vat';
const bfile = name => new URL(name, import.meta.url).pathname;
diff --git a/packages/ERTP/test/swingsetTests/splitPayments/bootstrap.js b/packages/ERTP/test/swingsetTests/splitPayments/bootstrap.js
index 9a37b9b82a6..5e99e872799 100644
--- a/packages/ERTP/test/swingsetTests/splitPayments/bootstrap.js
+++ b/packages/ERTP/test/swingsetTests/splitPayments/bootstrap.js
@@ -1,5 +1,5 @@
import { E } from '@endo/eventual-send';
-import { assert, details as X } from '@agoric/assert';
+import { assert, X } from '@endo/errors';
import { Far } from '@endo/marshal';
import { makeIssuerKit, AmountMath } from '../../../src/index.js';
diff --git a/packages/ERTP/test/unitTests/mintObj.test.js b/packages/ERTP/test/unitTests/mintObj.test.js
index 9bb3024cbd4..782f4cd5917 100644
--- a/packages/ERTP/test/unitTests/mintObj.test.js
+++ b/packages/ERTP/test/unitTests/mintObj.test.js
@@ -1,7 +1,7 @@
import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava.js';
+import { assert } from '@endo/errors';
import { initEmpty, M } from '@agoric/store';
-import { assert } from '@agoric/assert';
import { defineDurableKind, makeKindHandle } from '@agoric/vat-data';
import { makeIssuerKit, AssetKind, AmountMath } from '../../src/index.js';
diff --git a/packages/SwingSet/package.json b/packages/SwingSet/package.json
index 90644c03ed5..a67c8dc0ac1 100644
--- a/packages/SwingSet/package.json
+++ b/packages/SwingSet/package.json
@@ -27,7 +27,7 @@
"@types/yargs-parser": "^21.0.0"
},
"dependencies": {
- "@agoric/assert": "^0.6.0",
+ "@endo/errors": "^1.2.2",
"@agoric/internal": "^0.3.2",
"@agoric/kmarshal": "^0.1.0",
"@agoric/store": "^0.9.2",
diff --git a/packages/SwingSet/src/controller/controller.js b/packages/SwingSet/src/controller/controller.js
index 32eaa4e40b5..5534fa3e343 100644
--- a/packages/SwingSet/src/controller/controller.js
+++ b/packages/SwingSet/src/controller/controller.js
@@ -9,7 +9,7 @@ import { tmpName } from 'tmp';
import anylogger from 'anylogger';
import microtime from 'microtime';
-import { assert, Fail } from '@agoric/assert';
+import { assert, Fail } from '@endo/errors';
import { importBundle } from '@endo/import-bundle';
import { initSwingStore } from '@agoric/swing-store';
diff --git a/packages/SwingSet/src/controller/initializeKernel.js b/packages/SwingSet/src/controller/initializeKernel.js
index 3378a28c39f..e9e26f93411 100644
--- a/packages/SwingSet/src/controller/initializeKernel.js
+++ b/packages/SwingSet/src/controller/initializeKernel.js
@@ -1,8 +1,8 @@
/* eslint-disable no-use-before-define */
+import { assert, Fail } from '@endo/errors';
import { makeMarshal } from '@endo/marshal';
import { Far } from '@endo/far';
-import { assert, Fail } from '@agoric/assert';
import { kser, kunser } from '@agoric/kmarshal';
import { assertKnownOptions } from '../lib/assertOptions.js';
import { insistVatID } from '../lib/id.js';
diff --git a/packages/SwingSet/src/controller/initializeSwingset.js b/packages/SwingSet/src/controller/initializeSwingset.js
index e3f48c3950a..649c68bcd6f 100644
--- a/packages/SwingSet/src/controller/initializeSwingset.js
+++ b/packages/SwingSet/src/controller/initializeSwingset.js
@@ -2,7 +2,7 @@
import fs from 'fs';
import path from 'path';
-import { assert, Fail } from '@agoric/assert';
+import { assert, Fail } from '@endo/errors';
import { makeTracer } from '@agoric/internal';
import { mustMatch } from '@agoric/store';
import bundleSource from '@endo/bundle-source';
diff --git a/packages/SwingSet/src/controller/startXSnap.js b/packages/SwingSet/src/controller/startXSnap.js
index b68145ccf1d..f5d7f311120 100644
--- a/packages/SwingSet/src/controller/startXSnap.js
+++ b/packages/SwingSet/src/controller/startXSnap.js
@@ -1,5 +1,5 @@
import path from 'path';
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import { type as osType } from 'os';
import { xsnap, recordXSnap } from '@agoric/xsnap';
diff --git a/packages/SwingSet/src/devices/bridge/device-bridge.js b/packages/SwingSet/src/devices/bridge/device-bridge.js
index 463bf3097e0..216bf6556ca 100644
--- a/packages/SwingSet/src/devices/bridge/device-bridge.js
+++ b/packages/SwingSet/src/devices/bridge/device-bridge.js
@@ -1,4 +1,4 @@
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import { Far } from '@endo/far';
function sanitize(data) {
diff --git a/packages/SwingSet/src/devices/bundle/device-bundle.js b/packages/SwingSet/src/devices/bundle/device-bundle.js
index 1b3dfa74d77..88f87ffd8da 100644
--- a/packages/SwingSet/src/devices/bundle/device-bundle.js
+++ b/packages/SwingSet/src/devices/bundle/device-bundle.js
@@ -1,4 +1,4 @@
-import { assert } from '@agoric/assert';
+import { assert } from '@endo/errors';
import { buildSerializationTools } from '../lib/deviceTools.js';
/*
diff --git a/packages/SwingSet/src/devices/command/command.js b/packages/SwingSet/src/devices/command/command.js
index 9649052eeb5..d2d3a0e73a9 100644
--- a/packages/SwingSet/src/devices/command/command.js
+++ b/packages/SwingSet/src/devices/command/command.js
@@ -1,8 +1,7 @@
+import { Fail } from '@endo/errors';
import { makePromiseKit } from '@endo/promise-kit';
import { Nat } from '@endo/nat';
-import { Fail } from '@agoric/assert';
-
export default function buildCommand(broadcastCallback) {
broadcastCallback || Fail`broadcastCallback must be provided.`;
let inboundCallback;
diff --git a/packages/SwingSet/src/devices/command/device-command.js b/packages/SwingSet/src/devices/command/device-command.js
index 98af2ea490c..e9fe2e7a533 100644
--- a/packages/SwingSet/src/devices/command/device-command.js
+++ b/packages/SwingSet/src/devices/command/device-command.js
@@ -1,8 +1,7 @@
+import { Fail } from '@endo/errors';
import { Nat } from '@endo/nat';
import { Far } from '@endo/far';
-import { Fail } from '@agoric/assert';
-
export function buildRootDeviceNode(tools) {
const { SO, getDeviceState, setDeviceState, endowments } = tools;
const { registerInboundCallback, deliverResponse, sendBroadcast } =
diff --git a/packages/SwingSet/src/devices/lib/deviceTools.js b/packages/SwingSet/src/devices/lib/deviceTools.js
index 562d2daab1a..9b5c91aaf28 100644
--- a/packages/SwingSet/src/devices/lib/deviceTools.js
+++ b/packages/SwingSet/src/devices/lib/deviceTools.js
@@ -1,4 +1,4 @@
-import { assert, Fail } from '@agoric/assert';
+import { assert, Fail } from '@endo/errors';
import { makeMarshal } from '@endo/marshal';
import { Far } from '@endo/far';
import { parseVatSlot } from '../../lib/parseVatSlots.js';
diff --git a/packages/SwingSet/src/devices/loopbox/device-loopbox.js b/packages/SwingSet/src/devices/loopbox/device-loopbox.js
index cb9bb6f1fdc..403dbefed68 100644
--- a/packages/SwingSet/src/devices/loopbox/device-loopbox.js
+++ b/packages/SwingSet/src/devices/loopbox/device-loopbox.js
@@ -1,4 +1,4 @@
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import { Far } from '@endo/far';
export function buildRootDeviceNode(tools) {
diff --git a/packages/SwingSet/src/devices/loopbox/loopbox.js b/packages/SwingSet/src/devices/loopbox/loopbox.js
index 6a7477b4ce7..86e8884b485 100644
--- a/packages/SwingSet/src/devices/loopbox/loopbox.js
+++ b/packages/SwingSet/src/devices/loopbox/loopbox.js
@@ -1,4 +1,4 @@
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
/*
* The "loopbox" is a special device used for unit tests, which glues one
diff --git a/packages/SwingSet/src/devices/mailbox/device-mailbox.js b/packages/SwingSet/src/devices/mailbox/device-mailbox.js
index 256e0c2e1e6..ae4bf5cfc30 100644
--- a/packages/SwingSet/src/devices/mailbox/device-mailbox.js
+++ b/packages/SwingSet/src/devices/mailbox/device-mailbox.js
@@ -1,8 +1,7 @@
+import { assert, Fail } from '@endo/errors';
import { Nat } from '@endo/nat';
import { Far } from '@endo/far';
-import { assert, Fail } from '@agoric/assert';
-
export function buildRootDeviceNode(tools) {
const { SO, getDeviceState, setDeviceState, endowments } = tools;
diff --git a/packages/SwingSet/src/devices/mailbox/mailbox.js b/packages/SwingSet/src/devices/mailbox/mailbox.js
index a54d11fe888..e3d6ef0c165 100644
--- a/packages/SwingSet/src/devices/mailbox/mailbox.js
+++ b/packages/SwingSet/src/devices/mailbox/mailbox.js
@@ -64,10 +64,9 @@
*/
+import { Fail } from '@endo/errors';
import { Nat } from '@endo/nat';
-import { Fail } from '@agoric/assert';
-
// This Map-based mailboxState object is a good starting point, but we may
// replace it with one that tracks which parts of the state have been
// modified, to build more efficient Merkle proofs.
diff --git a/packages/SwingSet/src/devices/plugin/device-plugin.js b/packages/SwingSet/src/devices/plugin/device-plugin.js
index 41927ffe8fa..f71d57e2738 100644
--- a/packages/SwingSet/src/devices/plugin/device-plugin.js
+++ b/packages/SwingSet/src/devices/plugin/device-plugin.js
@@ -1,6 +1,6 @@
+import { Fail } from '@endo/errors';
import { makeCapTP } from '@endo/captp';
import { Far } from '@endo/far';
-import { Fail } from '@agoric/assert';
export function buildRootDeviceNode(tools) {
const { SO, getDeviceState, setDeviceState, endowments } = tools;
diff --git a/packages/SwingSet/src/devices/timer/device-timer.js b/packages/SwingSet/src/devices/timer/device-timer.js
index 25818d17bc5..99ca76322a4 100644
--- a/packages/SwingSet/src/devices/timer/device-timer.js
+++ b/packages/SwingSet/src/devices/timer/device-timer.js
@@ -23,7 +23,7 @@
*/
import { Nat } from '@endo/nat';
-import { assert, Fail } from '@agoric/assert';
+import { assert, Fail } from '@endo/errors';
import { Far } from '@endo/far';
// Since we use harden when saving the state, we need to copy the arrays so they
diff --git a/packages/SwingSet/src/devices/timer/timer.js b/packages/SwingSet/src/devices/timer/timer.js
index beb17efc8d4..3fa0361cacc 100644
--- a/packages/SwingSet/src/devices/timer/timer.js
+++ b/packages/SwingSet/src/devices/timer/timer.js
@@ -1,6 +1,6 @@
import { Nat } from '@endo/nat';
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
/**
* Endowments for a Timer device that can be made available to SwingSet vats.
diff --git a/packages/SwingSet/src/devices/vat-admin/device-vat-admin.js b/packages/SwingSet/src/devices/vat-admin/device-vat-admin.js
index 3aec158d099..e25943a667f 100644
--- a/packages/SwingSet/src/devices/vat-admin/device-vat-admin.js
+++ b/packages/SwingSet/src/devices/vat-admin/device-vat-admin.js
@@ -1,5 +1,5 @@
import { Nat } from '@endo/nat';
-import { assert } from '@agoric/assert';
+import { assert } from '@endo/errors';
import { kunser } from '@agoric/kmarshal';
import { buildSerializationTools } from '../lib/deviceTools.js';
import { insistVatID } from '../../lib/id.js';
diff --git a/packages/SwingSet/src/kernel/deviceManager.js b/packages/SwingSet/src/kernel/deviceManager.js
index 35220b0ae69..77ecd002098 100644
--- a/packages/SwingSet/src/kernel/deviceManager.js
+++ b/packages/SwingSet/src/kernel/deviceManager.js
@@ -1,4 +1,4 @@
-import { assert, Fail } from '@agoric/assert';
+import { assert, Fail } from '@endo/errors';
import { makeDeviceSlots } from './deviceSlots.js';
import { insistCapData } from '../lib/capdata.js';
diff --git a/packages/SwingSet/src/kernel/deviceSlots.js b/packages/SwingSet/src/kernel/deviceSlots.js
index e42fa461a25..609edc0837a 100644
--- a/packages/SwingSet/src/kernel/deviceSlots.js
+++ b/packages/SwingSet/src/kernel/deviceSlots.js
@@ -1,6 +1,6 @@
import { Remotable, makeMarshal } from '@endo/marshal';
import { passStyleOf } from '@endo/far';
-import { assert, Fail } from '@agoric/assert';
+import { assert, Fail } from '@endo/errors';
import {
insistVatType,
makeVatSlot,
diff --git a/packages/SwingSet/src/kernel/deviceTranslator.js b/packages/SwingSet/src/kernel/deviceTranslator.js
index f8c88dd9282..229d27512aa 100644
--- a/packages/SwingSet/src/kernel/deviceTranslator.js
+++ b/packages/SwingSet/src/kernel/deviceTranslator.js
@@ -1,5 +1,5 @@
// @ts-nocheck
-import { assert, Fail } from '@agoric/assert';
+import { assert, Fail } from '@endo/errors';
import { insistMessage } from '../lib/message.js';
import { insistKernelType } from './parseKernelSlots.js';
import { insistVatType, parseVatSlot } from '../lib/parseVatSlots.js';
diff --git a/packages/SwingSet/src/kernel/dummyMeterControl.js b/packages/SwingSet/src/kernel/dummyMeterControl.js
index d03961cfc13..19088a1caab 100644
--- a/packages/SwingSet/src/kernel/dummyMeterControl.js
+++ b/packages/SwingSet/src/kernel/dummyMeterControl.js
@@ -1,4 +1,4 @@
-import { assert } from '@agoric/assert';
+import { assert } from '@endo/errors';
export function makeDummyMeterControl() {
let meteringDisabled = 0;
diff --git a/packages/SwingSet/src/kernel/gc-actions.js b/packages/SwingSet/src/kernel/gc-actions.js
index 38c4a6a6151..01adbeeff45 100644
--- a/packages/SwingSet/src/kernel/gc-actions.js
+++ b/packages/SwingSet/src/kernel/gc-actions.js
@@ -1,4 +1,4 @@
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import { insistKernelType } from './parseKernelSlots.js';
import { insistVatID } from '../lib/id.js';
diff --git a/packages/SwingSet/src/kernel/kernel.js b/packages/SwingSet/src/kernel/kernel.js
index df5dfd1fba1..200a69a434b 100644
--- a/packages/SwingSet/src/kernel/kernel.js
+++ b/packages/SwingSet/src/kernel/kernel.js
@@ -1,6 +1,6 @@
/* global globalThis */
-import { assert, Fail } from '@agoric/assert';
+import { assert, Fail } from '@endo/errors';
import { isNat } from '@endo/nat';
import { importBundle } from '@endo/import-bundle';
import { makeUpgradeDisconnection } from '@agoric/internal/src/upgrade-api.js';
diff --git a/packages/SwingSet/src/kernel/kernelSyscall.js b/packages/SwingSet/src/kernel/kernelSyscall.js
index eed35256b25..fa1ce165daf 100644
--- a/packages/SwingSet/src/kernel/kernelSyscall.js
+++ b/packages/SwingSet/src/kernel/kernelSyscall.js
@@ -1,4 +1,4 @@
-import { assert, Fail } from '@agoric/assert';
+import { assert, Fail } from '@endo/errors';
import { insistKernelType } from './parseKernelSlots.js';
import { insistCapData } from '../lib/capdata.js';
import { insistDeviceID, insistVatID } from '../lib/id.js';
diff --git a/packages/SwingSet/src/kernel/parseKernelSlots.js b/packages/SwingSet/src/kernel/parseKernelSlots.js
index e76ee77c58d..f4934dbacb0 100644
--- a/packages/SwingSet/src/kernel/parseKernelSlots.js
+++ b/packages/SwingSet/src/kernel/parseKernelSlots.js
@@ -1,5 +1,5 @@
import { Nat } from '@endo/nat';
-import { assert, Fail } from '@agoric/assert';
+import { assert, Fail } from '@endo/errors';
// Object/promise references (in the kernel) contain a two-tuple of (type,
// index). All object references point to entries in the kernel Object
diff --git a/packages/SwingSet/src/kernel/slogger.js b/packages/SwingSet/src/kernel/slogger.js
index b88ac1e8528..be5b6d017d1 100644
--- a/packages/SwingSet/src/kernel/slogger.js
+++ b/packages/SwingSet/src/kernel/slogger.js
@@ -1,4 +1,4 @@
-import { quote } from '@agoric/assert';
+import { q } from '@endo/errors';
const IDLE = 'idle';
const STARTUP = 'startup';
@@ -66,7 +66,7 @@ function makeCallbackRegistry(callbacks) {
if (!cbNames.length) {
return;
}
- console.warn(errorUnusedMsg, cbNames.map(quote).sort().join(', '));
+ console.warn(errorUnusedMsg, cbNames.map(q).sort().join(', '));
},
});
}
diff --git a/packages/SwingSet/src/kernel/state/deviceKeeper.js b/packages/SwingSet/src/kernel/state/deviceKeeper.js
index 3c5e9f3fe6e..72200df6698 100644
--- a/packages/SwingSet/src/kernel/state/deviceKeeper.js
+++ b/packages/SwingSet/src/kernel/state/deviceKeeper.js
@@ -3,7 +3,7 @@
*/
import { Nat } from '@endo/nat';
-import { assert, Fail } from '@agoric/assert';
+import { assert, Fail } from '@endo/errors';
import { parseKernelSlot } from '../parseKernelSlots.js';
import { makeVatSlot, parseVatSlot } from '../../lib/parseVatSlots.js';
import { insistDeviceID } from '../../lib/id.js';
diff --git a/packages/SwingSet/src/kernel/state/kernelKeeper.js b/packages/SwingSet/src/kernel/state/kernelKeeper.js
index 4295b0ccf96..192be013c41 100644
--- a/packages/SwingSet/src/kernel/state/kernelKeeper.js
+++ b/packages/SwingSet/src/kernel/state/kernelKeeper.js
@@ -1,5 +1,5 @@
import { Nat, isNat } from '@endo/nat';
-import { assert, Fail } from '@agoric/assert';
+import { assert, Fail } from '@endo/errors';
import { initializeVatState, makeVatKeeper } from './vatKeeper.js';
import { initializeDeviceState, makeDeviceKeeper } from './deviceKeeper.js';
import { parseReachableAndVatSlot } from './reachable.js';
diff --git a/packages/SwingSet/src/kernel/state/reachable.js b/packages/SwingSet/src/kernel/state/reachable.js
index 94753bd1b63..3a6162af399 100644
--- a/packages/SwingSet/src/kernel/state/reachable.js
+++ b/packages/SwingSet/src/kernel/state/reachable.js
@@ -1,4 +1,4 @@
-import { assert, Fail } from '@agoric/assert';
+import { assert, Fail } from '@endo/errors';
export function parseReachableAndVatSlot(value) {
typeof value === 'string' || Fail`non-string value: ${value}`;
diff --git a/packages/SwingSet/src/kernel/state/stats.js b/packages/SwingSet/src/kernel/state/stats.js
index 6da7edab83c..e05257b805a 100644
--- a/packages/SwingSet/src/kernel/state/stats.js
+++ b/packages/SwingSet/src/kernel/state/stats.js
@@ -1,4 +1,4 @@
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
/** @typedef {'counter' | 'gauge'} KernelStatsMetricType */
/**
diff --git a/packages/SwingSet/src/kernel/state/storageHelper.js b/packages/SwingSet/src/kernel/state/storageHelper.js
index cad0a907a39..65a8a796090 100644
--- a/packages/SwingSet/src/kernel/state/storageHelper.js
+++ b/packages/SwingSet/src/kernel/state/storageHelper.js
@@ -1,6 +1,6 @@
// @ts-check
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
/**
* Iterate over keys with a given prefix, in lexicographic order,
diff --git a/packages/SwingSet/src/kernel/state/vatKeeper.js b/packages/SwingSet/src/kernel/state/vatKeeper.js
index 11b2e776ce6..2d6312c7c4c 100644
--- a/packages/SwingSet/src/kernel/state/vatKeeper.js
+++ b/packages/SwingSet/src/kernel/state/vatKeeper.js
@@ -2,7 +2,7 @@
* Kernel's keeper of persistent state for a vat.
*/
import { Nat, isNat } from '@endo/nat';
-import { assert, q, Fail } from '@agoric/assert';
+import { assert, q, Fail } from '@endo/errors';
import { parseKernelSlot } from '../parseKernelSlots.js';
import { makeVatSlot, parseVatSlot } from '../../lib/parseVatSlots.js';
import { insistVatID } from '../../lib/id.js';
diff --git a/packages/SwingSet/src/kernel/vat-admin-hooks.js b/packages/SwingSet/src/kernel/vat-admin-hooks.js
index 35045111b0f..affff0758b5 100644
--- a/packages/SwingSet/src/kernel/vat-admin-hooks.js
+++ b/packages/SwingSet/src/kernel/vat-admin-hooks.js
@@ -1,4 +1,4 @@
-import { assert } from '@agoric/assert';
+import { assert } from '@endo/errors';
import { kser, kunser } from '@agoric/kmarshal';
import { insistVatID } from '../lib/id.js';
diff --git a/packages/SwingSet/src/kernel/vat-loader/manager-factory.js b/packages/SwingSet/src/kernel/vat-loader/manager-factory.js
index 56160da9254..2b8de555d9c 100644
--- a/packages/SwingSet/src/kernel/vat-loader/manager-factory.js
+++ b/packages/SwingSet/src/kernel/vat-loader/manager-factory.js
@@ -1,4 +1,4 @@
-import { assert, Fail } from '@agoric/assert';
+import { assert, Fail } from '@endo/errors';
import { assertKnownOptions } from '../../lib/assertOptions.js';
import { makeLocalVatManagerFactory } from './manager-local.js';
import { makeNodeSubprocessFactory } from './manager-subprocess-node.js';
diff --git a/packages/SwingSet/src/kernel/vat-loader/manager-helper.js b/packages/SwingSet/src/kernel/vat-loader/manager-helper.js
index 8df28db1fe3..13a074cf118 100644
--- a/packages/SwingSet/src/kernel/vat-loader/manager-helper.js
+++ b/packages/SwingSet/src/kernel/vat-loader/manager-helper.js
@@ -1,4 +1,4 @@
-import { assert } from '@agoric/assert';
+import { assert } from '@endo/errors';
import '../../types-ambient.js';
import {
insistVatDeliveryResult,
diff --git a/packages/SwingSet/src/kernel/vat-loader/manager-local.js b/packages/SwingSet/src/kernel/vat-loader/manager-local.js
index 46d61def5fb..9261676a1e3 100644
--- a/packages/SwingSet/src/kernel/vat-loader/manager-local.js
+++ b/packages/SwingSet/src/kernel/vat-loader/manager-local.js
@@ -1,6 +1,6 @@
/* global globalThis */
-import { assert, Fail } from '@agoric/assert';
+import { assert, Fail } from '@endo/errors';
import { importBundle } from '@endo/import-bundle';
import { makeLiveSlots } from '@agoric/swingset-liveslots';
import { makeManagerKit } from './manager-helper.js';
diff --git a/packages/SwingSet/src/kernel/vat-loader/manager-subprocess-node.js b/packages/SwingSet/src/kernel/vat-loader/manager-subprocess-node.js
index 5ac7ec60f05..9cfad88feb7 100644
--- a/packages/SwingSet/src/kernel/vat-loader/manager-subprocess-node.js
+++ b/packages/SwingSet/src/kernel/vat-loader/manager-subprocess-node.js
@@ -1,6 +1,6 @@
// import { spawn } from 'child_process'; // not from Compartment
-import { assert, Fail } from '@agoric/assert';
+import { assert, Fail } from '@endo/errors';
import { E } from '@endo/eventual-send';
import { makePromiseKit } from '@endo/promise-kit';
import { makeManagerKit } from './manager-helper.js';
diff --git a/packages/SwingSet/src/kernel/vat-loader/manager-subprocess-xsnap.js b/packages/SwingSet/src/kernel/vat-loader/manager-subprocess-xsnap.js
index 712e6cce863..ff9a4bb1d50 100644
--- a/packages/SwingSet/src/kernel/vat-loader/manager-subprocess-xsnap.js
+++ b/packages/SwingSet/src/kernel/vat-loader/manager-subprocess-xsnap.js
@@ -1,5 +1,5 @@
import { synchronizedTee } from '@agoric/internal';
-import { assert, Fail, q } from '@agoric/assert';
+import { assert, Fail, q } from '@endo/errors';
import { ExitCode } from '@agoric/xsnap/api.js';
import { makeManagerKit } from './manager-helper.js';
diff --git a/packages/SwingSet/src/kernel/vat-loader/vat-loader.js b/packages/SwingSet/src/kernel/vat-loader/vat-loader.js
index a83022673d1..34fc179af0d 100644
--- a/packages/SwingSet/src/kernel/vat-loader/vat-loader.js
+++ b/packages/SwingSet/src/kernel/vat-loader/vat-loader.js
@@ -1,4 +1,4 @@
-import { assert, Fail } from '@agoric/assert';
+import { assert, Fail } from '@endo/errors';
import { assertKnownOptions } from '../../lib/assertOptions.js';
import { makeVatSlot } from '../../lib/parseVatSlots.js';
diff --git a/packages/SwingSet/src/kernel/vat-warehouse.js b/packages/SwingSet/src/kernel/vat-warehouse.js
index 327b74fd4ea..9dc8903c713 100644
--- a/packages/SwingSet/src/kernel/vat-warehouse.js
+++ b/packages/SwingSet/src/kernel/vat-warehouse.js
@@ -1,4 +1,4 @@
-import { assert, Fail, quote as q } from '@agoric/assert';
+import { assert, Fail, q } from '@endo/errors';
import { isNat } from '@endo/nat';
import { makeVatTranslators } from './vatTranslator.js';
import { insistVatDeliveryResult } from '../lib/message.js';
diff --git a/packages/SwingSet/src/kernel/vatTranslator.js b/packages/SwingSet/src/kernel/vatTranslator.js
index 782fb8189d1..4f1d1e2aa08 100644
--- a/packages/SwingSet/src/kernel/vatTranslator.js
+++ b/packages/SwingSet/src/kernel/vatTranslator.js
@@ -1,4 +1,4 @@
-import { assert, Fail } from '@agoric/assert';
+import { assert, Fail } from '@endo/errors';
import { insistMessage } from '../lib/message.js';
import { insistKernelType, parseKernelSlot } from './parseKernelSlots.js';
import { insistVatType, parseVatSlot } from '../lib/parseVatSlots.js';
diff --git a/packages/SwingSet/src/lib/assertOptions.js b/packages/SwingSet/src/lib/assertOptions.js
index 5e91e628f6a..9174fe3cbe8 100644
--- a/packages/SwingSet/src/lib/assertOptions.js
+++ b/packages/SwingSet/src/lib/assertOptions.js
@@ -1,4 +1,4 @@
-import { assert, Fail } from '@agoric/assert';
+import { assert, Fail } from '@endo/errors';
export function assertKnownOptions(options, knownNames) {
assert(knownNames instanceof Array);
diff --git a/packages/SwingSet/src/lib/capdata.js b/packages/SwingSet/src/lib/capdata.js
index 5a2d03ef8c1..84a430f3cc6 100644
--- a/packages/SwingSet/src/lib/capdata.js
+++ b/packages/SwingSet/src/lib/capdata.js
@@ -1,4 +1,4 @@
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import { passStyleOf } from '@endo/far';
import { kunser, krefOf } from '@agoric/kmarshal';
diff --git a/packages/SwingSet/src/lib/id.js b/packages/SwingSet/src/lib/id.js
index ca20188a5aa..34d674d1ba6 100644
--- a/packages/SwingSet/src/lib/id.js
+++ b/packages/SwingSet/src/lib/id.js
@@ -1,6 +1,6 @@
import { Nat } from '@endo/nat';
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
// Vats are identified by an integer index, which (for typechecking purposes)
// is encoded as `vNN`. Devices are similarly identified as `dNN`. Both have
diff --git a/packages/SwingSet/src/lib/message.js b/packages/SwingSet/src/lib/message.js
index 387ed058bb3..4f496a6837b 100644
--- a/packages/SwingSet/src/lib/message.js
+++ b/packages/SwingSet/src/lib/message.js
@@ -1,4 +1,4 @@
-import { assert, Fail } from '@agoric/assert';
+import { assert, Fail } from '@endo/errors';
import { insistCapData } from './capdata.js';
/**
diff --git a/packages/SwingSet/src/lib/parseVatSlots.js b/packages/SwingSet/src/lib/parseVatSlots.js
index 11abe5e428a..7b2dc48c081 100644
--- a/packages/SwingSet/src/lib/parseVatSlots.js
+++ b/packages/SwingSet/src/lib/parseVatSlots.js
@@ -1,5 +1,5 @@
import { Nat } from '@endo/nat';
-import { assert, Fail } from '@agoric/assert';
+import { assert, Fail } from '@endo/errors';
// NOTE: confusing terminology: "slot" vs. "reference". All these things
// called "slots" are references, but the word "slot" suggests something into
diff --git a/packages/SwingSet/src/lib/recordVatOptions.js b/packages/SwingSet/src/lib/recordVatOptions.js
index 81330a8a26b..09b8e9c759a 100644
--- a/packages/SwingSet/src/lib/recordVatOptions.js
+++ b/packages/SwingSet/src/lib/recordVatOptions.js
@@ -1,4 +1,4 @@
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import { makeWorkerOptions } from './workerOptions.js';
export const makeVatOptionRecorder = (kernelKeeper, bundleHandler) => {
diff --git a/packages/SwingSet/src/lib/runPolicies.js b/packages/SwingSet/src/lib/runPolicies.js
index e3528d53c63..2b54eace7af 100644
--- a/packages/SwingSet/src/lib/runPolicies.js
+++ b/packages/SwingSet/src/lib/runPolicies.js
@@ -1,4 +1,4 @@
-import { assert } from '@agoric/assert';
+import { assert } from '@endo/errors';
export function foreverPolicy() {
/** @type { RunPolicy } */
diff --git a/packages/SwingSet/src/lib/storageAPI.js b/packages/SwingSet/src/lib/storageAPI.js
index 209a4377e20..1e5b6c5a4eb 100644
--- a/packages/SwingSet/src/lib/storageAPI.js
+++ b/packages/SwingSet/src/lib/storageAPI.js
@@ -1,4 +1,4 @@
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
/**
* Assert function to ensure that an object implements the StorageAPI
diff --git a/packages/SwingSet/src/lib/workerOptions.js b/packages/SwingSet/src/lib/workerOptions.js
index 0747047d108..4e4cc897119 100644
--- a/packages/SwingSet/src/lib/workerOptions.js
+++ b/packages/SwingSet/src/lib/workerOptions.js
@@ -1,4 +1,4 @@
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
/**
* @param {string} managerType
diff --git a/packages/SwingSet/src/supervisors/subprocess-node/supervisor-subprocess-node.js b/packages/SwingSet/src/supervisors/subprocess-node/supervisor-subprocess-node.js
index 2ad8c55e485..8f1067b84ca 100644
--- a/packages/SwingSet/src/supervisors/subprocess-node/supervisor-subprocess-node.js
+++ b/packages/SwingSet/src/supervisors/subprocess-node/supervisor-subprocess-node.js
@@ -8,7 +8,7 @@ import fs from 'fs';
import { Buffer } from 'buffer';
import process from 'node:process';
-import { assert, details as X, Fail } from '@agoric/assert';
+import { assert, X, Fail } from '@endo/errors';
import { importBundle } from '@endo/import-bundle';
import { makeMarshal } from '@endo/marshal';
import {
diff --git a/packages/SwingSet/src/vats/comms/clist-inbound.js b/packages/SwingSet/src/vats/comms/clist-inbound.js
index fe95fb321dd..437911b1dc4 100644
--- a/packages/SwingSet/src/vats/comms/clist-inbound.js
+++ b/packages/SwingSet/src/vats/comms/clist-inbound.js
@@ -1,4 +1,4 @@
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import {
flipRemoteSlot,
insistRemoteType,
diff --git a/packages/SwingSet/src/vats/comms/clist-kernel.js b/packages/SwingSet/src/vats/comms/clist-kernel.js
index d32db8c83f2..e701091462b 100644
--- a/packages/SwingSet/src/vats/comms/clist-kernel.js
+++ b/packages/SwingSet/src/vats/comms/clist-kernel.js
@@ -1,4 +1,4 @@
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import { parseVatSlot, insistVatType } from '../../lib/parseVatSlots.js';
import { parseLocalSlot } from './parseLocalSlots.js';
import { cdebug } from './cdebug.js';
diff --git a/packages/SwingSet/src/vats/comms/clist-outbound.js b/packages/SwingSet/src/vats/comms/clist-outbound.js
index fdd1a9d5756..05739ea9457 100644
--- a/packages/SwingSet/src/vats/comms/clist-outbound.js
+++ b/packages/SwingSet/src/vats/comms/clist-outbound.js
@@ -1,4 +1,4 @@
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import { parseLocalSlot, insistLocalType } from './parseLocalSlots.js';
import {
flipRemoteSlot,
diff --git a/packages/SwingSet/src/vats/comms/controller.js b/packages/SwingSet/src/vats/comms/controller.js
index e914c742d7b..8314257eaf7 100644
--- a/packages/SwingSet/src/vats/comms/controller.js
+++ b/packages/SwingSet/src/vats/comms/controller.js
@@ -1,5 +1,5 @@
import { Nat } from '@endo/nat';
-import { assert, Fail } from '@agoric/assert';
+import { assert, Fail } from '@endo/errors';
import { kser, kunser, kslot, krefOf } from '@agoric/kmarshal';
// deliverToController() is used for local vats which want to talk to us as a
diff --git a/packages/SwingSet/src/vats/comms/delivery.js b/packages/SwingSet/src/vats/comms/delivery.js
index b8b624e5d2a..bdfd8703226 100644
--- a/packages/SwingSet/src/vats/comms/delivery.js
+++ b/packages/SwingSet/src/vats/comms/delivery.js
@@ -1,6 +1,6 @@
/* eslint-disable no-use-before-define */
-import { assert, Fail } from '@agoric/assert';
+import { assert, Fail } from '@endo/errors';
import { kser } from '@agoric/kmarshal';
import { parseLocalSlot, insistLocalType } from './parseLocalSlots.js';
import { makeUndeliverableError } from '../../lib/makeUndeliverableError.js';
diff --git a/packages/SwingSet/src/vats/comms/dispatch.js b/packages/SwingSet/src/vats/comms/dispatch.js
index 5480dabc5ce..68212073ce6 100644
--- a/packages/SwingSet/src/vats/comms/dispatch.js
+++ b/packages/SwingSet/src/vats/comms/dispatch.js
@@ -1,4 +1,4 @@
-import { assert, Fail } from '@agoric/assert';
+import { assert, Fail } from '@endo/errors';
import { kser, kunser } from '@agoric/kmarshal';
import { makeVatSlot } from '../../lib/parseVatSlots.js';
import { insistMessage } from '../../lib/message.js';
diff --git a/packages/SwingSet/src/vats/comms/gc-comms.js b/packages/SwingSet/src/vats/comms/gc-comms.js
index 32991459fa9..b73bdafb1cd 100644
--- a/packages/SwingSet/src/vats/comms/gc-comms.js
+++ b/packages/SwingSet/src/vats/comms/gc-comms.js
@@ -1,4 +1,4 @@
-import { assert, Fail } from '@agoric/assert';
+import { assert, Fail } from '@endo/errors';
import { parseVatSlot } from '../../lib/parseVatSlots.js';
import { parseRemoteSlot } from './parseRemoteSlot.js';
diff --git a/packages/SwingSet/src/vats/comms/parseLocalSlots.js b/packages/SwingSet/src/vats/comms/parseLocalSlots.js
index 9a269cbc89f..e7b951bcb88 100644
--- a/packages/SwingSet/src/vats/comms/parseLocalSlots.js
+++ b/packages/SwingSet/src/vats/comms/parseLocalSlots.js
@@ -1,5 +1,5 @@
import { Nat } from '@endo/nat';
-import { assert, Fail } from '@agoric/assert';
+import { assert, Fail } from '@endo/errors';
// Local object/promise references (in the comms vat) contain a two-tuple of
// (type, index). All object references point to entries in the Local Object
diff --git a/packages/SwingSet/src/vats/comms/parseRemoteSlot.js b/packages/SwingSet/src/vats/comms/parseRemoteSlot.js
index 757f3f2e1c3..a33d66b0d1c 100644
--- a/packages/SwingSet/src/vats/comms/parseRemoteSlot.js
+++ b/packages/SwingSet/src/vats/comms/parseRemoteSlot.js
@@ -1,5 +1,5 @@
import { Nat } from '@endo/nat';
-import { assert, Fail } from '@agoric/assert';
+import { assert, Fail } from '@endo/errors';
// Object/promise references (in remote messages) contain a three-tuple of
// (type, allocator flag, index). The allocator flag inside an inbound
diff --git a/packages/SwingSet/src/vats/comms/remote.js b/packages/SwingSet/src/vats/comms/remote.js
index a1f4d91a61a..c39a3e63dc4 100644
--- a/packages/SwingSet/src/vats/comms/remote.js
+++ b/packages/SwingSet/src/vats/comms/remote.js
@@ -1,5 +1,5 @@
import { Nat } from '@endo/nat';
-import { assert, Fail } from '@agoric/assert';
+import { assert, Fail } from '@endo/errors';
import { parseLocalSlot, insistLocalType } from './parseLocalSlots.js';
import {
makeRemoteSlot,
diff --git a/packages/SwingSet/src/vats/comms/state.js b/packages/SwingSet/src/vats/comms/state.js
index c326d6e4d42..65813f276b7 100644
--- a/packages/SwingSet/src/vats/comms/state.js
+++ b/packages/SwingSet/src/vats/comms/state.js
@@ -1,5 +1,5 @@
import { Nat } from '@endo/nat';
-import { assert, Fail } from '@agoric/assert';
+import { assert, Fail } from '@endo/errors';
import { insistCapData } from '../../lib/capdata.js';
import {
makeVatSlot,
diff --git a/packages/SwingSet/src/vats/timer/vat-timer.js b/packages/SwingSet/src/vats/timer/vat-timer.js
index 6f449c9aec3..7ea007bf2cc 100644
--- a/packages/SwingSet/src/vats/timer/vat-timer.js
+++ b/packages/SwingSet/src/vats/timer/vat-timer.js
@@ -1,9 +1,9 @@
/* eslint-disable no-use-before-define */
+import { assert } from '@endo/errors';
import { Far, E, passStyleOf } from '@endo/far';
import { makePromiseKit } from '@endo/promise-kit';
import { Nat } from '@endo/nat';
-import { assert } from '@agoric/assert';
import {
provideKindHandle,
provideDurableMapStore,
diff --git a/packages/SwingSet/src/vats/vat-admin/vat-vat-admin.js b/packages/SwingSet/src/vats/vat-admin/vat-vat-admin.js
index 2ee906d4526..058692f036a 100644
--- a/packages/SwingSet/src/vats/vat-admin/vat-vat-admin.js
+++ b/packages/SwingSet/src/vats/vat-admin/vat-vat-admin.js
@@ -5,10 +5,11 @@
* must ensure that only data goes in and out. It's also responsible for turning
* device affordances into objects that can be used by code in other vats.
*/
+import { Nat, isNat } from '@endo/nat';
+import { q, Fail } from '@endo/errors';
import { makePromiseKit } from '@endo/promise-kit';
// import { makeNotifierKit } from '@agoric/notifier'; // XXX RESTORE
import { Far, E, passStyleOf } from '@endo/far';
-import { Nat, isNat } from '@endo/nat';
import {
provide,
makeScalarBigMapStore,
@@ -17,8 +18,6 @@ import {
prepareSingleton,
} from '@agoric/vat-data';
-const { quote: q, Fail } = assert;
-
const managerTypes = ['local', 'node-subprocess', 'xsnap', 'xs-worker']; // xs-worker is alias
function producePRR() {
diff --git a/packages/SwingSet/src/vats/vattp/vat-vattp.js b/packages/SwingSet/src/vats/vattp/vat-vattp.js
index f85d4dca222..0a4f247290c 100644
--- a/packages/SwingSet/src/vats/vattp/vat-vattp.js
+++ b/packages/SwingSet/src/vats/vattp/vat-vattp.js
@@ -1,4 +1,4 @@
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import {
provide,
defineDurableKindMulti,
diff --git a/packages/SwingSet/test/basedir-promises-2/bootstrap.js b/packages/SwingSet/test/basedir-promises-2/bootstrap.js
index a67d406a3ff..19312d647e6 100644
--- a/packages/SwingSet/test/basedir-promises-2/bootstrap.js
+++ b/packages/SwingSet/test/basedir-promises-2/bootstrap.js
@@ -1,6 +1,6 @@
import { makePromiseKit } from '@endo/promise-kit';
import { Far, E } from '@endo/far';
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
export function buildRootObject(vatPowers, vatParameters) {
const log = vatPowers.testLog;
diff --git a/packages/SwingSet/test/basedir-promises/bootstrap.js b/packages/SwingSet/test/basedir-promises/bootstrap.js
index a5ef76fc22e..fe0ba8a5a22 100644
--- a/packages/SwingSet/test/basedir-promises/bootstrap.js
+++ b/packages/SwingSet/test/basedir-promises/bootstrap.js
@@ -1,7 +1,7 @@
import { makePromiseKit } from '@endo/promise-kit';
import { Far, E } from '@endo/far';
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
export function buildRootObject(vatPowers, vatParameters) {
const log = vatPowers.testLog;
diff --git a/packages/SwingSet/test/basedir-transcript/bootstrap.js b/packages/SwingSet/test/basedir-transcript/bootstrap.js
index 917f5abe142..59c59422d73 100644
--- a/packages/SwingSet/test/basedir-transcript/bootstrap.js
+++ b/packages/SwingSet/test/basedir-transcript/bootstrap.js
@@ -1,5 +1,5 @@
import { Far, E } from '@endo/far';
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
export function buildRootObject(vatPowers, vatParameters) {
return Far('root', {
diff --git a/packages/SwingSet/test/bundling/bootstrap-bundles.js b/packages/SwingSet/test/bundling/bootstrap-bundles.js
index 93e20095c07..803d6fecde5 100644
--- a/packages/SwingSet/test/bundling/bootstrap-bundles.js
+++ b/packages/SwingSet/test/bundling/bootstrap-bundles.js
@@ -1,4 +1,4 @@
-import { assert } from '@agoric/assert';
+import { assert } from '@endo/errors';
import { Far, E } from '@endo/far';
import { importBundle } from '@endo/import-bundle';
diff --git a/packages/SwingSet/test/bundling/bundles.test.js b/packages/SwingSet/test/bundling/bundles.test.js
index c3c3d85b495..03004e5b4d3 100644
--- a/packages/SwingSet/test/bundling/bundles.test.js
+++ b/packages/SwingSet/test/bundling/bundles.test.js
@@ -4,7 +4,7 @@ import { test } from '../../tools/prepare-test-env-ava.js';
import fs from 'fs';
import bundleSource from '@endo/bundle-source';
-import { assert } from '@agoric/assert';
+import { assert } from '@endo/errors';
import { kunser, krefOf } from '@agoric/kmarshal';
import { initSwingStore } from '@agoric/swing-store';
import { initializeSwingset, makeSwingsetController } from '../../src/index.js';
diff --git a/packages/SwingSet/test/change-parameters/change-parameters.test.js b/packages/SwingSet/test/change-parameters/change-parameters.test.js
index 290cba11ca1..0e2de993dee 100644
--- a/packages/SwingSet/test/change-parameters/change-parameters.test.js
+++ b/packages/SwingSet/test/change-parameters/change-parameters.test.js
@@ -2,7 +2,7 @@
// eslint-disable-next-line import/order
import { test } from '../../tools/prepare-test-env-ava.js';
-import { assert } from '@agoric/assert';
+import { assert } from '@endo/errors';
import { kunser } from '@agoric/kmarshal';
import { initSwingStore } from '@agoric/swing-store';
import { initializeSwingset, makeSwingsetController } from '../../src/index.js';
diff --git a/packages/SwingSet/test/commsVatDriver.js b/packages/SwingSet/test/commsVatDriver.js
index 8e5ffdadc25..21a30e96796 100644
--- a/packages/SwingSet/test/commsVatDriver.js
+++ b/packages/SwingSet/test/commsVatDriver.js
@@ -1,5 +1,5 @@
// @ts-nocheck
-import { assert, Fail } from '@agoric/assert';
+import { assert, Fail } from '@endo/errors';
import { kslot, kser } from '@agoric/kmarshal';
import buildCommsDispatch from '../src/vats/comms/index.js';
import { debugState } from '../src/vats/comms/dispatch.js';
diff --git a/packages/SwingSet/test/device-mailbox/bootstrap-device-mailbox.js b/packages/SwingSet/test/device-mailbox/bootstrap-device-mailbox.js
index 2739b4266d6..7e8f6bdf828 100644
--- a/packages/SwingSet/test/device-mailbox/bootstrap-device-mailbox.js
+++ b/packages/SwingSet/test/device-mailbox/bootstrap-device-mailbox.js
@@ -1,5 +1,5 @@
import { Far, E } from '@endo/far';
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
export function buildRootObject(vatPowers, vatParameters) {
const { D, testLog: log } = vatPowers;
diff --git a/packages/SwingSet/test/device-plugin/bootstrap.js b/packages/SwingSet/test/device-plugin/bootstrap.js
index 20bc3c1f4eb..8c7f4c59fb2 100644
--- a/packages/SwingSet/test/device-plugin/bootstrap.js
+++ b/packages/SwingSet/test/device-plugin/bootstrap.js
@@ -1,5 +1,5 @@
import { Far, E } from '@endo/far';
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import { makePluginManager } from '../../src/vats/plugin-manager.js';
export function buildRootObject(vatPowers, vatParameters) {
diff --git a/packages/SwingSet/test/device-plugin/vat-bridge.js b/packages/SwingSet/test/device-plugin/vat-bridge.js
index 1c1c0e36f4f..4c434b7be79 100644
--- a/packages/SwingSet/test/device-plugin/vat-bridge.js
+++ b/packages/SwingSet/test/device-plugin/vat-bridge.js
@@ -1,5 +1,5 @@
import { Far, E } from '@endo/far';
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
export function buildRootObject(vatPowers, _vatParameters) {
const log = vatPowers.testLog;
diff --git a/packages/SwingSet/test/devices/bootstrap-1.js b/packages/SwingSet/test/devices/bootstrap-1.js
index 058b5c6b6f4..664b9196e93 100644
--- a/packages/SwingSet/test/devices/bootstrap-1.js
+++ b/packages/SwingSet/test/devices/bootstrap-1.js
@@ -1,4 +1,4 @@
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import { kser, kunser, krefOf } from '@agoric/kmarshal';
import { extractMessage } from '../vat-util.js';
diff --git a/packages/SwingSet/test/devices/bootstrap-3.js b/packages/SwingSet/test/devices/bootstrap-3.js
index 3bff1e5cd71..566cb6bc379 100644
--- a/packages/SwingSet/test/devices/bootstrap-3.js
+++ b/packages/SwingSet/test/devices/bootstrap-3.js
@@ -1,4 +1,4 @@
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import { Far } from '@endo/far';
export function buildRootObject(vatPowers, vatParameters) {
diff --git a/packages/SwingSet/test/devices/device-raw-0.js b/packages/SwingSet/test/devices/device-raw-0.js
index d4e1ff1021b..b1ca08adfa8 100644
--- a/packages/SwingSet/test/devices/device-raw-0.js
+++ b/packages/SwingSet/test/devices/device-raw-0.js
@@ -1,4 +1,4 @@
-import { assert } from '@agoric/assert';
+import { assert } from '@endo/errors';
import { buildSerializationTools } from '../../src/devices/lib/deviceTools.js';
export function buildDevice(tools, endowments) {
diff --git a/packages/SwingSet/test/files-vattp/bootstrap-test-vattp.js b/packages/SwingSet/test/files-vattp/bootstrap-test-vattp.js
index 097d7da86b9..5325d28a0e1 100644
--- a/packages/SwingSet/test/files-vattp/bootstrap-test-vattp.js
+++ b/packages/SwingSet/test/files-vattp/bootstrap-test-vattp.js
@@ -1,5 +1,5 @@
import { Far, E } from '@endo/far';
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
export function buildRootObject(vatPowers, vatParameters) {
const { D, testLog: log } = vatPowers;
diff --git a/packages/SwingSet/test/gc-kernel.test.js b/packages/SwingSet/test/gc-kernel.test.js
index aa594391f07..eef51e76a4f 100644
--- a/packages/SwingSet/test/gc-kernel.test.js
+++ b/packages/SwingSet/test/gc-kernel.test.js
@@ -5,7 +5,7 @@ import anylogger from 'anylogger';
// eslint-disable-next-line import/order
import { test } from '../tools/prepare-test-env-ava.js';
-import { assert } from '@agoric/assert';
+import { assert } from '@endo/errors';
import { kser, kunser, kslot } from '@agoric/kmarshal';
import { initSwingStore } from '@agoric/swing-store';
import { waitUntilQuiescent } from '@agoric/internal/src/lib-nodejs/waitUntilQuiescent.js';
diff --git a/packages/SwingSet/test/kernel.test.js b/packages/SwingSet/test/kernel.test.js
index 81e734fd66e..95dc619a19b 100644
--- a/packages/SwingSet/test/kernel.test.js
+++ b/packages/SwingSet/test/kernel.test.js
@@ -2,7 +2,7 @@
// eslint-disable-next-line import/order
import { test } from '../tools/prepare-test-env-ava.js';
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import { kser, kslot } from '@agoric/kmarshal';
import buildKernel from '../src/kernel/index.js';
import { initializeKernel } from '../src/controller/initializeKernel.js';
diff --git a/packages/SwingSet/test/message-patterns.js b/packages/SwingSet/test/message-patterns.js
index b393c236a5d..9ab90a912f7 100644
--- a/packages/SwingSet/test/message-patterns.js
+++ b/packages/SwingSet/test/message-patterns.js
@@ -3,7 +3,7 @@
// test.stuff patterns.
import { makePromiseKit } from '@endo/promise-kit';
-import { quote as q } from '@agoric/assert';
+import { q } from '@endo/errors';
import { Far, E } from '@endo/far';
import { ignore } from './vat-util.js';
diff --git a/packages/SwingSet/test/promise-watcher/promise-watcher.test.js b/packages/SwingSet/test/promise-watcher/promise-watcher.test.js
index a8737a61e9b..7c607a4d355 100644
--- a/packages/SwingSet/test/promise-watcher/promise-watcher.test.js
+++ b/packages/SwingSet/test/promise-watcher/promise-watcher.test.js
@@ -5,7 +5,7 @@ import { handleUnhandledRejections } from './unhandledRejectionDetector.js';
import { test } from '../../tools/prepare-test-env-ava.js';
// eslint-disable-next-line import/order
-import { assert } from '@agoric/assert';
+import { assert } from '@endo/errors';
// eslint-disable-next-line import/order
import { initSwingStore } from '@agoric/swing-store';
import { initializeSwingset, makeSwingsetController } from '../../src/index.js';
diff --git a/packages/SwingSet/test/timer-device/bootstrap.js b/packages/SwingSet/test/timer-device/bootstrap.js
index 14bee765765..80d69515710 100644
--- a/packages/SwingSet/test/timer-device/bootstrap.js
+++ b/packages/SwingSet/test/timer-device/bootstrap.js
@@ -1,4 +1,4 @@
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import { Nat } from '@endo/nat';
import { Far } from '@endo/far';
diff --git a/packages/SwingSet/test/upgrade/bootstrap-scripted-upgrade.js b/packages/SwingSet/test/upgrade/bootstrap-scripted-upgrade.js
index b5762a77ad1..c93cfa6b568 100644
--- a/packages/SwingSet/test/upgrade/bootstrap-scripted-upgrade.js
+++ b/packages/SwingSet/test/upgrade/bootstrap-scripted-upgrade.js
@@ -1,5 +1,5 @@
import { Far, E } from '@endo/far';
-import { assert } from '@agoric/assert';
+import { assert } from '@endo/errors';
import { makePromiseKit } from '@endo/promise-kit';
const NUM_SENSORS = 39;
diff --git a/packages/SwingSet/test/upgrade/upgrade-replay.test.js b/packages/SwingSet/test/upgrade/upgrade-replay.test.js
index 6c02487e833..1cd95fc32d2 100644
--- a/packages/SwingSet/test/upgrade/upgrade-replay.test.js
+++ b/packages/SwingSet/test/upgrade/upgrade-replay.test.js
@@ -2,7 +2,7 @@
// eslint-disable-next-line import/order
import { test } from '../../tools/prepare-test-env-ava.js';
-import { assert } from '@agoric/assert';
+import { assert } from '@endo/errors';
import { kser } from '@agoric/kmarshal';
import { initSwingStore } from '@agoric/swing-store';
import {
diff --git a/packages/SwingSet/test/upgrade/upgrade.test.js b/packages/SwingSet/test/upgrade/upgrade.test.js
index 4066c203466..77b7c781b87 100644
--- a/packages/SwingSet/test/upgrade/upgrade.test.js
+++ b/packages/SwingSet/test/upgrade/upgrade.test.js
@@ -2,7 +2,7 @@
// eslint-disable-next-line import/order
import { test } from '../../tools/prepare-test-env-ava.js';
-import { assert } from '@agoric/assert';
+import { assert } from '@endo/errors';
import bundleSource from '@endo/bundle-source';
import { objectMap } from '@agoric/internal';
import { kser, kunser, krefOf } from '@agoric/kmarshal';
diff --git a/packages/SwingSet/test/upgrade/vat-ulrik-2.js b/packages/SwingSet/test/upgrade/vat-ulrik-2.js
index 0d80ed3b490..e843e2154e3 100644
--- a/packages/SwingSet/test/upgrade/vat-ulrik-2.js
+++ b/packages/SwingSet/test/upgrade/vat-ulrik-2.js
@@ -1,5 +1,5 @@
import { Far, E } from '@endo/far';
-import { assert } from '@agoric/assert';
+import { assert } from '@endo/errors';
import { initEmpty } from '@agoric/store';
import { defineDurableKind, defineDurableKindMulti } from '@agoric/vat-data';
diff --git a/packages/SwingSet/test/vat-util.js b/packages/SwingSet/test/vat-util.js
index e03fdcf3c97..8d2c4be5a13 100644
--- a/packages/SwingSet/test/vat-util.js
+++ b/packages/SwingSet/test/vat-util.js
@@ -1,7 +1,7 @@
// this file is imported by some test vats, so don't import any non-pure
// modules
-import { assert } from '@agoric/assert';
+import { assert } from '@endo/errors';
import { kser, kunser } from '@agoric/kmarshal';
export function extractMessage(vatDeliverObject) {
diff --git a/packages/SwingSet/test/virtualObjects/collection-slots/collection-slots.test.js b/packages/SwingSet/test/virtualObjects/collection-slots/collection-slots.test.js
index f0d629a86e7..2c77a2e65c7 100644
--- a/packages/SwingSet/test/virtualObjects/collection-slots/collection-slots.test.js
+++ b/packages/SwingSet/test/virtualObjects/collection-slots/collection-slots.test.js
@@ -2,7 +2,7 @@
// eslint-disable-next-line import/order
import { test } from '../../../tools/prepare-test-env-ava.js';
-import { assert } from '@agoric/assert';
+import { assert } from '@endo/errors';
import { kunser, krefOf } from '@agoric/kmarshal';
import { initSwingStore } from '@agoric/swing-store';
import { parseReachableAndVatSlot } from '../../../src/kernel/state/reachable.js';
diff --git a/packages/SwingSet/test/virtualObjects/delete-stored-vo/delete-stored-vo.test.js b/packages/SwingSet/test/virtualObjects/delete-stored-vo/delete-stored-vo.test.js
index 291c664f51b..443a79fd3a8 100644
--- a/packages/SwingSet/test/virtualObjects/delete-stored-vo/delete-stored-vo.test.js
+++ b/packages/SwingSet/test/virtualObjects/delete-stored-vo/delete-stored-vo.test.js
@@ -2,7 +2,7 @@
// eslint-disable-next-line import/order
import { test } from '../../../tools/prepare-test-env-ava.js';
-import { assert } from '@agoric/assert';
+import { assert } from '@endo/errors';
import { kunser, krefOf } from '@agoric/kmarshal';
import { initSwingStore } from '@agoric/swing-store';
import { parseReachableAndVatSlot } from '../../../src/kernel/state/reachable.js';
diff --git a/packages/SwingSet/test/vpid-kernel.test.js b/packages/SwingSet/test/vpid-kernel.test.js
index c97023516ed..a34fcc8281e 100644
--- a/packages/SwingSet/test/vpid-kernel.test.js
+++ b/packages/SwingSet/test/vpid-kernel.test.js
@@ -4,7 +4,7 @@
import { test } from '../tools/prepare-test-env-ava.js';
import anylogger from 'anylogger';
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import { kser, kslot } from '@agoric/kmarshal';
import { initSwingStore } from '@agoric/swing-store';
import { waitUntilQuiescent } from '@agoric/internal/src/lib-nodejs/waitUntilQuiescent.js';
diff --git a/packages/SwingSet/test/zcf-ish-upgrade/zcf-ish-upgrade.test.js b/packages/SwingSet/test/zcf-ish-upgrade/zcf-ish-upgrade.test.js
index 153a51a159a..d88e5c2db77 100644
--- a/packages/SwingSet/test/zcf-ish-upgrade/zcf-ish-upgrade.test.js
+++ b/packages/SwingSet/test/zcf-ish-upgrade/zcf-ish-upgrade.test.js
@@ -1,7 +1,7 @@
// eslint-disable-next-line import/order
import { test } from '../../tools/prepare-test-env-ava.js';
-import { assert } from '@agoric/assert';
+import { assert } from '@endo/errors';
import { initSwingStore } from '@agoric/swing-store';
import { initializeSwingset, makeSwingsetController } from '../../src/index.js';
diff --git a/packages/SwingSet/tools/bootstrap-relay.js b/packages/SwingSet/tools/bootstrap-relay.js
index 6fa802b397e..730a7aa6593 100644
--- a/packages/SwingSet/tools/bootstrap-relay.js
+++ b/packages/SwingSet/tools/bootstrap-relay.js
@@ -1,11 +1,9 @@
-import { assert } from '@agoric/assert';
+import { Fail, q } from '@endo/errors';
import { objectMap } from '@agoric/internal';
import { Far, E } from '@endo/far';
import { makePromiseKit } from '@endo/promise-kit';
import { buildManualTimer } from './manual-timer.js';
-const { Fail, quote: q } = assert;
-
export const buildRootObject = () => {
const timer = buildManualTimer();
let vatAdmin;
diff --git a/packages/SwingSet/tools/dvo-test-harness.js b/packages/SwingSet/tools/dvo-test-harness.js
index b8d54b0a953..d921c37de55 100644
--- a/packages/SwingSet/tools/dvo-test-harness.js
+++ b/packages/SwingSet/tools/dvo-test-harness.js
@@ -1,7 +1,7 @@
// eslint-disable-next-line import/order
import { test } from './prepare-test-env-ava.js';
-import { assert } from '@agoric/assert';
+import { assert } from '@endo/errors';
import { makeMarshal } from '@endo/marshal';
import { initSwingStore } from '@agoric/swing-store';
import { initializeSwingset, makeSwingsetController } from '../src/index.js';
diff --git a/packages/SwingSet/tools/manual-timer.js b/packages/SwingSet/tools/manual-timer.js
index 0634b892715..6eb7a62bad1 100644
--- a/packages/SwingSet/tools/manual-timer.js
+++ b/packages/SwingSet/tools/manual-timer.js
@@ -1,5 +1,5 @@
+import { Fail } from '@endo/errors';
import { Far } from '@endo/far';
-import { Fail } from '@agoric/assert';
import { makeScalarMapStore } from '@agoric/store';
import { bindAllMethods } from '@agoric/internal';
import { TimeMath } from '@agoric/time';
diff --git a/packages/SwingSet/tools/run-utils.js b/packages/SwingSet/tools/run-utils.js
index efe1499b2e5..5c1ed2e4b39 100644
--- a/packages/SwingSet/tools/run-utils.js
+++ b/packages/SwingSet/tools/run-utils.js
@@ -1,4 +1,4 @@
-import { Fail, q } from '@agoric/assert';
+import { Fail, q } from '@endo/errors';
import { kunser } from '@agoric/kmarshal';
import { makeQueue } from '@endo/stream';
diff --git a/packages/agoric-cli/package.json b/packages/agoric-cli/package.json
index b5780b31f46..033ba869677 100644
--- a/packages/agoric-cli/package.json
+++ b/packages/agoric-cli/package.json
@@ -37,7 +37,7 @@
},
"dependencies": {
"@agoric/access-token": "^0.4.21",
- "@agoric/assert": "^0.6.0",
+ "@endo/errors": "^1.2.2",
"@agoric/cache": "^0.3.2",
"@agoric/casting": "^0.4.2",
"@agoric/cosmic-proto": "^0.4.0",
diff --git a/packages/agoric-cli/src/commands/auction.js b/packages/agoric-cli/src/commands/auction.js
index 78e3d8a8515..0b33b7507da 100644
--- a/packages/agoric-cli/src/commands/auction.js
+++ b/packages/agoric-cli/src/commands/auction.js
@@ -1,11 +1,10 @@
// @ts-check
import { InvalidArgumentError } from 'commander';
+import { Fail } from '@endo/errors';
import { makeRpcUtils } from '../lib/rpc.js';
import { outputActionAndHint } from '../lib/wallet.js';
-const { Fail } = assert;
-
/**
* @import {ParamTypesMap, ParamTypesMapFromRecord} from '@agoric/governance/src/contractGovernance/typedParamManager.js'
* @import {ParamValueForType} from '@agoric/governance/src/types.js'
diff --git a/packages/agoric-cli/src/commands/oracle.js b/packages/agoric-cli/src/commands/oracle.js
index cd958fb609c..af03aad0c21 100644
--- a/packages/agoric-cli/src/commands/oracle.js
+++ b/packages/agoric-cli/src/commands/oracle.js
@@ -1,9 +1,9 @@
// @ts-check
/* eslint-disable func-names */
/* global fetch, setTimeout, process */
-import { Fail } from '@agoric/assert';
-import { Offers } from '@agoric/inter-protocol/src/clientSupport.js';
+import { Fail } from '@endo/errors';
import { Nat } from '@endo/nat';
+import { Offers } from '@agoric/inter-protocol/src/clientSupport.js';
import { Command } from 'commander';
import * as cp from 'child_process';
import { inspect } from 'util';
diff --git a/packages/agoric-cli/src/commands/test-upgrade.js b/packages/agoric-cli/src/commands/test-upgrade.js
index f530b05dd12..ca1aeda4a83 100644
--- a/packages/agoric-cli/src/commands/test-upgrade.js
+++ b/packages/agoric-cli/src/commands/test-upgrade.js
@@ -1,6 +1,6 @@
// @ts-check
/* global process */
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import { CommanderError } from 'commander';
import { normalizeAddressWithOptions } from '../lib/chain.js';
import { bigintReplacer } from '../lib/format.js';
diff --git a/packages/agoric-cli/src/deploy.js b/packages/agoric-cli/src/deploy.js
index bd324d2206f..68e2a94e6f1 100644
--- a/packages/agoric-cli/src/deploy.js
+++ b/packages/agoric-cli/src/deploy.js
@@ -1,8 +1,9 @@
// @ts-check
/* global process setTimeout setInterval clearInterval */
-import { E, makeCapTP } from '@endo/captp';
+import { X } from '@endo/errors';
import { makePromiseKit } from '@endo/promise-kit';
+import { E, makeCapTP } from '@endo/captp';
import { makeLeaderFromRpcAddresses } from '@agoric/casting';
import path from 'path';
import http from 'http';
@@ -20,8 +21,6 @@ import {
import { makeJsonHttpClient } from './json-http-client-node.js';
import { makeScriptLoader } from './scripts.js';
-const { details: X } = assert;
-
// note: CapTP has its own HandledPromise instantiation, and the contract
// must use the same one that CapTP uses. We achieve this by not bundling
// captp, and doing a (non-isolated) dynamic import of the deploy script
diff --git a/packages/agoric-cli/src/lib/format.js b/packages/agoric-cli/src/lib/format.js
index 9e50c4d6e33..78227bcd615 100644
--- a/packages/agoric-cli/src/lib/format.js
+++ b/packages/agoric-cli/src/lib/format.js
@@ -1,5 +1,6 @@
// @ts-check
+import { Fail, q } from '@endo/errors';
import { makeBoardRemote } from '@agoric/vats/tools/board-utils.js';
/** @import {BoardRemote} from '@agoric/vats/tools/board-utils.js' */
@@ -71,8 +72,6 @@ export const asPercent = ratio => {
return (100 * Number(numerator.value)) / Number(denominator.value);
};
-const { Fail, quote: q } = assert;
-
const isObject = x => typeof x === 'object' && x !== null;
/**
diff --git a/packages/agoric-cli/src/lib/rpc.js b/packages/agoric-cli/src/lib/rpc.js
index 23da41fe7ff..5400c751efb 100644
--- a/packages/agoric-cli/src/lib/rpc.js
+++ b/packages/agoric-cli/src/lib/rpc.js
@@ -1,7 +1,7 @@
// @ts-check
/* global Buffer, fetch, process */
-import { NonNullish } from '@agoric/assert';
+import { NonNullish } from '@agoric/internal';
import {
boardSlottingMarshaller,
makeBoardRemote,
diff --git a/packages/agoric-cli/src/lib/wallet.js b/packages/agoric-cli/src/lib/wallet.js
index 610135d2910..c120db764e9 100644
--- a/packages/agoric-cli/src/lib/wallet.js
+++ b/packages/agoric-cli/src/lib/wallet.js
@@ -1,6 +1,7 @@
// @ts-check
/* global process */
+import { Fail } from '@endo/errors';
import { iterateReverse } from '@agoric/casting';
import { makeWalletStateCoalescer } from '@agoric/smart-wallet/src/utils.js';
import { execSwingsetTransaction, pollBlocks, pollTx } from './chain.js';
@@ -9,7 +10,6 @@ import { boardSlottingMarshaller, makeRpcUtils } from './rpc.js';
/** @import {CurrentWalletRecord} from '@agoric/smart-wallet/src/smartWallet.js' */
/** @import {AgoricNamesRemotes} from '@agoric/vats/tools/board-utils.js' */
-const { Fail } = assert;
const marshaller = boardSlottingMarshaller();
/** @type {CurrentWalletRecord} */
diff --git a/packages/agoric-cli/src/main.js b/packages/agoric-cli/src/main.js
index 18315708b24..453401f2e72 100644
--- a/packages/agoric-cli/src/main.js
+++ b/packages/agoric-cli/src/main.js
@@ -1,12 +1,12 @@
/* global process */
-import { assert, details as X } from '@agoric/assert';
-import {
- DEFAULT_JITTER_SECONDS,
- DEFAULT_KEEP_POLLING_SECONDS,
-} from '@agoric/casting';
import { Command } from 'commander';
import path from 'path';
import url from 'url';
+import { assert, X } from '@endo/errors';
+import {
+ DEFAULT_KEEP_POLLING_SECONDS,
+ DEFAULT_JITTER_SECONDS,
+} from '@agoric/casting';
import { makeWalletCommand } from './commands/wallet.js';
import cosmosMain from './cosmos.js';
import deployMain from './deploy.js';
diff --git a/packages/agoric-cli/src/open.js b/packages/agoric-cli/src/open.js
index 7c4318f4ff2..3251a49bc72 100644
--- a/packages/agoric-cli/src/open.js
+++ b/packages/agoric-cli/src/open.js
@@ -1,10 +1,8 @@
/* global process setInterval clearInterval */
import opener from 'opener';
-
+import { assert, X } from '@endo/errors';
import { getAccessToken } from '@agoric/access-token';
-import { assert, details as X } from '@agoric/assert';
-
export default async function walletMain(_progname, _rawArgs, powers, opts) {
const { anylogger } = powers;
const console = anylogger('agoric:wallet');
diff --git a/packages/agoric-cli/src/publish.js b/packages/agoric-cli/src/publish.js
index 248c3adae54..2d21068e940 100644
--- a/packages/agoric-cli/src/publish.js
+++ b/packages/agoric-cli/src/publish.js
@@ -1,6 +1,7 @@
// @ts-check
///
+import { X, q, Fail } from '@endo/errors';
import { E } from '@endo/far';
import {
@@ -14,7 +15,6 @@ import { defaultRegistryTypes } from '@cosmjs/stargate';
import { stringToPath } from '@cosmjs/crypto';
import { Decimal } from '@cosmjs/math';
import { fromBech32 } from '@cosmjs/encoding';
-
import { MsgInstallBundle } from '@agoric/cosmic-proto/swingset/msgs.js';
// https://github.com/Agoric/agoric-sdk/blob/master/golang/cosmos/daemon/main.go
@@ -83,8 +83,6 @@ const registry = new Registry([
* @typedef {SourceBundle | HashBundle} Bundle
*/
-const { details: X, quote: q, Fail } = assert;
-
/**
* @template T
* @param {Array} array
diff --git a/packages/agoric-cli/src/sdk-package-names.js b/packages/agoric-cli/src/sdk-package-names.js
index 8eab6fa1d8e..416229b115b 100644
--- a/packages/agoric-cli/src/sdk-package-names.js
+++ b/packages/agoric-cli/src/sdk-package-names.js
@@ -2,7 +2,6 @@
// prettier-ignore
export default [
"@agoric/access-token",
- "@agoric/assert",
"@agoric/async-flow",
"@agoric/base-zone",
"@agoric/benchmark",
diff --git a/packages/agoric-cli/src/set-defaults.js b/packages/agoric-cli/src/set-defaults.js
index 74ccc9b7ad0..c0fbd80e3cf 100644
--- a/packages/agoric-cli/src/set-defaults.js
+++ b/packages/agoric-cli/src/set-defaults.js
@@ -1,5 +1,5 @@
import { basename } from 'path';
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import {
finishCosmosApp,
finishTendermintConfig,
diff --git a/packages/assert/CHANGELOG.md b/packages/assert/CHANGELOG.md
deleted file mode 100644
index a5248e601e6..00000000000
--- a/packages/assert/CHANGELOG.md
+++ /dev/null
@@ -1,492 +0,0 @@
-# Change Log
-
-All notable changes to this project will be documented in this file.
-See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-
-## [0.6.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.5.1...@agoric/assert@0.6.0) (2023-05-19)
-
-
-### Features
-
-* **assert:** export assert.Fail from endo ([#6613](https://github.com/Agoric/agoric-sdk/issues/6613)) ([c863b17](https://github.com/Agoric/agoric-sdk/commit/c863b1708393f6102ce8174573aab4207c2ce71f))
-
-
-
-### [0.5.1](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.5.0...@agoric/assert@0.5.1) (2022-10-05)
-
-**Note:** Version bump only for package @agoric/assert
-
-
-
-
-
-## [0.5.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.4.0...@agoric/assert@0.5.0) (2022-09-20)
-
-
-### âš BREAKING CHANGES
-
-* **store:** split `provide` into collision vs no-collision variants (#6080)
-
-### Features
-
-* NonNullish checked cast ([fb81983](https://github.com/Agoric/agoric-sdk/commit/fb81983bde4b9a2d5408a0040522c923f653b6f8))
-
-
-### Bug Fixes
-
-* far classes with interface guards, used by ERTP ([#5960](https://github.com/Agoric/agoric-sdk/issues/5960)) ([a8882a1](https://github.com/Agoric/agoric-sdk/commit/a8882a1cef97c9177bf76d04d1a1253d02c7921b))
-
-
-### Code Refactoring
-
-* **store:** split `provide` into collision vs no-collision variants ([#6080](https://github.com/Agoric/agoric-sdk/issues/6080)) ([939e25e](https://github.com/Agoric/agoric-sdk/commit/939e25e615ea1fcefff15a032996613031151c0d)), closes [#5875](https://github.com/Agoric/agoric-sdk/issues/5875)
-
-
-
-## [0.4.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.3.16...@agoric/assert@0.4.0) (2022-04-18)
-
-
-### âš BREAKING CHANGES
-
-* consistent Node engine requirement (>=14.15.0)
-
-### Miscellaneous Chores
-
-* consistent Node engine requirement (>=14.15.0) ([ddc40fa](https://github.com/Agoric/agoric-sdk/commit/ddc40fa525f845ed900512c38b99f01458a3d131))
-
-
-
-### [0.3.16](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.3.15...@agoric/assert@0.3.16) (2022-02-21)
-
-**Note:** Version bump only for package @agoric/assert
-
-
-
-
-
-### [0.3.15](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.3.14...@agoric/assert@0.3.15) (2021-12-02)
-
-**Note:** Version bump only for package @agoric/assert
-
-
-
-
-
-### [0.3.14](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.3.13...@agoric/assert@0.3.14) (2021-10-13)
-
-**Note:** Version bump only for package @agoric/assert
-
-
-
-
-
-### [0.3.13](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.3.12...@agoric/assert@0.3.13) (2021-09-23)
-
-**Note:** Version bump only for package @agoric/assert
-
-
-
-
-
-### [0.3.12](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.3.11...@agoric/assert@0.3.12) (2021-09-15)
-
-**Note:** Version bump only for package @agoric/assert
-
-
-
-
-
-### [0.3.11](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.3.10...@agoric/assert@0.3.11) (2021-08-18)
-
-
-### Bug Fixes
-
-* **assert:** Improve diagnostic for missing assert global ([#3715](https://github.com/Agoric/agoric-sdk/issues/3715)) ([28a8ad8](https://github.com/Agoric/agoric-sdk/commit/28a8ad8658d7830caee666f1de247752774630a9))
-
-
-
-### [0.3.10](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.3.9...@agoric/assert@0.3.10) (2021-08-17)
-
-**Note:** Version bump only for package @agoric/assert
-
-
-
-
-
-### [0.3.9](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.3.6...@agoric/assert@0.3.9) (2021-08-15)
-
-### 0.26.10 (2021-07-28)
-
-
-### Bug Fixes
-
-* **assert:** Use module extension for types.js ([7e79e5e](https://github.com/Agoric/agoric-sdk/commit/7e79e5e37f2ae0955e6a205c744bff44cd0bbe57))
-
-
-
-### [0.3.8](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.3.6...@agoric/assert@0.3.8) (2021-08-14)
-
-### 0.26.10 (2021-07-28)
-
-
-### Bug Fixes
-
-* **assert:** Use module extension for types.js ([7e79e5e](https://github.com/Agoric/agoric-sdk/commit/7e79e5e37f2ae0955e6a205c744bff44cd0bbe57))
-
-
-
-### [0.3.7](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.3.6...@agoric/assert@0.3.7) (2021-07-28)
-
-
-### Bug Fixes
-
-* **assert:** Use module extension for types.js ([7e79e5e](https://github.com/Agoric/agoric-sdk/commit/7e79e5e37f2ae0955e6a205c744bff44cd0bbe57))
-
-
-
-### [0.3.6](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.3.5...@agoric/assert@0.3.6) (2021-07-01)
-
-**Note:** Version bump only for package @agoric/assert
-
-
-
-
-
-### [0.3.5](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.3.4...@agoric/assert@0.3.5) (2021-06-28)
-
-**Note:** Version bump only for package @agoric/assert
-
-
-
-
-
-### [0.3.4](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.3.3...@agoric/assert@0.3.4) (2021-06-25)
-
-**Note:** Version bump only for package @agoric/assert
-
-
-
-
-
-### [0.3.3](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.3.2...@agoric/assert@0.3.3) (2021-06-24)
-
-**Note:** Version bump only for package @agoric/assert
-
-
-
-
-
-### [0.3.2](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.3.1...@agoric/assert@0.3.2) (2021-06-23)
-
-**Note:** Version bump only for package @agoric/assert
-
-
-
-
-
-### [0.3.1](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.3.0...@agoric/assert@0.3.1) (2021-06-16)
-
-**Note:** Version bump only for package @agoric/assert
-
-
-
-
-
-## [0.3.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.2.12...@agoric/assert@0.3.0) (2021-06-15)
-
-
-### âš BREAKING CHANGES
-
-* **assert:** Converts `@agoric/assert` from emulated ESM with `node -r esm` to Node.js ESM proper.
-
-### Features
-
-* **assert:** RESM to NESM ([d991df7](https://github.com/Agoric/agoric-sdk/commit/d991df7c0b56bd8c7eb0995bddfbd473010a7726))
-
-
-### Bug Fixes
-
-* Pin ESM to forked version ([54dbb55](https://github.com/Agoric/agoric-sdk/commit/54dbb55d64d7ff7adb395bc4bd9d1461dd2d3c17))
-
-
-
-## [0.2.12](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.2.11...@agoric/assert@0.2.12) (2021-05-10)
-
-**Note:** Version bump only for package @agoric/assert
-
-
-
-
-
-## [0.2.11](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.2.10...@agoric/assert@0.2.11) (2021-05-05)
-
-**Note:** Version bump only for package @agoric/assert
-
-
-
-
-
-## [0.2.10](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.2.9...@agoric/assert@0.2.10) (2021-05-05)
-
-**Note:** Version bump only for package @agoric/assert
-
-
-
-
-
-## [0.2.9](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.2.8...@agoric/assert@0.2.9) (2021-04-22)
-
-**Note:** Version bump only for package @agoric/assert
-
-
-
-
-
-## [0.2.8](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.2.7...@agoric/assert@0.2.8) (2021-04-18)
-
-**Note:** Version bump only for package @agoric/assert
-
-
-
-
-
-## [0.2.7](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.2.6...@agoric/assert@0.2.7) (2021-04-16)
-
-**Note:** Version bump only for package @agoric/assert
-
-
-
-
-
-## [0.2.6](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.2.5...@agoric/assert@0.2.6) (2021-04-07)
-
-**Note:** Version bump only for package @agoric/assert
-
-
-
-
-
-## [0.2.5](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.2.4...@agoric/assert@0.2.5) (2021-04-06)
-
-
-### Bug Fixes
-
-* update to depend on ses 0.12.5 ([#2718](https://github.com/Agoric/agoric-sdk/issues/2718)) ([08dbe0d](https://github.com/Agoric/agoric-sdk/commit/08dbe0db5ce06944dc92c710865e441a60b31b5b))
-* update to ses 0.12.7, ses-ava 0.1.1 ([#2820](https://github.com/Agoric/agoric-sdk/issues/2820)) ([6d81775](https://github.com/Agoric/agoric-sdk/commit/6d81775715bc80e6033d75cb65edbfb1452b1608))
-
-
-
-
-
-## [0.2.4](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.2.3...@agoric/assert@0.2.4) (2021-03-24)
-
-**Note:** Version bump only for package @agoric/assert
-
-
-
-
-
-## [0.2.3](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.2.2...@agoric/assert@0.2.3) (2021-03-16)
-
-
-### Bug Fixes
-
-* make separate 'test:xs' target, remove XS from 'test' target ([b9c1a69](https://github.com/Agoric/agoric-sdk/commit/b9c1a6987093fc8e09e8aba7acd2a1618413bac8)), closes [#2647](https://github.com/Agoric/agoric-sdk/issues/2647)
-* properly type assert.typeof(xxx, 'object') ([4958636](https://github.com/Agoric/agoric-sdk/commit/49586365607175fd9f91896a66cf02ad14d93055))
-* upgrade ses to 0.12.3 to avoid console noise ([#2552](https://github.com/Agoric/agoric-sdk/issues/2552)) ([f59f5f5](https://github.com/Agoric/agoric-sdk/commit/f59f5f58d1567bb11710166b1dbc80f25c39a04f))
-
-
-
-
-
-## [0.2.2](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.2.1...@agoric/assert@0.2.2) (2021-02-22)
-
-**Note:** Version bump only for package @agoric/assert
-
-
-
-
-
-## [0.2.1](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.2.0...@agoric/assert@0.2.1) (2021-02-16)
-
-
-### Bug Fixes
-
-* review comments ([17d7df6](https://github.com/Agoric/agoric-sdk/commit/17d7df6ee06eb5c340500bb5582f985c2993ab19))
-* update '@agoric/assert' types ([3ce7587](https://github.com/Agoric/agoric-sdk/commit/3ce7587d0ba6d7a0f5c51a0cacbdc414eb02891b))
-* use assert rather than FooError constructors ([f860c5b](https://github.com/Agoric/agoric-sdk/commit/f860c5bf5add165a08cb5bd543502857c3f57998))
-
-
-
-
-
-# [0.2.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.1.0...@agoric/assert@0.2.0) (2020-12-10)
-
-
-### Features
-
-* **import-bundle:** Preliminary support Endo zip hex bundle format ([#1983](https://github.com/Agoric/agoric-sdk/issues/1983)) ([983681b](https://github.com/Agoric/agoric-sdk/commit/983681bfc4bf512b6bd90806ed9220cd4fefc13c))
-
-
-
-
-
-# [0.1.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.0.12-dev.0...@agoric/assert@0.1.0) (2020-11-07)
-
-
-### Bug Fixes
-
-* coordinate assert typing with SES-shim ([#1972](https://github.com/Agoric/agoric-sdk/issues/1972)) ([ce56e24](https://github.com/Agoric/agoric-sdk/commit/ce56e24eb950f8bdede4e82207b339c3d2e4af58))
-
-
-### Features
-
-* **assert:** Thread stack traces to console, add entangled assert ([#1884](https://github.com/Agoric/agoric-sdk/issues/1884)) ([5d4f35f](https://github.com/Agoric/agoric-sdk/commit/5d4f35f901f2ca40a2a4d66dab980a5fe8e575f4))
-
-
-
-
-
-## [0.0.12-dev.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.0.11...@agoric/assert@0.0.12-dev.0) (2020-10-19)
-
-**Note:** Version bump only for package @agoric/assert
-
-
-
-
-
-## [0.0.11](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.0.11-dev.2...@agoric/assert@0.0.11) (2020-10-11)
-
-**Note:** Version bump only for package @agoric/assert
-
-
-
-
-
-## [0.0.11-dev.2](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.0.11-dev.1...@agoric/assert@0.0.11-dev.2) (2020-09-18)
-
-**Note:** Version bump only for package @agoric/assert
-
-
-
-
-
-## [0.0.11-dev.1](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.0.11-dev.0...@agoric/assert@0.0.11-dev.1) (2020-09-18)
-
-**Note:** Version bump only for package @agoric/assert
-
-
-
-
-
-## [0.0.11-dev.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.0.10...@agoric/assert@0.0.11-dev.0) (2020-09-18)
-
-**Note:** Version bump only for package @agoric/assert
-
-
-
-
-
-## [0.0.10](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.0.9...@agoric/assert@0.0.10) (2020-09-16)
-
-**Note:** Version bump only for package @agoric/assert
-
-
-
-
-
-## [0.0.9](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.0.8...@agoric/assert@0.0.9) (2020-08-31)
-
-
-### Bug Fixes
-
-* reduce inconsistency among our linting rules ([#1492](https://github.com/Agoric/agoric-sdk/issues/1492)) ([b6b675e](https://github.com/Agoric/agoric-sdk/commit/b6b675e2de110e2af19cad784a66220cab21dacf))
-* seal payload used for quoted details ([#1610](https://github.com/Agoric/agoric-sdk/issues/1610)) ([1acd5ba](https://github.com/Agoric/agoric-sdk/commit/1acd5baa3e7f0185823c929409f8aecddab36a3a))
-* update JS typings ([20941e6](https://github.com/Agoric/agoric-sdk/commit/20941e675302ee5905e4825638e661065ad5d3f9))
-
-
-
-
-
-## [0.0.8](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.0.7...@agoric/assert@0.0.8) (2020-06-30)
-
-
-### Bug Fixes
-
-* replace openDetail with quoting q ([#1134](https://github.com/Agoric/agoric-sdk/issues/1134)) ([67808a4](https://github.com/Agoric/agoric-sdk/commit/67808a4df515630ef7dc77c59054382f626ece96))
-
-
-
-
-
-## [0.0.7](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.0.6...@agoric/assert@0.0.7) (2020-05-17)
-
-**Note:** Version bump only for package @agoric/assert
-
-
-
-
-
-## [0.0.6](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.0.5...@agoric/assert@0.0.6) (2020-05-10)
-
-**Note:** Version bump only for package @agoric/assert
-
-
-
-
-
-## [0.0.5](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.0.4...@agoric/assert@0.0.5) (2020-05-04)
-
-
-### Bug Fixes
-
-* use the new (typed) harden package ([2eb1af0](https://github.com/Agoric/agoric-sdk/commit/2eb1af08fe3967629a3ce165752fd501a5c85a96))
-* **assert:** slightly better assert logging ([#919](https://github.com/Agoric/agoric-sdk/issues/919)) ([47b3729](https://github.com/Agoric/agoric-sdk/commit/47b3729aa6b4ebde0d23cf791c5295fcf8f58a00))
-
-
-
-
-
-## [0.0.4](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.0.4-alpha.0...@agoric/assert@0.0.4) (2020-04-13)
-
-**Note:** Version bump only for package @agoric/assert
-
-
-
-
-
-## [0.0.4-alpha.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.0.3...@agoric/assert@0.0.4-alpha.0) (2020-04-12)
-
-**Note:** Version bump only for package @agoric/assert
-
-
-
-
-
-## [0.0.3](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.0.3-alpha.0...@agoric/assert@0.0.3) (2020-04-02)
-
-**Note:** Version bump only for package @agoric/assert
-
-
-
-
-
-## [0.0.3-alpha.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.0.2...@agoric/assert@0.0.3-alpha.0) (2020-04-02)
-
-**Note:** Version bump only for package @agoric/assert
-
-
-
-
-
-## 0.0.2 (2020-03-26)
-
-
-### Bug Fixes
-
-* remove extra interleaved spaces from assert console.error ([c6af2e4](https://github.com/Agoric/agoric-sdk/commit/c6af2e4abfc28959f70518d7905076270cffcb34))
-
-
-### Performance Improvements
-
-* Remove call to `harden` in `details` for performance reasons ([de1f04b](https://github.com/Agoric/agoric-sdk/commit/de1f04b0427af163b0a50cb645d6d676f09b08de))
diff --git a/packages/assert/CONTRIBUTING.md b/packages/assert/CONTRIBUTING.md
deleted file mode 100644
index fa94c26fa6f..00000000000
--- a/packages/assert/CONTRIBUTING.md
+++ /dev/null
@@ -1,49 +0,0 @@
-# Contributing
-
-Thank you!
-
-## Contact
-
-We use github issues for all bug reports:
-https://github.com/Agoric/agoric-sdk/issues Please add a [assert]
-prefix to the title and `assert` tag to assert-related issues.
-
-## Installing, Testing
-
-You'll need Node.js version 11 or higher.
-
-* `git clone https://github.com/Agoric/agoric-sdk/`
-* `cd agoric-sdk`
-* `yarn install`
-* `yarn build` (This *must* be done at the top level to build all of
- the packages)
-* `cd packages/assert`
-* `yarn test`
-
-## Pull Requests
-
-Before submitting a pull request, please:
-
-* run `yarn test` within `packages/assert` and make sure all the unit
- tests pass (running `yarn test` at the top level will test all the
- monorepo packages, which can be a good integration test.)
-* run `yarn run lint-fix` to reformat the code according to our
- `eslint` profile, and fix any complaints that it can't automatically
- correct
-
-## Making a Release
-
-* edit NEWS.md enumerating any user-visible changes. (If there are
- changelogs/ snippets, consolidate them to build the new NEWS
- entries, and then delete all the snippets.)
-* make sure `yarn config set version-git-tag false` is the current
- setting
-* `yarn version` (interactive) or `yarn version --major` or `yarn version --minor`
- * that changes `package.json`
- * and does NOT do a `git commit` and `git tag`
-* `git add .`
-* `git commit -m "bump version"`
-* `git tag -a assert-v$VERSION -m "assert-v$VERSION"`
-* `yarn publish --access public`
-* `git push`
-* `git push origin assert-v$VERSION`
diff --git a/packages/assert/NEWS.md b/packages/assert/NEWS.md
deleted file mode 100644
index 1cd61fa03a1..00000000000
--- a/packages/assert/NEWS.md
+++ /dev/null
@@ -1,5 +0,0 @@
-User-visible changes in @agoric/assert:
-
-## Release 0.0.1 (8-Feb-2020)
-
-Moved from ERTP and created package `@agoric/assert`
diff --git a/packages/assert/README.md b/packages/assert/README.md
deleted file mode 100644
index 94098e30122..00000000000
--- a/packages/assert/README.md
+++ /dev/null
@@ -1,23 +0,0 @@
-# assert
-
-An assertion library that keeps sensitive data outside of the Error.
-
-Throw (using provided error message) if expression is false.
-Assert that expr is truthy, with an optional details to describe
-the assertion. It is a tagged template literal like
-```js
-assert(expr, details`....`);
-```
-If expr is falsy, then the template contents are reported to the
-console and also in a thrown error.
-
-The literal portions of the template are assumed non-sensitive, as
-are the `typeof` types of the substitution values. These are
-assembled into the thrown error message. The actual contents of the
-substitution values are assumed sensitive, to be revealed to the
-console only. We assume only the virtual platform's owner can read
-what is written to the console, where the owner is in a privileged
-position over computation running on that platform.
-
-The optional `details` can be a string for backwards compatibility
-with the nodejs assertion library.
diff --git a/packages/assert/package.json b/packages/assert/package.json
deleted file mode 100755
index 8562d691c24..00000000000
--- a/packages/assert/package.json
+++ /dev/null
@@ -1,56 +0,0 @@
-{
- "name": "@agoric/assert",
- "version": "0.6.0",
- "description": "Assert expression support that protects sensitive data",
- "type": "module",
- "main": "src/assert.js",
- "engines": {
- "node": "^18.12 || ^20.9"
- },
- "scripts": {
- "build": "exit 0",
- "test": "ava",
- "test:nyc": "exit 0",
- "test:xs": "exit 0",
- "lint-fix": "yarn lint:eslint --fix",
- "lint": "run-s --continue-on-error lint:*",
- "lint:eslint": "eslint .",
- "lint:types": "tsc"
- },
- "devDependencies": {
- "@endo/init": "^1.1.2",
- "ava": "^5.3.0"
- },
- "ava": {
- "require": [
- "@endo/init/debug.js"
- ],
- "files": [
- "test/**/*.test.*"
- ]
- },
- "repository": {
- "type": "git",
- "url": "git+https://github.com/Agoric/agoric-sdk.git"
- },
- "keywords": [
- "assert",
- "errors"
- ],
- "author": "Agoric",
- "license": "Apache-2.0",
- "bugs": {
- "url": "https://github.com/Agoric/agoric-sdk/issues"
- },
- "homepage": "https://github.com/Agoric/agoric-sdk#readme",
- "files": [
- "src/",
- "NEWS.md"
- ],
- "publishConfig": {
- "access": "public"
- },
- "typeCoverage": {
- "atLeast": 100
- }
-}
diff --git a/packages/assert/src/assert.js b/packages/assert/src/assert.js
deleted file mode 100644
index ed9a43393c7..00000000000
--- a/packages/assert/src/assert.js
+++ /dev/null
@@ -1,88 +0,0 @@
-/* global globalThis */
-// Copyright (C) 2019 Agoric, under Apache License 2.0
-// @ts-check
-
-// This module assumes the existence of a non-standard `assert` host object.
-// SES version 0.11.0 introduces this global object and entangles it
-// with the `console` host object in scope when it initializes,
-// allowing errors, particularly assertion errors, to hide their "details"
-// from callers that might catch those errors, then reveal them to the
-// underlying console.
-// To the extent that this `console` is considered a resource,
-// this module must be considered a resource module.
-
-// The assertions re-exported here are defined in
-// https://github.com/endojs/endo/blob/HEAD/packages/ses/src/error/assert.js
-
-// At https://github.com/Agoric/agoric-sdk/issues/2774
-// is a record of a failed attempt to remove '.types'.
-// To satisfy CI, not only do we need to keep the file,
-// but we need to import it here as well.
-///
-
-const { freeze } = Object;
-
-/** @type {import('ses').Assert} */
-const globalAssert = globalThis.assert;
-
-if (globalAssert === undefined) {
- throw Error(
- `Cannot initialize @agoric/assert, missing globalThis.assert, import 'ses' before '@agoric/assert'`,
- );
-}
-
-const missing = /** @type {const} */ ([
- 'fail',
- 'equal',
- 'typeof',
- 'string',
- 'note',
- 'details',
- 'Fail',
- 'quote',
- 'makeAssert',
-]).filter(name => globalAssert[name] === undefined);
-if (missing.length > 0) {
- throw Error(
- `Cannot initialize @agoric/assert, missing globalThis.assert methods ${missing.join(
- ', ',
- )}`,
- );
-}
-
-const { details, Fail, quote, makeAssert } = globalAssert;
-
-export { globalAssert as assert, details, Fail, quote, quote as q, makeAssert };
-
-/**
- * @template T
- * @param {T | null | undefined} val
- * @param {string} [optDetails]
- * @returns {T}
- */
-export const NonNullish = (val, optDetails = `unexpected ${quote(val)}`) => {
- if (val != null) {
- // This `!= null` idiom checks that `val` is neither `null` nor `undefined`.
- return val;
- }
- assert.fail(optDetails);
-};
-harden(NonNullish);
-
-/**
- * Prepend the correct indefinite article onto a noun, typically a typeof result
- * e.g., "an Object" vs. "a Number"
- *
- * @deprecated
- * @param {string} str The noun to prepend
- * @returns {string} The noun prepended with a/an
- */
-function an(str) {
- str = `${str}`;
- if (str.length >= 1 && 'aeiouAEIOU'.includes(str[0])) {
- return `an ${str}`;
- }
- return `a ${str}`;
-}
-freeze(an);
-export { an };
diff --git a/packages/assert/src/types-ambient.js b/packages/assert/src/types-ambient.js
deleted file mode 100644
index b8064f03108..00000000000
--- a/packages/assert/src/types-ambient.js
+++ /dev/null
@@ -1,351 +0,0 @@
-// @ts-check
-///
-
-// Based on
-// https://github.com/endojs/endo/blob/HEAD/packages/ses/src/error/types.js
-// Coordinate edits until we refactor to avoid this duplication
-// At https://github.com/Agoric/agoric-sdk/issues/2774
-// is a record of a failed attempt to remove this duplication.
-
-/**
- * @callback BaseAssert
- * The `assert` function itself.
- *
- * @param {any} flag The truthy/falsy value
- * @param {Details} [optDetails] The details to throw
- * @param {ErrorConstructor} [ErrorConstructor] An optional alternate error
- * constructor to use.
- * @returns {asserts flag}
- */
-
-/**
- * @typedef {object} AssertMakeErrorOptions
- * @property {string} [errorName]
- */
-
-/**
- * @callback AssertMakeError
- *
- * The `makeError` function, recording details for the console.
- *
- * The optional `optDetails` can be a string.
- * @param {Details} [optDetails] The details of what was asserted
- * @param {ErrorConstructor} [ErrorConstructor] An optional alternate error
- * constructor to use.
- * @param {AssertMakeErrorOptions} [options]
- * @returns {Error}
- */
-
-/**
- * @callback AssertFail
- *
- * The `assert.fail` method.
- *
- * Fail an assertion, recording full details to the console and
- * raising an exception with a message in which `details` substitution values
- * have been masked.
- *
- * The optional `optDetails` can be a string for backwards compatibility
- * with the nodejs assertion library.
- * @param {Details} [optDetails] The details of what was asserted
- * @param {ErrorConstructor} [ErrorConstructor] An optional alternate error
- * constructor to use.
- * @returns {never}
- */
-
-/**
- * @callback AssertEqual
- * The `assert.equal` method
- *
- * Assert that two values must be `Object.is`.
- * @param {any} actual The value we received
- * @param {any} expected What we wanted
- * @param {Details} [optDetails] The details to throw
- * @param {ErrorConstructor} [ErrorConstructor] An optional alternate error
- * constructor to use.
- * @returns {void}
- */
-
-// Type all the overloads of the assertTypeof function.
-// There may eventually be a better way to do this, but
-// thems the breaks with Typescript 4.0.
-/**
- * @callback AssertTypeofBigint
- * @param {any} specimen
- * @param {'bigint'} typename
- * @param {Details} [optDetails]
- * @returns {asserts specimen is bigint}
- */
-
-/**
- * @callback AssertTypeofBoolean
- * @param {any} specimen
- * @param {'boolean'} typename
- * @param {Details} [optDetails]
- * @returns {asserts specimen is boolean}
- */
-
-/**
- * @callback AssertTypeofFunction
- * @param {any} specimen
- * @param {'function'} typename
- * @param {Details} [optDetails]
- * @returns {asserts specimen is Function}
- */
-
-/**
- * @callback AssertTypeofNumber
- * @param {any} specimen
- * @param {'number'} typename
- * @param {Details} [optDetails]
- * @returns {asserts specimen is number}
- */
-
-/**
- * @callback AssertTypeofObject
- * @param {any} specimen
- * @param {'object'} typename
- * @param {Details} [optDetails]
- * @returns {asserts specimen is Record | null}
- */
-
-/**
- * @callback AssertTypeofString
- * @param {any} specimen
- * @param {'string'} typename
- * @param {Details} [optDetails]
- * @returns {asserts specimen is string}
- */
-
-/**
- * @callback AssertTypeofSymbol
- * @param {any} specimen
- * @param {'symbol'} typename
- * @param {Details} [optDetails]
- * @returns {asserts specimen is symbol}
- */
-
-/**
- * @callback AssertTypeofUndefined
- * @param {any} specimen
- * @param {'undefined'} typename
- * @param {Details} [optDetails]
- * @returns {asserts specimen is undefined}
- */
-
-/**
- * The `assert.typeof` method
- *
- * @typedef {AssertTypeofBigint & AssertTypeofBoolean & AssertTypeofFunction & AssertTypeofNumber & AssertTypeofObject & AssertTypeofString & AssertTypeofSymbol & AssertTypeofUndefined} AssertTypeof
- */
-
-/**
- * @callback AssertString
- * The `assert.string` method.
- *
- * `assert.string(v)` is equivalent to `assert.typeof(v, 'string')`. We
- * special case this one because it is the most frequently used.
- *
- * Assert an expected typeof result.
- * @param {any} specimen The value to get the typeof
- * @param {Details} [optDetails] The details to throw
- * @returns {asserts specimen is string}
- */
-
-/**
- * @callback AssertNote
- * The `errorNote` function.
- *
- * Annotate an error with details, potentially to be used by an
- * augmented console such as the causal console of `console.js`, to
- * provide extra information associated with logged errors.
- *
- * @param {Error} error
- * @param {Details} detailsNote
- * @returns {void}
- */
-
-// /////////////////////////////////////////////////////////////////////////////
-
-/**
- * @typedef {{}} DetailsToken
- * A call to the `details` template literal makes and returns a fresh details
- * token, which is a frozen empty object associated with the arguments of that
- * `details` template literal expression.
- */
-
-/**
- * @typedef {string | DetailsToken} Details
- * Either a plain string, or made by the `details` template literal tag.
- */
-
-/**
- * @typedef {object} StringablePayload
- * Holds the payload passed to quote so that its printed form is visible.
- * @property {() => string} toString How to print the payload
- */
-
-/**
- * To "declassify" and quote a substitution value used in a
- * ``` details`...` ``` template literal, enclose that substitution expression
- * in a call to `quote`. This makes the value appear quoted
- * (as if with `JSON.stringify`) in the message of the thrown error. The
- * payload itself is still passed unquoted to the console as it would be
- * without `quote`.
- *
- * @example
- * For example, the following will reveal the expected sky color, but not the
- * actual incorrect sky color, in the thrown error's message:
- * ```js
- * sky.color === expectedColor || Fail`${sky.color} should be ${quote(expectedColor)}`;
- * ```
- * @example
- * The normal convention is to locally rename `details` to `X` and `quote` to `q`
- * like `const { details: X, quote: q } = assert;`, so the above example would then be
- * ```js
- * sky.color === expectedColor || Fail`${sky.color} should be ${q(expectedColor)}`;
- * ```
- *
- * @callback AssertQuote
- * @param {any} payload What to declassify
- * @param {(string|number)} [spaces]
- * @returns {StringablePayload} The declassified payload
- */
-
-/**
- * @callback Raise
- *
- * To make an `assert` which terminates some larger unit of computation
- * like a transaction, vat, or process, call `makeAssert` with a `Raise`
- * callback, where that callback actually performs that larger termination.
- * If possible, the callback should also report its `reason` parameter as
- * the alleged reason for the termination.
- *
- * @param {Error} reason
- */
-
-/**
- * @callback MakeAssert
- *
- * Makes and returns an `assert` function object that shares the bookkeeping
- * state defined by this module with other `assert` function objects made by
- * `makeAssert`. This state is per-module-instance and is exposed by the
- * `loggedErrorHandler` above. We refer to `assert` as a "function object"
- * because it can be called directly as a function, but also has methods that
- * can be called.
- *
- * If `optRaise` is provided, the returned `assert` function object will call
- * `optRaise(reason)` before throwing the error. This enables `optRaise` to
- * engage in even more violent termination behavior, like terminating the vat,
- * that prevents execution from reaching the following throw. However, if
- * `optRaise` returns normally, which would be unusual, the throw following
- * `optRaise(reason)` would still happen.
- *
- * @param {Raise} [optRaise]
- * @param {boolean} [unredacted]
- * @returns {Assert}
- */
-
-/**
- * @typedef {(template: TemplateStringsArray | string[], ...args: any) => DetailsToken} DetailsTag
- *
- * Use the `details` function as a template literal tag to create
- * informative error messages. The assertion functions take such messages
- * as optional arguments:
- * ```js
- * assert(sky.isBlue(), details`${sky.color} should be "blue"`);
- * ```
- * or following the normal convention to locally rename `details` to `X`
- * and `quote` to `q` like `const { details: X, quote: q } = assert;`:
- * ```js
- * assert(sky.isBlue(), X`${sky.color} should be "blue"`);
- * ```
- * However, note that in most cases it is preferable to instead use the `Fail`
- * template literal tag (which has the same input signature as `details`
- * but automatically creates and throws an error):
- * ```js
- * sky.isBlue() || Fail`${sky.color} should be "blue"`;
- * ```
- *
- * The details template tag returns a `DetailsToken` object that can print
- * itself with the formatted message in two ways.
- * It will report full details to the console, but
- * mask embedded substitution values with their typeof information in the thrown error
- * to prevent revealing secrets up the exceptional path. In the example
- * above, the thrown error may reveal only that `sky.color` is a string,
- * whereas the same diagnostic printed to the console reveals that the
- * sky was green. This masking can be disabled for an individual substitution value
- * using `quote`.
- *
- * The `raw` property of an input template array is ignored, so a simple
- * array of strings may be provided directly.
- */
-
-/**
- * @typedef {(template: TemplateStringsArray | string[], ...args: any) => never} FailTag
- *
- * Use the `Fail` function as a template literal tag to efficiently
- * create and throw a `details`-style error only when a condition is not satisfied.
- * ```js
- * condition || Fail`...complaint...`;
- * ```
- * This avoids the overhead of creating usually-unnecessary errors like
- * ```js
- * assert(condition, details`...complaint...`);
- * ```
- * while improving readability over alternatives like
- * ```js
- * condition || assert.fail(details`...complaint...`);
- * ```
- *
- * However, due to current weakness in TypeScript, static reasoning
- * is less powerful with the `||` patterns than with an `assert` call.
- * Until/unless https://github.com/microsoft/TypeScript/issues/51426 is fixed,
- * for `||`-style assertions where this loss of static reasoning is a problem,
- * instead express the assertion as
- * ```js
- * if (!condition) {
- * Fail`...complaint...`;
- * }
- * ```
- * or, if needed,
- * ```js
- * if (!condition) {
- * // `throw` is noop since `Fail` throws, but it improves static analysis
- * throw Fail`...complaint...`;
- * }
- * ```
- */
-
-/**
- * assert that expr is truthy, with an optional details to describe
- * the assertion. It is a tagged template literal like
- * ```js
- * assert(expr, details`....`);`
- * ```
- *
- * The literal portions of the template are assumed non-sensitive, as
- * are the `typeof` types of the substitution values. These are
- * assembled into the thrown error message. The actual contents of the
- * substitution values are assumed sensitive, to be revealed to
- * the console only. We assume only the virtual platform's owner can read
- * what is written to the console, where the owner is in a privileged
- * position over computation running on that platform.
- *
- * The optional `optDetails` can be a string for backwards compatibility
- * with the nodejs assertion library.
- *
- * @typedef { BaseAssert & {
- * typeof: AssertTypeof,
- * error: AssertMakeError,
- * fail: AssertFail,
- * equal: AssertEqual,
- * string: AssertString,
- * note: AssertNote,
- * details: DetailsTag,
- * Fail: FailTag,
- * quote: AssertQuote,
- * bare: AssertQuote,
- * makeAssert: MakeAssert,
- * } } Assert
- */
diff --git a/packages/assert/test/assert.test.js b/packages/assert/test/assert.test.js
deleted file mode 100644
index 9e2fa4b36e1..00000000000
--- a/packages/assert/test/assert.test.js
+++ /dev/null
@@ -1,20 +0,0 @@
-import test from 'ava';
-
-import { NonNullish, Fail } from '../src/assert.js';
-
-test('NonNullish', t => {
- assert.equal(NonNullish('defined'), 'defined');
- t.throws(() => NonNullish(null), {
- message: 'unexpected null',
- });
- t.throws(() => NonNullish(undefined), {
- message: 'unexpected "[undefined]"',
- });
-});
-
-test('Fail', t => {
- t.notThrows(() => true || Fail`Should not be thrown`);
- t.throws(() => false || Fail`Should be thrown`, {
- message: 'Should be thrown',
- });
-});
diff --git a/packages/assert/tsconfig.json b/packages/assert/tsconfig.json
deleted file mode 100644
index f6d24d3de00..00000000000
--- a/packages/assert/tsconfig.json
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file can contain .js-specific Typescript compiler config.
-{
- "extends": "../../tsconfig.json",
- "include": [
- "src/**/*.js",
- "test/**/*.js",
- ],
-}
diff --git a/packages/assert/typedoc.json b/packages/assert/typedoc.json
deleted file mode 100644
index e6544ff3b56..00000000000
--- a/packages/assert/typedoc.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "extends": [
- "../../typedoc.base.json"
- ],
- "entryPoints": [
- "src/assert.js",
- "src/types.js",
- ]
-}
diff --git a/packages/async-flow/src/convert.js b/packages/async-flow/src/convert.js
index d0935496a02..51ed928ec2e 100644
--- a/packages/async-flow/src/convert.js
+++ b/packages/async-flow/src/convert.js
@@ -1,5 +1,6 @@
import { Fail, X, annotateError, makeError, q } from '@endo/errors';
import { throwLabeled } from '@endo/common/throw-labeled.js';
+import { objectMap } from '@endo/common/object-map.js';
import {
getErrorConstructor,
getTag,
@@ -8,7 +9,6 @@ import {
passStyleOf,
} from '@endo/pass-style';
import { isVow } from '@agoric/vow/src/vow-utils.js';
-import { objectMap } from '@endo/common/object-map.js';
/**
* @import {Passable} from '@endo/pass-style'
diff --git a/packages/async-flow/src/equate.js b/packages/async-flow/src/equate.js
index 7dd9fc9f4fd..f11df50e911 100644
--- a/packages/async-flow/src/equate.js
+++ b/packages/async-flow/src/equate.js
@@ -1,8 +1,8 @@
import { Fail, X, annotateError, q } from '@endo/errors';
import { throwLabeled } from '@endo/common/throw-labeled.js';
import { getTag, isObject, passStyleOf } from '@endo/pass-style';
-import { isVow } from '@agoric/vow/src/vow-utils.js';
import { recordNames } from '@endo/marshal';
+import { isVow } from '@agoric/vow/src/vow-utils.js';
const { is } = Object;
diff --git a/packages/async-flow/src/replay-membrane.js b/packages/async-flow/src/replay-membrane.js
index 5f513333fed..d83b38f551b 100644
--- a/packages/async-flow/src/replay-membrane.js
+++ b/packages/async-flow/src/replay-membrane.js
@@ -1,5 +1,9 @@
/* eslint-disable no-use-before-define */
import { Fail, X, b, makeError, q } from '@endo/errors';
+import { E } from '@endo/eventual-send';
+import { getMethodNames } from '@endo/eventual-send/utils.js';
+import { throwLabeled } from '@endo/common/throw-labeled.js';
+import { objectMap } from '@endo/common/object-map.js';
import {
Far,
Remotable,
@@ -8,11 +12,7 @@ import {
makeTagged,
passStyleOf,
} from '@endo/pass-style';
-import { E } from '@endo/eventual-send';
-import { throwLabeled } from '@endo/common/throw-labeled.js';
import { heapVowE } from '@agoric/vow/vat.js';
-import { getMethodNames } from '@endo/eventual-send/utils.js';
-import { objectMap } from '@endo/common/object-map.js';
import { isVow } from '@agoric/vow/src/vow-utils.js';
import { makeEquate } from './equate.js';
import { makeConvertKit } from './convert.js';
diff --git a/packages/base-zone/package.json b/packages/base-zone/package.json
index 7adeeb7da22..deab47bb793 100644
--- a/packages/base-zone/package.json
+++ b/packages/base-zone/package.json
@@ -29,6 +29,7 @@
"dependencies": {
"@agoric/store": "^0.9.2",
"@endo/common": "^1.2.2",
+ "@endo/errors": "^1.2.2",
"@endo/exo": "^1.5.0",
"@endo/far": "^1.1.2",
"@endo/pass-style": "^1.4.0",
diff --git a/packages/base-zone/src/make-once.js b/packages/base-zone/src/make-once.js
index e0b6f5d639e..adb01b70cb2 100644
--- a/packages/base-zone/src/make-once.js
+++ b/packages/base-zone/src/make-once.js
@@ -1,5 +1,5 @@
// @ts-check
-const { Fail } = assert;
+import { Fail } from '@endo/errors';
/** @param {string} label */
const defaultLabelToKeys = label => harden([label]);
diff --git a/packages/base-zone/src/prepare-revocable.js b/packages/base-zone/src/prepare-revocable.js
index c59b3eb3cd8..0368b61c42c 100644
--- a/packages/base-zone/src/prepare-revocable.js
+++ b/packages/base-zone/src/prepare-revocable.js
@@ -1,7 +1,6 @@
-import { M } from '@endo/patterns';
+import { Fail, q } from '@endo/errors';
import { fromUniqueEntries } from '@endo/common/from-unique-entries.js';
-
-const { Fail, quote: q } = assert;
+import { M } from '@endo/patterns';
/** @import {Amplify} from '@endo/exo'; */
diff --git a/packages/base-zone/src/watch-promise.js b/packages/base-zone/src/watch-promise.js
index 4efec17195f..7e8fae9cc9d 100644
--- a/packages/base-zone/src/watch-promise.js
+++ b/packages/base-zone/src/watch-promise.js
@@ -1,9 +1,8 @@
// @ts-check
+import { Fail } from '@endo/errors';
import { M } from '@endo/patterns';
import { E } from '@endo/far';
-const { Fail } = assert;
-
const { apply } = Reflect;
/**
diff --git a/packages/benchmark/package.json b/packages/benchmark/package.json
index 4d3f4e7015d..d9046f8b175 100644
--- a/packages/benchmark/package.json
+++ b/packages/benchmark/package.json
@@ -22,7 +22,7 @@
"author": "Agoric",
"license": "Apache-2.0",
"dependencies": {
- "@agoric/assert": "^0.6.0",
+ "@endo/errors": "^1.2.2",
"@agoric/boot": "^0.1.0",
"@agoric/cosmic-swingset": "^0.41.3",
"@agoric/internal": "^0.3.2",
diff --git a/packages/benchmark/src/benchmarkerator.js b/packages/benchmark/src/benchmarkerator.js
index 57327011ef8..2e40b37b493 100644
--- a/packages/benchmark/src/benchmarkerator.js
+++ b/packages/benchmark/src/benchmarkerator.js
@@ -6,7 +6,7 @@ import '@endo/init';
import '@agoric/cosmic-swingset/src/launch-chain.js';
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import { eventLoopIteration } from '@agoric/internal/src/testing-utils.js';
import { makeAgoricNamesRemotesFromFakeStorage } from '@agoric/vats/tools/board-utils.js';
import { makeSwingsetTestKit } from '@agoric/boot/tools/supports.ts';
diff --git a/packages/boot/package.json b/packages/boot/package.json
index 0cbfd4b5ae2..a376630a8a6 100644
--- a/packages/boot/package.json
+++ b/packages/boot/package.json
@@ -18,7 +18,7 @@
"author": "Agoric",
"license": "Apache-2.0",
"dependencies": {
- "@agoric/assert": "^0.6.0",
+ "@endo/errors": "^1.2.2",
"@agoric/builders": "^0.1.0",
"@agoric/cosmic-proto": "^0.4.0",
"@agoric/cosmic-swingset": "^0.41.3",
diff --git a/packages/boot/test/bootstrapTests/ibcServerMock.js b/packages/boot/test/bootstrapTests/ibcServerMock.js
index 0f1d291828a..f2e97bdd817 100644
--- a/packages/boot/test/bootstrapTests/ibcServerMock.js
+++ b/packages/boot/test/bootstrapTests/ibcServerMock.js
@@ -1,10 +1,10 @@
/** @file Mock IBC Server */
// @ts-check
+import { q, Fail } from '@endo/errors';
import { Far } from '@endo/far';
import { makePromiseKit } from '@endo/promise-kit';
import { heapVowE as E } from '@agoric/vow/vat.js';
-const { quote: q, Fail } = assert;
const { log } = console;
/**
diff --git a/packages/boot/test/bootstrapTests/lca.test.ts b/packages/boot/test/bootstrapTests/lca.test.ts
index cf30fe8ae24..adb0d727e33 100644
--- a/packages/boot/test/bootstrapTests/lca.test.ts
+++ b/packages/boot/test/bootstrapTests/lca.test.ts
@@ -2,7 +2,7 @@ import { test as anyTest } from '@agoric/zoe/tools/prepare-test-env-ava.js';
import type { TestFn } from 'ava';
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import type { start as stakeBldStart } from '@agoric/orchestration/src/examples/stakeBld.contract.js';
import type { Instance } from '@agoric/zoe/src/zoeService/utils.js';
import {
diff --git a/packages/boot/test/bootstrapTests/liquidation-1.test.ts b/packages/boot/test/bootstrapTests/liquidation-1.test.ts
index b9922456dc0..d25bec16d8d 100644
--- a/packages/boot/test/bootstrapTests/liquidation-1.test.ts
+++ b/packages/boot/test/bootstrapTests/liquidation-1.test.ts
@@ -1,7 +1,7 @@
/** @file Bootstrap test of liquidation across multiple collaterals */
import { test as anyTest } from '@agoric/zoe/tools/prepare-test-env-ava.js';
-import { NonNullish } from '@agoric/assert';
+import { NonNullish } from '@agoric/internal';
import process from 'process';
import type { ExecutionContext, TestFn } from 'ava';
import type { ScheduleNotification } from '@agoric/inter-protocol/src/auction/scheduler.js';
diff --git a/packages/boot/test/bootstrapTests/liquidation-2b.test.ts b/packages/boot/test/bootstrapTests/liquidation-2b.test.ts
index e9c0bc2a361..09996a313f9 100644
--- a/packages/boot/test/bootstrapTests/liquidation-2b.test.ts
+++ b/packages/boot/test/bootstrapTests/liquidation-2b.test.ts
@@ -8,7 +8,7 @@
*/
import { test as anyTest } from '@agoric/zoe/tools/prepare-test-env-ava.js';
-import { NonNullish } from '@agoric/assert';
+import { NonNullish } from '@agoric/internal';
import { Offers } from '@agoric/inter-protocol/src/clientSupport.js';
import type { TestFn } from 'ava';
import { ScheduleNotification } from '@agoric/inter-protocol/src/auction/scheduler.js';
diff --git a/packages/boot/test/bootstrapTests/liquidation-concurrent-1.test.ts b/packages/boot/test/bootstrapTests/liquidation-concurrent-1.test.ts
index e6ee036f4fb..1a7fa875e0c 100644
--- a/packages/boot/test/bootstrapTests/liquidation-concurrent-1.test.ts
+++ b/packages/boot/test/bootstrapTests/liquidation-concurrent-1.test.ts
@@ -2,7 +2,7 @@
/** @file Bootstrap test of liquidation across multiple collaterals */
import { test as anyTest } from '@agoric/zoe/tools/prepare-test-env-ava.js';
-import { NonNullish } from '@agoric/assert';
+import { NonNullish } from '@agoric/internal';
import process from 'process';
import { TestFn } from 'ava';
import {
diff --git a/packages/boot/test/bootstrapTests/liquidation-concurrent-2b.test.ts b/packages/boot/test/bootstrapTests/liquidation-concurrent-2b.test.ts
index 19677638b5b..21f8f7bf394 100644
--- a/packages/boot/test/bootstrapTests/liquidation-concurrent-2b.test.ts
+++ b/packages/boot/test/bootstrapTests/liquidation-concurrent-2b.test.ts
@@ -8,7 +8,7 @@
*/
import { test as anyTest } from '@agoric/zoe/tools/prepare-test-env-ava.js';
-import { NonNullish } from '@agoric/assert';
+import { NonNullish } from '@agoric/internal';
import { ExecutionContext, TestFn } from 'ava';
import {
LiquidationTestContext,
diff --git a/packages/boot/test/bootstrapTests/orchestration.test.ts b/packages/boot/test/bootstrapTests/orchestration.test.ts
index a4eb1fc1b1f..d4488b3e5ef 100644
--- a/packages/boot/test/bootstrapTests/orchestration.test.ts
+++ b/packages/boot/test/bootstrapTests/orchestration.test.ts
@@ -1,6 +1,6 @@
import { test as anyTest } from '@agoric/zoe/tools/prepare-test-env-ava.js';
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import { documentStorageSchema } from '@agoric/internal/src/storage-test-utils.js';
import type { CosmosValidatorAddress } from '@agoric/orchestration';
import type { start as startStakeIca } from '@agoric/orchestration/src/examples/stakeIca.contract.js';
diff --git a/packages/boot/test/bootstrapTests/vats-restart.test.ts b/packages/boot/test/bootstrapTests/vats-restart.test.ts
index 23c5cf9110d..0655b96ec2c 100644
--- a/packages/boot/test/bootstrapTests/vats-restart.test.ts
+++ b/packages/boot/test/bootstrapTests/vats-restart.test.ts
@@ -1,13 +1,14 @@
/** @file Bootstrap test of restarting (almost) all vats */
import { test as anyTest } from '@agoric/zoe/tools/prepare-test-env-ava.js';
-import { eventLoopIteration } from '@agoric/internal/src/testing-utils.js';
+import { TestFn } from 'ava';
import processAmbient from 'child_process';
import { promises as fsAmbientPromises } from 'fs';
+import { Fail } from '@endo/errors';
+import { eventLoopIteration } from '@agoric/internal/src/testing-utils.js';
import { Offers } from '@agoric/inter-protocol/src/clientSupport.js';
import { makeAgoricNamesRemotesFromFakeStorage } from '@agoric/vats/tools/board-utils.js';
-import { TestFn } from 'ava';
import { BridgeHandler, ScopedBridgeManager } from '@agoric/vats';
import type { EconomyBootstrapSpace } from '@agoric/inter-protocol/src/proposals/econ-behaviors.js';
import {
@@ -16,8 +17,6 @@ import {
} from '../../tools/supports.ts';
import { makeWalletFactoryDriver } from '../../tools/drivers.ts';
-const { Fail } = assert;
-
// main/production config doesn't have initialPrice, upon which 'open vaults' depends
const PLATFORM_CONFIG = '@agoric/vm-config/decentral-itest-vaults-config.json';
diff --git a/packages/boot/test/bootstrapTests/vaults-integration.test.ts b/packages/boot/test/bootstrapTests/vaults-integration.test.ts
index da7ec0e72e4..fa51746b355 100644
--- a/packages/boot/test/bootstrapTests/vaults-integration.test.ts
+++ b/packages/boot/test/bootstrapTests/vaults-integration.test.ts
@@ -1,7 +1,7 @@
/** @file Bootstrap test integration vaults with smart-wallet */
import { test as anyTest } from '@agoric/zoe/tools/prepare-test-env-ava.js';
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import { Offers } from '@agoric/inter-protocol/src/clientSupport.js';
import { SECONDS_PER_DAY } from '@agoric/inter-protocol/src/proposals/econ-behaviors.js';
import { unmarshalFromVstorage } from '@agoric/internal/src/marshal.js';
diff --git a/packages/boot/test/bootstrapTests/vaults-upgrade.test.ts b/packages/boot/test/bootstrapTests/vaults-upgrade.test.ts
index 2ec8dabb670..d1f8c29429d 100644
--- a/packages/boot/test/bootstrapTests/vaults-upgrade.test.ts
+++ b/packages/boot/test/bootstrapTests/vaults-upgrade.test.ts
@@ -7,7 +7,8 @@
*/
import { test as anyTest } from '@agoric/zoe/tools/prepare-test-env-ava.js';
-import { Fail, NonNullish } from '@agoric/assert';
+import { Fail } from '@endo/errors';
+import { NonNullish } from '@agoric/internal';
import { Offers } from '@agoric/inter-protocol/src/clientSupport.js';
import { Far, makeMarshal } from '@endo/marshal';
import { SECONDS_PER_YEAR } from '@agoric/inter-protocol/src/interest.js';
diff --git a/packages/boot/test/bootstrapTests/walletFactory.ts b/packages/boot/test/bootstrapTests/walletFactory.ts
index 1ffc49ab55c..2fa6f4c3d5e 100644
--- a/packages/boot/test/bootstrapTests/walletFactory.ts
+++ b/packages/boot/test/bootstrapTests/walletFactory.ts
@@ -1,3 +1,4 @@
+import { Fail } from '@endo/errors';
import {
AgoricNamesRemotes,
makeAgoricNamesRemotesFromFakeStorage,
@@ -5,8 +6,6 @@ import {
import { makeSwingsetTestKit } from '../../tools/supports.ts';
import { makeWalletFactoryDriver } from '../../tools/drivers.ts';
-const { Fail } = assert;
-
export const makeWalletFactoryContext = async (
t,
configSpecifier = '@agoric/vm-config/decentral-main-vaults-config.json',
diff --git a/packages/boot/test/upgrading/upgrade-vats.test.js b/packages/boot/test/upgrading/upgrade-vats.test.js
index 8ffbfb84f87..4685dd8228f 100644
--- a/packages/boot/test/upgrading/upgrade-vats.test.js
+++ b/packages/boot/test/upgrading/upgrade-vats.test.js
@@ -1,6 +1,7 @@
// @ts-check
import { test as anyTest } from '@agoric/swingset-vat/tools/prepare-test-env-ava.js';
+import { Fail } from '@endo/errors';
import { makeTagged } from '@endo/marshal';
import { BridgeId } from '@agoric/internal';
import { buildVatController } from '@agoric/swingset-vat';
@@ -13,8 +14,6 @@ import { matchAmount, matchIter, matchRef } from '../../tools/supports.ts';
*/
const test = anyTest;
-const { Fail } = assert;
-
const bfile = name => new URL(name, import.meta.url).pathname;
const importSpec = spec =>
importMetaResolve(spec, import.meta.url).then(u => new URL(u).pathname);
diff --git a/packages/boot/tools/authorityViz.js b/packages/boot/tools/authorityViz.js
index 62ecfff0573..86d080255eb 100755
--- a/packages/boot/tools/authorityViz.js
+++ b/packages/boot/tools/authorityViz.js
@@ -3,6 +3,8 @@
import '@endo/init';
import process from 'process';
+import { Fail, q } from '@endo/errors';
+
const { entries, keys, values } = Object;
const logged = label => x => {
@@ -36,7 +38,7 @@ const styles = {
* }} GraphNode
*/
function* fmtGraph(nodes, neighbors) {
- const q = txt => JSON.stringify(txt.replace(/\./g, '_'));
+ const quote = txt => JSON.stringify(txt.replace(/\./g, '_'));
yield 'digraph G {\n';
yield 'rankdir = LR;\n';
const clusters = new Set(
@@ -50,7 +52,7 @@ function* fmtGraph(nodes, neighbors) {
}
for (const { id, cluster, label, style } of nodes) {
if (subgraph && cluster !== subgraph) continue;
- yield `${q(id)} [label=${q(label)}${style ? `, ${style}` : ''}];\n`;
+ yield `${quote(id)} [label=${quote(label)}${style ? `, ${style}` : ''}];\n`;
}
if (subgraph) {
yield `}\n`;
@@ -58,7 +60,7 @@ function* fmtGraph(nodes, neighbors) {
}
for (const [src, arcs] of neighbors.entries()) {
for (const { id, style } of arcs) {
- yield `${q(src)} -> ${q(id)} [${style}]\n`;
+ yield `${quote(src)} -> ${quote(id)} [${style}]\n`;
}
}
yield '}\n';
@@ -199,8 +201,6 @@ const manifest2graph = manifest => {
return { nodes, neighbors };
};
-const { Fail, quote: q } = assert;
-
/**
* @param {string} specifier
* @param {object} io
diff --git a/packages/boot/tools/drivers.ts b/packages/boot/tools/drivers.ts
index 431edc437b3..b9f0c8bb207 100644
--- a/packages/boot/tools/drivers.ts
+++ b/packages/boot/tools/drivers.ts
@@ -1,5 +1,6 @@
/* eslint-disable jsdoc/require-param */
-import { Fail, NonNullish } from '@agoric/assert';
+import { Fail } from '@endo/errors';
+import { NonNullish } from '@agoric/internal';
import { Offers } from '@agoric/inter-protocol/src/clientSupport.js';
import { SECONDS_PER_MINUTE } from '@agoric/inter-protocol/src/proposals/econ-behaviors.js';
import { unmarshalFromVstorage } from '@agoric/internal/src/marshal.js';
diff --git a/packages/boot/tools/liquidation.ts b/packages/boot/tools/liquidation.ts
index 8d2ba380c81..221f98e7260 100644
--- a/packages/boot/tools/liquidation.ts
+++ b/packages/boot/tools/liquidation.ts
@@ -1,4 +1,4 @@
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import {
SECONDS_PER_HOUR,
SECONDS_PER_MINUTE,
diff --git a/packages/boot/tools/supports.ts b/packages/boot/tools/supports.ts
index 1ce41655f49..ac9db683abe 100644
--- a/packages/boot/tools/supports.ts
+++ b/packages/boot/tools/supports.ts
@@ -7,9 +7,14 @@ import { resolve as importMetaResolve } from 'import-meta-resolve';
import { basename, join } from 'path';
import { inspect } from 'util';
-import { Fail, NonNullish } from '@agoric/assert';
+import { Fail } from '@endo/errors';
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';
diff --git a/packages/builders/package.json b/packages/builders/package.json
index 0acd618d6c7..b3743b4052a 100644
--- a/packages/builders/package.json
+++ b/packages/builders/package.json
@@ -41,7 +41,7 @@
"import-meta-resolve": "^2.2.1"
},
"devDependencies": {
- "@agoric/assert": "^0.6.0",
+ "@endo/errors": "^1.2.2",
"@agoric/deploy-script-support": "^0.10.3",
"@agoric/governance": "^0.10.3",
"@agoric/inter-protocol": "^0.16.1",
diff --git a/packages/casting/package.json b/packages/casting/package.json
index 1b5fee77acb..30cd54a6831 100644
--- a/packages/casting/package.json
+++ b/packages/casting/package.json
@@ -29,6 +29,7 @@
"@cosmjs/proto-signing": "^0.32.3",
"@cosmjs/stargate": "^0.32.3",
"@cosmjs/tendermint-rpc": "^0.32.3",
+ "@endo/errors": "^1.2.2",
"@endo/far": "^1.1.2",
"@endo/init": "^1.1.2",
"@endo/lockdown": "^1.0.7",
diff --git a/packages/casting/src/follower-cosmjs.js b/packages/casting/src/follower-cosmjs.js
index 0e0bad948cd..e04572d649c 100644
--- a/packages/casting/src/follower-cosmjs.js
+++ b/packages/casting/src/follower-cosmjs.js
@@ -1,11 +1,11 @@
///
+import { X, q, Fail, makeError } from '@endo/errors';
import { E, Far } from '@endo/far';
import * as tendermint34 from '@cosmjs/tendermint-rpc';
import * as stargateStar from '@cosmjs/stargate';
import { isStreamCell } from '@agoric/internal/src/lib-chainStorage.js';
-
import { MAKE_DEFAULT_DECODER, MAKE_DEFAULT_UNSERIALIZER } from './defaults.js';
import { makeCastingSpec } from './casting-spec.js';
import { makeLeader as defaultMakeLeader } from './leader-netconfig.js';
@@ -21,7 +21,6 @@ harden({
const { QueryClient } = stargateStar;
const { Tendermint34Client } = tendermint34;
-const { details: X, quote: q, Fail } = assert;
const textDecoder = new TextDecoder();
/** @template T @typedef {import('./types.js').Follower>} ValueFollower */
@@ -264,7 +263,7 @@ export const makeCosmjsFollower = (
return;
}
crash(
- assert.error(
+ makeError(
X`Alleged value ${alleged.value} did not match proof ${proven.value}`,
),
);
diff --git a/packages/casting/src/leader-netconfig.js b/packages/casting/src/leader-netconfig.js
index 9a6d4c66ff8..dd3a41f6fdf 100644
--- a/packages/casting/src/leader-netconfig.js
+++ b/packages/casting/src/leader-netconfig.js
@@ -1,4 +1,5 @@
/* global fetch */
+import { Fail } from '@endo/errors';
import { makeRoundRobinLeader } from './leader.js';
import {
DEFAULT_BOOTSTRAP,
@@ -7,8 +8,6 @@ import {
} from './defaults.js';
import { assertNetworkConfig } from './netconfig.js';
-const { Fail } = assert;
-
/**
* @param {string[]} rpcAddrs
* @param {import('./types.js').LeaderOptions} [leaderOptions]
diff --git a/packages/cosmic-swingset/package.json b/packages/cosmic-swingset/package.json
index f60ec2e7204..ce99220035c 100644
--- a/packages/cosmic-swingset/package.json
+++ b/packages/cosmic-swingset/package.json
@@ -22,7 +22,7 @@
"author": "Agoric",
"license": "Apache-2.0",
"dependencies": {
- "@agoric/assert": "^0.6.0",
+ "@endo/errors": "^1.2.2",
"@agoric/builders": "^0.1.0",
"@agoric/cosmos": "^0.34.1",
"@agoric/deploy-script-support": "^0.10.3",
diff --git a/packages/cosmic-swingset/src/chain-main.js b/packages/cosmic-swingset/src/chain-main.js
index 29766494c3e..466ed83d1f0 100644
--- a/packages/cosmic-swingset/src/chain-main.js
+++ b/packages/cosmic-swingset/src/chain-main.js
@@ -10,6 +10,7 @@ import { resolve as importMetaResolve } from 'import-meta-resolve';
import tmpfs from 'tmp';
import { fork } from 'node:child_process';
+import { Fail, q } from '@endo/errors';
import { E } from '@endo/far';
import engineGC from '@agoric/internal/src/lib-nodejs/engine-gc.js';
import { waitUntilQuiescent } from '@agoric/internal/src/lib-nodejs/waitUntilQuiescent.js';
@@ -18,7 +19,6 @@ import {
exportMailbox,
} from '@agoric/swingset-vat/src/devices/mailbox/mailbox.js';
-import { Fail, q } from '@agoric/assert';
import { makeSlogSender, tryFlushSlogSender } from '@agoric/telemetry';
import {
diff --git a/packages/cosmic-swingset/src/export-kernel-db.js b/packages/cosmic-swingset/src/export-kernel-db.js
index c7053fee374..cc90e945b29 100755
--- a/packages/cosmic-swingset/src/export-kernel-db.js
+++ b/packages/cosmic-swingset/src/export-kernel-db.js
@@ -10,8 +10,8 @@ import fsPower from 'fs/promises';
import pathPower from 'path';
import { fileURLToPath } from 'url';
+import { Fail, q } from '@endo/errors';
import { makePromiseKit } from '@endo/promise-kit';
-import { Fail, q } from '@agoric/assert';
import { makeShutdown } from '@agoric/internal/src/node/shutdown.js';
import { waitUntilQuiescent } from '@agoric/internal/src/lib-nodejs/waitUntilQuiescent.js';
import { makeSwingStoreExporter } from '@agoric/swing-store';
diff --git a/packages/cosmic-swingset/src/export-storage.js b/packages/cosmic-swingset/src/export-storage.js
index 6844d70f4c6..a96f91ccc84 100644
--- a/packages/cosmic-swingset/src/export-storage.js
+++ b/packages/cosmic-swingset/src/export-storage.js
@@ -1,6 +1,6 @@
import * as STORAGE_PATH from '@agoric/internal/src/chain-storage-paths.js';
-const { Fail, quote: q } = assert;
+import { Fail, q } from '@endo/errors';
/**
* Export any specified storage subtrees, then delete the ones marked to clear.
diff --git a/packages/cosmic-swingset/src/helpers/bufferedStorage.js b/packages/cosmic-swingset/src/helpers/bufferedStorage.js
index 4b5a4dfc85b..1b58c69b1b4 100644
--- a/packages/cosmic-swingset/src/helpers/bufferedStorage.js
+++ b/packages/cosmic-swingset/src/helpers/bufferedStorage.js
@@ -1,6 +1,6 @@
// @ts-check
-import { assert, Fail } from '@agoric/assert';
+import { assert, Fail } from '@endo/errors';
// XXX Do these "StorageAPI" functions belong in their own package?
diff --git a/packages/cosmic-swingset/src/helpers/make-queue.js b/packages/cosmic-swingset/src/helpers/make-queue.js
index b70d649f80e..da54e279eeb 100644
--- a/packages/cosmic-swingset/src/helpers/make-queue.js
+++ b/packages/cosmic-swingset/src/helpers/make-queue.js
@@ -1,6 +1,6 @@
// @ts-check
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
/**
* @typedef {object} QueueStorage
diff --git a/packages/cosmic-swingset/src/import-kernel-db.js b/packages/cosmic-swingset/src/import-kernel-db.js
index c804bea19f7..9db89a6da33 100755
--- a/packages/cosmic-swingset/src/import-kernel-db.js
+++ b/packages/cosmic-swingset/src/import-kernel-db.js
@@ -11,8 +11,8 @@ import fsPower from 'fs';
import fsPromisesPower from 'fs/promises';
import pathPower from 'path';
+import { Fail, q } from '@endo/errors';
import BufferLineTransform from '@agoric/internal/src/node/buffer-line-transform.js';
-import { Fail, q } from '@agoric/assert';
import { importSwingStore, openSwingStore } from '@agoric/swing-store';
import { isEntrypoint } from './helpers/is-entrypoint.js';
diff --git a/packages/cosmic-swingset/src/launch-chain.js b/packages/cosmic-swingset/src/launch-chain.js
index c521e79bdbf..26b3b855884 100644
--- a/packages/cosmic-swingset/src/launch-chain.js
+++ b/packages/cosmic-swingset/src/launch-chain.js
@@ -7,11 +7,10 @@ import '@agoric/builders';
import anylogger from 'anylogger';
+import { assert, Fail } from '@endo/errors';
import { E } from '@endo/far';
import bundleSource from '@endo/bundle-source';
-/** @import {RunPolicy} from '@agoric/swingset-vat' */
-
import {
buildMailbox,
buildMailboxStateMap,
@@ -24,7 +23,6 @@ import {
loadSwingsetConfigFile,
} from '@agoric/swingset-vat';
import { waitUntilQuiescent } from '@agoric/internal/src/lib-nodejs/waitUntilQuiescent.js';
-import { assert, Fail } from '@agoric/assert';
import { openSwingStore } from '@agoric/swing-store';
import { BridgeId as BRIDGE_ID } from '@agoric/internal';
import { makeWithQueue } from '@agoric/internal/src/queue.js';
@@ -53,6 +51,8 @@ import { makeQueue, makeQueueStorageMock } from './helpers/make-queue.js';
import { exportStorage } from './export-storage.js';
import { parseLocatedJson } from './helpers/json.js';
+/** @import {RunPolicy} from '@agoric/swingset-vat' */
+
const console = anylogger('launch-chain');
const blockManagerConsole = anylogger('block-manager');
diff --git a/packages/cosmic-swingset/src/params.js b/packages/cosmic-swingset/src/params.js
index 3baa75b915c..f3a57b03749 100644
--- a/packages/cosmic-swingset/src/params.js
+++ b/packages/cosmic-swingset/src/params.js
@@ -1,7 +1,7 @@
// @ts-check
// @jessie-check
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import { Nat, isNat } from '@endo/nat';
export const stringToNat = s => {
diff --git a/packages/cosmic-swingset/src/sim-chain.js b/packages/cosmic-swingset/src/sim-chain.js
index 19a0a09b4dc..ba1847d6cfc 100644
--- a/packages/cosmic-swingset/src/sim-chain.js
+++ b/packages/cosmic-swingset/src/sim-chain.js
@@ -1,6 +1,7 @@
/* global process setTimeout clearTimeout */
import path from 'path';
import fs from 'fs';
+import { Fail } from '@endo/errors';
import {
importMailbox,
exportMailbox,
@@ -11,7 +12,6 @@ import anylogger from 'anylogger';
import { makeSlogSender } from '@agoric/telemetry';
import { resolve as importMetaResolve } from 'import-meta-resolve';
-import { Fail } from '@agoric/assert';
import { makeWithQueue } from '@agoric/internal/src/queue.js';
import { makeBatchedDeliver } from '@agoric/internal/src/batched-deliver.js';
import stringify from './helpers/json-stable-stringify.js';
diff --git a/packages/deploy-script-support/package.json b/packages/deploy-script-support/package.json
index 6459ae3226b..57b4443dda5 100644
--- a/packages/deploy-script-support/package.json
+++ b/packages/deploy-script-support/package.json
@@ -34,7 +34,7 @@
},
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
"dependencies": {
- "@agoric/assert": "^0.6.0",
+ "@endo/errors": "^1.2.2",
"@agoric/ertp": "^0.16.2",
"@agoric/import-manager": "^0.3.11",
"@agoric/internal": "^0.3.2",
diff --git a/packages/deploy-script-support/src/assertOfferResult.js b/packages/deploy-script-support/src/assertOfferResult.js
index 0da39b6d91b..c9762db189f 100644
--- a/packages/deploy-script-support/src/assertOfferResult.js
+++ b/packages/deploy-script-support/src/assertOfferResult.js
@@ -1,5 +1,5 @@
// @ts-check
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import { E } from '@endo/far';
/**
diff --git a/packages/deploy-script-support/src/cachedBundleSpec.js b/packages/deploy-script-support/src/cachedBundleSpec.js
index 5ad7cd89ba7..e306ec3639a 100644
--- a/packages/deploy-script-support/src/cachedBundleSpec.js
+++ b/packages/deploy-script-support/src/cachedBundleSpec.js
@@ -1,4 +1,4 @@
-const { Fail } = assert;
+import { Fail } from '@endo/errors';
/**
* @param {string} cacheDir
diff --git a/packages/deploy-script-support/src/endo-pieces-contract.js b/packages/deploy-script-support/src/endo-pieces-contract.js
index 715000aa415..acd46770eba 100644
--- a/packages/deploy-script-support/src/endo-pieces-contract.js
+++ b/packages/deploy-script-support/src/endo-pieces-contract.js
@@ -1,10 +1,9 @@
// @ts-check
+import { Fail, q } from '@endo/errors';
import { E, Far } from '@endo/far';
import { encodeBase64, decodeBase64 } from '@endo/base64';
import { ZipWriter } from '@endo/zip';
-const { Fail, quote: q } = assert;
-
export const start = () => {
/** @type { Map} */
const hashToEntry = new Map();
diff --git a/packages/deploy-script-support/src/extract-proposal.js b/packages/deploy-script-support/src/extract-proposal.js
index 1ebf8519232..f0b258b4bb7 100644
--- a/packages/deploy-script-support/src/extract-proposal.js
+++ b/packages/deploy-script-support/src/extract-proposal.js
@@ -1,4 +1,5 @@
// @ts-check
+import { Fail } from '@endo/errors';
import { deeplyFulfilledObject } from '@agoric/internal';
import fs from 'fs';
import { createRequire } from 'module';
@@ -19,8 +20,6 @@ import {
* @typedef {ConfigProposal[] | SequentialCoreProposals} CoreProposals
*/
-const { Fail } = assert;
-
const req = createRequire(import.meta.url);
/**
diff --git a/packages/deploy-script-support/src/offer.js b/packages/deploy-script-support/src/offer.js
index 3c03908c865..2307988735d 100644
--- a/packages/deploy-script-support/src/offer.js
+++ b/packages/deploy-script-support/src/offer.js
@@ -1,6 +1,6 @@
// @ts-check
+import { assert } from '@endo/errors';
import { E } from '@endo/far';
-import { assert } from '@agoric/assert';
// Avoid pulling in too many dependencies like notifiers
import { AmountMath } from '@agoric/ertp/src/amountMath.js';
diff --git a/packages/deploy-script-support/src/startInstance.js b/packages/deploy-script-support/src/startInstance.js
index 1117357cca5..b387f4d8072 100644
--- a/packages/deploy-script-support/src/startInstance.js
+++ b/packages/deploy-script-support/src/startInstance.js
@@ -1,5 +1,5 @@
// @ts-check
-import { assert } from '@agoric/assert';
+import { assert } from '@endo/errors';
import { E, passStyleOf } from '@endo/far';
/** @import {Petname} from '@agoric/deploy-script-support/src/externalTypes.js' */
diff --git a/packages/deployment/package.json b/packages/deployment/package.json
index 193807d9f18..818744b2ce0 100644
--- a/packages/deployment/package.json
+++ b/packages/deployment/package.json
@@ -19,7 +19,7 @@
"author": "Agoric",
"license": "Apache-2.0",
"dependencies": {
- "@agoric/assert": "^0.6.0",
+ "@endo/errors": "^1.2.2",
"@endo/init": "^1.1.2",
"@endo/marshal": "^1.5.0",
"better-sqlite3": "^9.1.1",
diff --git a/packages/deployment/src/files.js b/packages/deployment/src/files.js
index 617817c1799..e7d8cf0bc1c 100644
--- a/packages/deployment/src/files.js
+++ b/packages/deployment/src/files.js
@@ -2,7 +2,7 @@ import { promisify } from 'util';
import { Readable } from 'stream';
import chalk from 'chalk';
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
const { freeze } = Object;
diff --git a/packages/deployment/src/init.js b/packages/deployment/src/init.js
index 5e6e926517a..df9fcd7c316 100644
--- a/packages/deployment/src/init.js
+++ b/packages/deployment/src/init.js
@@ -1,6 +1,6 @@
// @ts-check
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import { isObject } from '@endo/marshal';
import { PLAYBOOK_WRAPPER, SSH_TYPE } from './setup.js';
import { shellEscape } from './run.js';
diff --git a/packages/deployment/src/main.js b/packages/deployment/src/main.js
index ed5e48a6450..f550e9a37d7 100644
--- a/packages/deployment/src/main.js
+++ b/packages/deployment/src/main.js
@@ -3,7 +3,7 @@ import djson from 'deterministic-json';
import { createHash } from 'crypto';
import chalk from 'chalk';
import parseArgs from 'minimist';
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import { doInit } from './init.js';
import { shellMetaRegexp, shellEscape } from './run.js';
import { streamFromString } from './files.js';
diff --git a/packages/deployment/src/run.js b/packages/deployment/src/run.js
index c6d20e228e7..f511d0bc095 100644
--- a/packages/deployment/src/run.js
+++ b/packages/deployment/src/run.js
@@ -1,6 +1,6 @@
import { Writable } from 'stream';
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
const { freeze } = Object;
diff --git a/packages/governance/package.json b/packages/governance/package.json
index 6b80a7efcfa..140c98c5c6f 100644
--- a/packages/governance/package.json
+++ b/packages/governance/package.json
@@ -31,7 +31,7 @@
},
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
"dependencies": {
- "@agoric/assert": "^0.6.0",
+ "@endo/errors": "^1.2.2",
"@agoric/ertp": "^0.16.2",
"@agoric/internal": "^0.3.2",
"@agoric/notifier": "^0.6.2",
diff --git a/packages/governance/src/binaryVoteCounter.js b/packages/governance/src/binaryVoteCounter.js
index 807e0d46258..d502507e737 100644
--- a/packages/governance/src/binaryVoteCounter.js
+++ b/packages/governance/src/binaryVoteCounter.js
@@ -1,6 +1,7 @@
+import { Fail } from '@endo/errors';
import { makePromiseKit } from '@endo/promise-kit';
-import { makeExo, keyEQ, makeScalarMapStore } from '@agoric/store';
import { E } from '@endo/eventual-send';
+import { makeExo, keyEQ, makeScalarMapStore } from '@agoric/store';
import {
buildQuestion,
@@ -20,8 +21,6 @@ import { makeQuorumCounter } from './quorumCounter.js';
* @import {BuildVoteCounter, OutcomeRecord, Position, QuestionSpec, VoteStatistics} from './types.js';
*/
-const { Fail } = assert;
-
const validateBinaryQuestionSpec = questionSpec => {
coerceQuestionSpec(questionSpec);
diff --git a/packages/governance/src/contractGovernance/assertions.js b/packages/governance/src/contractGovernance/assertions.js
index 1e2ede685bb..09a3bb57930 100644
--- a/packages/governance/src/contractGovernance/assertions.js
+++ b/packages/governance/src/contractGovernance/assertions.js
@@ -1,10 +1,9 @@
+import { Fail } from '@endo/errors';
import { isRemotable } from '@endo/marshal';
import { assertIsRatio } from '@agoric/zoe/src/contractSupport/ratio.js';
import { mustMatch } from '@agoric/store';
import { RelativeTimeRecordShape, TimestampRecordShape } from '@agoric/time';
-const { Fail } = assert;
-
const makeLooksLikeBrand = name => {
/** @param {Brand} brand */
return brand => {
diff --git a/packages/governance/src/contractGovernance/governApi.js b/packages/governance/src/contractGovernance/governApi.js
index e13debafc73..f700e6de740 100644
--- a/packages/governance/src/contractGovernance/governApi.js
+++ b/packages/governance/src/contractGovernance/governApi.js
@@ -1,3 +1,4 @@
+import { Fail, q } from '@endo/errors';
import { E } from '@endo/eventual-send';
import { Far } from '@endo/marshal';
import { keyEQ } from '@agoric/store';
@@ -14,8 +15,6 @@ import {
* @import {Position, ApiGovernor, ApiInvocationIssue, PoserFacet, VoteOnApiInvocation} from '../types.js';
*/
-const { Fail, quote: q } = assert;
-
/**
* Make a pair of positions for a question about whether to invoke an API. If
* the vote passes, the method will be called on the governedApis facet with the
diff --git a/packages/governance/src/contractGovernance/governParam.js b/packages/governance/src/contractGovernance/governParam.js
index 789a441d32a..8ca1b9b7859 100644
--- a/packages/governance/src/contractGovernance/governParam.js
+++ b/packages/governance/src/contractGovernance/governParam.js
@@ -1,3 +1,4 @@
+import { Fail } from '@endo/errors';
import { E } from '@endo/eventual-send';
import { deeplyFulfilled, Far } from '@endo/marshal';
import { mustMatch, keyEQ } from '@agoric/store';
@@ -14,8 +15,6 @@ import { ParamChangesQuestionDetailsShape } from '../typeGuards.js';
* @import {ParamValue, ParamChangePositions, QuestionSpec, ChangeParamsPosition, ParamChangeIssue, ParamGovernor, ParamManagerRetriever, PoserFacet, VoteOnParamChanges} from '../types.js';
*/
-const { Fail } = assert;
-
/**
* The electorate that governs changes to the contract's parameters. It must be
* declared in the governed contract.
diff --git a/packages/governance/src/contractGovernance/paramManager.js b/packages/governance/src/contractGovernance/paramManager.js
index 28d417fd481..ccafa4fc6b7 100644
--- a/packages/governance/src/contractGovernance/paramManager.js
+++ b/packages/governance/src/contractGovernance/paramManager.js
@@ -1,3 +1,4 @@
+import { Fail, q } from '@endo/errors';
import { Far, passStyleOf } from '@endo/marshal';
import { AmountMath } from '@agoric/ertp';
import { assertKeywordName } from '@agoric/zoe/src/cleanProposal.js';
@@ -21,8 +22,6 @@ import { CONTRACT_ELECTORATE } from './governParam.js';
* @import {AnyParamManager, GovernanceSubscriptionState, ParamManagerBase, ParamStateRecord, ParamValueTyped, UpdateParams} from '../types.js';
*/
-const { Fail, quote: q } = assert;
-
/**
* @param {ParamManagerBase} paramManager
* @param {{[CONTRACT_ELECTORATE]: ParamValueTyped<'invitation'>}} governedParams
diff --git a/packages/governance/src/contractGovernance/typedParamManager.js b/packages/governance/src/contractGovernance/typedParamManager.js
index 57871b2f5de..cc6f82e732c 100644
--- a/packages/governance/src/contractGovernance/typedParamManager.js
+++ b/packages/governance/src/contractGovernance/typedParamManager.js
@@ -1,10 +1,9 @@
import { E } from '@endo/eventual-send';
+import { Fail, q } from '@endo/errors';
import { ParamTypes } from '../constants.js';
import { CONTRACT_ELECTORATE } from './governParam.js';
import { makeParamManagerBuilder } from './paramManager.js';
-const { Fail, quote: q } = assert;
-
/**
* @import {VoteCounterCreatorFacet, VoteCounterPublicFacet, QuestionSpec, OutcomeRecord, AddQuestion, AddQuestionReturn, GovernanceSubscriptionState, GovernanceTerms, ParamManagerBase, ParamStateRecord, ParamValueForType, UpdateParams} from '../types.js';
* @import {ParamType} from '../constants.js';
diff --git a/packages/governance/src/contractGovernor.js b/packages/governance/src/contractGovernor.js
index 90575ef2fdf..594d17aa28a 100644
--- a/packages/governance/src/contractGovernor.js
+++ b/packages/governance/src/contractGovernor.js
@@ -1,5 +1,6 @@
-import { mustMatch } from '@agoric/store';
+import { Fail } from '@endo/errors';
import { E } from '@endo/eventual-send';
+import { mustMatch } from '@agoric/store';
import { makeTracer } from '@agoric/internal';
import { provideSingleton } from '@agoric/zoe/src/contractSupport/durability.js';
@@ -11,8 +12,6 @@ import { ParamChangesQuestionDetailsShape } from './typeGuards.js';
* @import {GovernableStartFn, GovernorCreatorFacet, GovernorPublic, ParamChangeIssueDetails} from './types.js';
*/
-const { Fail } = assert;
-
const trace = makeTracer('CGov', false);
/** @type {ContractMeta} */
diff --git a/packages/governance/src/contractGovernorKit.js b/packages/governance/src/contractGovernorKit.js
index b7b6abe8e5b..02016b36607 100644
--- a/packages/governance/src/contractGovernorKit.js
+++ b/packages/governance/src/contractGovernorKit.js
@@ -1,4 +1,4 @@
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import { UnguardedHelperI, makeTracer } from '@agoric/internal';
import { M, prepareExoClassKit } from '@agoric/vat-data';
import { E } from '@endo/eventual-send';
diff --git a/packages/governance/src/contractHelper.js b/packages/governance/src/contractHelper.js
index f03112e29ab..c3a0896ea1d 100644
--- a/packages/governance/src/contractHelper.js
+++ b/packages/governance/src/contractHelper.js
@@ -1,3 +1,4 @@
+import { Fail } from '@endo/errors';
import { Far } from '@endo/marshal';
import { makeStoredPublisherKit } from '@agoric/notifier';
import { getMethodNames, objectMap } from '@agoric/internal';
@@ -14,8 +15,6 @@ import { CONTRACT_ELECTORATE } from './contractGovernance/governParam.js';
* @import {VoteCounterCreatorFacet, VoteCounterPublicFacet, QuestionSpec, OutcomeRecord, AddQuestion, AddQuestionReturn, GovernanceSubscriptionState, GovernanceTerms, GovernedApis, GovernedCreatorFacet, GovernedPublicFacet} from './types.js';
*/
-const { Fail } = assert;
-
export const GOVERNANCE_STORAGE_KEY = 'governance';
const publicMixinAPI = harden({
diff --git a/packages/governance/src/multiCandidateVoteCounter.js b/packages/governance/src/multiCandidateVoteCounter.js
index 15cf17ee238..ff236aa911d 100644
--- a/packages/governance/src/multiCandidateVoteCounter.js
+++ b/packages/governance/src/multiCandidateVoteCounter.js
@@ -1,6 +1,7 @@
-import { keyEQ, makeExo, makeScalarMapStore } from '@agoric/store';
+import { Fail } from '@endo/errors';
import { E } from '@endo/eventual-send';
import { makePromiseKit } from '@endo/promise-kit';
+import { keyEQ, makeExo, makeScalarMapStore } from '@agoric/store';
import {
buildQuestion,
ChoiceMethod,
@@ -21,8 +22,6 @@ import { breakTie } from './breakTie.js';
* @import {QuestionSpec, BuildMultiVoteCounter, MultiOutcomeRecord, Position, VoteStatistics} from './types.js';
*/
-const { Fail } = assert;
-
const validateQuestionSpec = questionSpec => {
coerceQuestionSpec(questionSpec);
diff --git a/packages/governance/src/validators.js b/packages/governance/src/validators.js
index 04b358ff1a4..4d626944c46 100644
--- a/packages/governance/src/validators.js
+++ b/packages/governance/src/validators.js
@@ -1,7 +1,6 @@
+import { Fail, q } from '@endo/errors';
import { E } from '@endo/eventual-send';
-const { Fail, quote: q } = assert;
-
/**
* @import {VoteCounterCreatorFacet, VoteCounterPublicFacet, QuestionSpec, OutcomeRecord, AddQuestion, AddQuestionReturn, AssertContractGovernance, AssertContractElectorate} from './types.js';
*/
diff --git a/packages/governance/test/swingsetTests/committeeBinary/bootstrap.js b/packages/governance/test/swingsetTests/committeeBinary/bootstrap.js
index 71e50968aba..b23a3fe2a1d 100644
--- a/packages/governance/test/swingsetTests/committeeBinary/bootstrap.js
+++ b/packages/governance/test/swingsetTests/committeeBinary/bootstrap.js
@@ -1,3 +1,4 @@
+import { q } from '@endo/errors';
import { makeMockChainStorageRoot } from '@agoric/internal/src/storage-test-utils.js';
import { buildZoeManualTimer } from '@agoric/zoe/tools/manualTimer.js';
import { E } from '@endo/eventual-send';
@@ -15,8 +16,6 @@ import { remoteNullMarshaller } from '../utils.js';
* @import {QuestionDetails} from '../../../src/types.js';
*/
-const { quote: q } = assert;
-
const makeVoterVat = async (log, vats, zoe) => {
const voterCreator = E(vats.voter).build(zoe);
log(`=> voter vat is set up`);
diff --git a/packages/governance/test/swingsetTests/committeeBinary/vat-voter.js b/packages/governance/test/swingsetTests/committeeBinary/vat-voter.js
index 25ce219568b..d817520ed99 100644
--- a/packages/governance/test/swingsetTests/committeeBinary/vat-voter.js
+++ b/packages/governance/test/swingsetTests/committeeBinary/vat-voter.js
@@ -1,14 +1,14 @@
-import { makeNotifierFromSubscriber, observeNotifier } from '@agoric/notifier';
-import { keyEQ } from '@agoric/store';
+import { q } from '@endo/errors';
import { E } from '@endo/eventual-send';
import { Far } from '@endo/marshal';
+import { makeNotifierFromSubscriber, observeNotifier } from '@agoric/notifier';
+import { keyEQ } from '@agoric/store';
+
/**
* @import {CommitteeElectoratePublic, Issue} from '../../../src/types.js';
*/
-const { quote: q } = assert;
-
/**
* @param {(msg: any)=> void} log
* @param {Issue} issue
diff --git a/packages/governance/test/swingsetTests/contractGovernor/bootstrap.js b/packages/governance/test/swingsetTests/contractGovernor/bootstrap.js
index 47952e64665..12dc64fe62b 100644
--- a/packages/governance/test/swingsetTests/contractGovernor/bootstrap.js
+++ b/packages/governance/test/swingsetTests/contractGovernor/bootstrap.js
@@ -1,8 +1,9 @@
+import { q } from '@endo/errors';
+import { E } from '@endo/eventual-send';
+import { Far } from '@endo/marshal';
import { makeMockChainStorageRoot } from '@agoric/internal/src/storage-test-utils.js';
import { observeIteration, subscribeEach } from '@agoric/notifier';
import { buildZoeManualTimer } from '@agoric/zoe/tools/manualTimer.js';
-import { E } from '@endo/eventual-send';
-import { Far } from '@endo/marshal';
import {
assertContractElectorate,
@@ -15,8 +16,6 @@ import { makeTerms, MALLEABLE_NUMBER } from './governedContract.js';
* @import {ContractGovernanceVoteResult, GovernedPublicFacetMethods, GovernorCreatorFacet, ParamChangesSpec, QuestionDetails, SimpleIssue, StandardParamPath} from '../../../src/types.js';
*/
-const { quote: q } = assert;
-
/**
* @param {ERef} zoe
* @param {(string:string) => undefined} log
diff --git a/packages/governance/test/swingsetTests/contractGovernor/vat-voter.js b/packages/governance/test/swingsetTests/contractGovernor/vat-voter.js
index a165f474cf8..4f8cb994f86 100644
--- a/packages/governance/test/swingsetTests/contractGovernor/vat-voter.js
+++ b/packages/governance/test/swingsetTests/contractGovernor/vat-voter.js
@@ -1,3 +1,4 @@
+import { q } from '@endo/errors';
import { E } from '@endo/eventual-send';
import { Far } from '@endo/marshal';
@@ -10,8 +11,6 @@ import {
} from '../../../src/index.js';
import { MALLEABLE_NUMBER } from './governedContract.js';
-const { quote: q } = assert;
-
const build = async (log, zoe) => {
return Far('voter', {
createVoter: async (name, invitation) => {
diff --git a/packages/governance/tools/puppetContractGovernor.js b/packages/governance/tools/puppetContractGovernor.js
index d4edd79883b..0ad9aa3e07b 100644
--- a/packages/governance/tools/puppetContractGovernor.js
+++ b/packages/governance/tools/puppetContractGovernor.js
@@ -1,7 +1,7 @@
+import { Fail } from '@endo/errors';
import { E } from '@endo/eventual-send';
import { Far } from '@endo/marshal';
-import { Fail } from '@agoric/assert';
// eslint-disable-next-line no-unused-vars -- used by typedef
import { CONTRACT_ELECTORATE } from '../src/contractGovernance/governParam.js';
import { makeApiInvocationPositions } from '../src/contractGovernance/governApi.js';
diff --git a/packages/inter-protocol/package.json b/packages/inter-protocol/package.json
index c2325e54111..5ff3f8f43ef 100644
--- a/packages/inter-protocol/package.json
+++ b/packages/inter-protocol/package.json
@@ -31,7 +31,7 @@
},
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
"dependencies": {
- "@agoric/assert": "^0.6.0",
+ "@endo/errors": "^1.2.2",
"@agoric/ertp": "^0.16.2",
"@agoric/governance": "^0.10.3",
"@agoric/internal": "^0.3.2",
diff --git a/packages/inter-protocol/src/auction/auctionBook.js b/packages/inter-protocol/src/auction/auctionBook.js
index 15fbf84574d..3b373c79a79 100644
--- a/packages/inter-protocol/src/auction/auctionBook.js
+++ b/packages/inter-protocol/src/auction/auctionBook.js
@@ -2,6 +2,8 @@
///
///
+import { Fail } from '@endo/errors';
+import { E } from '@endo/captp';
import { AmountMath, RatioShape } from '@agoric/ertp';
import { mustMatch } from '@agoric/store';
import { M, prepareExoClassKit } from '@agoric/vat-data';
@@ -16,7 +18,6 @@ import {
multiplyRatios,
ratioGTE,
} from '@agoric/zoe/src/contractSupport/index.js';
-import { E } from '@endo/captp';
import { observeNotifier } from '@agoric/notifier';
import { makeNatAmountShape } from '../contractSupport.js';
@@ -32,7 +33,6 @@ import {
* @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js';
*/
-const { Fail } = assert;
const { makeEmpty } = AmountMath;
const DEFAULT_DECIMALS = 9;
diff --git a/packages/inter-protocol/src/auction/auctioneer.js b/packages/inter-protocol/src/auction/auctioneer.js
index b0f231826ce..6d6b2d021a1 100644
--- a/packages/inter-protocol/src/auction/auctioneer.js
+++ b/packages/inter-protocol/src/auction/auctioneer.js
@@ -1,6 +1,9 @@
///
///
+import { Fail, q } from '@endo/errors';
+import { E } from '@endo/eventual-send';
+import { Far } from '@endo/marshal';
import { AmountMath, AmountShape, BrandShape } from '@agoric/ertp';
import { handleParamGovernance } from '@agoric/governance';
import { BASIS_POINTS, makeTracer } from '@agoric/internal';
@@ -25,8 +28,6 @@ import {
offerTo,
} from '@agoric/zoe/src/contractSupport/index.js';
import { FullProposalShape } from '@agoric/zoe/src/typeGuards.js';
-import { E } from '@endo/eventual-send';
-import { Far } from '@endo/marshal';
import { makeNatAmountShape } from '../contractSupport.js';
import { makeOfferSpecShape, prepareAuctionBook } from './auctionBook.js';
@@ -39,7 +40,6 @@ import { AuctionState } from './util.js';
* @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js';
*/
-const { Fail, quote: q } = assert;
const { add, multiply } = natSafeMath;
const trace = makeTracer('Auction', true);
diff --git a/packages/inter-protocol/src/auction/scheduleMath.js b/packages/inter-protocol/src/auction/scheduleMath.js
index 969981ea418..73fe93e4cef 100644
--- a/packages/inter-protocol/src/auction/scheduleMath.js
+++ b/packages/inter-protocol/src/auction/scheduleMath.js
@@ -1,5 +1,6 @@
// @jessie-check
+import { Fail } from '@endo/errors';
import { TimeMath } from '@agoric/time';
import { natSafeMath } from '@agoric/zoe/src/contractSupport/index.js';
import { assertAllDefined, makeTracer } from '@agoric/internal';
@@ -7,7 +8,6 @@ import { assertAllDefined, makeTracer } from '@agoric/internal';
/** @import {TimestampRecord} from '@agoric/time'; */
const { subtract, multiply, floorDivide } = natSafeMath;
-const { Fail } = assert;
const trace = makeTracer('SMath', true);
diff --git a/packages/inter-protocol/src/auction/scheduler.js b/packages/inter-protocol/src/auction/scheduler.js
index e78d8645a97..716b84267b5 100644
--- a/packages/inter-protocol/src/auction/scheduler.js
+++ b/packages/inter-protocol/src/auction/scheduler.js
@@ -1,6 +1,7 @@
+import { X, Fail, q, makeError } from '@endo/errors';
import { E } from '@endo/eventual-send';
-import { TimeMath } from '@agoric/time';
import { Far } from '@endo/marshal';
+import { TimeMath } from '@agoric/time';
import { makeTracer } from '@agoric/internal';
import { observeIteration, subscribeEach } from '@agoric/notifier';
@@ -11,8 +12,6 @@ import {
timeVsSchedule,
} from './scheduleMath.js';
-const { details: X, Fail, quote: q } = assert;
-
const trace = makeTracer('SCHED', true);
// If the startAuction wakeup is no more than 5 minutes late, go ahead with it.
@@ -263,7 +262,7 @@ export const makeScheduler = async (
if (!nextSchedule) {
console.error(
- assert.error(X`tried to start auction when none is scheduled`),
+ makeError(X`tried to start auction when none is scheduled`),
);
return;
}
diff --git a/packages/inter-protocol/src/auction/sortedOffers.js b/packages/inter-protocol/src/auction/sortedOffers.js
index f1d0e211d49..fd58098815b 100644
--- a/packages/inter-protocol/src/auction/sortedOffers.js
+++ b/packages/inter-protocol/src/auction/sortedOffers.js
@@ -1,5 +1,6 @@
// @jessie-check
+import { Fail } from '@endo/errors';
import {
makeRatio,
ratioToNumber,
@@ -9,8 +10,6 @@ import { RatioShape } from '@agoric/ertp';
import { decodeData, encodeData } from '../vaultFactory/storeUtils.js';
-const { Fail } = assert;
-
/**
* @file we use a floating point representation of the price or rate as the
* first part of the key in the store. The second part is the sequence number
diff --git a/packages/inter-protocol/src/clientSupport.js b/packages/inter-protocol/src/clientSupport.js
index abfa3904652..58c92353f80 100644
--- a/packages/inter-protocol/src/clientSupport.js
+++ b/packages/inter-protocol/src/clientSupport.js
@@ -1,6 +1,6 @@
// @ts-check
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import { AmountMath } from '@agoric/ertp';
import { assertAllDefined } from '@agoric/internal';
import { parseRatio } from '@agoric/zoe/src/contractSupport/ratio.js';
diff --git a/packages/inter-protocol/src/contractSupport.js b/packages/inter-protocol/src/contractSupport.js
index 3226ce8fddf..bc1941561a0 100644
--- a/packages/inter-protocol/src/contractSupport.js
+++ b/packages/inter-protocol/src/contractSupport.js
@@ -1,13 +1,12 @@
// @jessie-check
+import { Fail, q } from '@endo/errors';
import { AmountMath } from '@agoric/ertp';
import { M } from '@agoric/store';
import { makeRatioFromAmounts } from '@agoric/zoe/src/contractSupport/index.js';
/** @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js'; */
-const { Fail, quote: q } = assert;
-
export const amountPattern = harden({ brand: M.remotable(), value: M.any() });
export const ratioPattern = harden({
numerator: amountPattern,
diff --git a/packages/inter-protocol/src/interest.js b/packages/inter-protocol/src/interest.js
index 18733796123..688c4e67d2d 100644
--- a/packages/inter-protocol/src/interest.js
+++ b/packages/inter-protocol/src/interest.js
@@ -1,5 +1,6 @@
// @jessie-check
+import { Fail } from '@endo/errors';
import { AmountMath } from '@agoric/ertp';
import { natSafeMath } from '@agoric/zoe/src/contractSupport/index.js';
import {
@@ -7,7 +8,6 @@ import {
multiplyRatios,
quantize,
} from '@agoric/zoe/src/contractSupport/ratio.js';
-import { Fail } from '@agoric/assert';
import { TimeMath } from '@agoric/time';
/**
diff --git a/packages/inter-protocol/src/price/priceOracleKit.js b/packages/inter-protocol/src/price/priceOracleKit.js
index 7622fe50ef2..1f634d2544d 100644
--- a/packages/inter-protocol/src/price/priceOracleKit.js
+++ b/packages/inter-protocol/src/price/priceOracleKit.js
@@ -1,4 +1,4 @@
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import { makeTracer } from '@agoric/internal';
import { M, prepareExoClassKit } from '@agoric/vat-data';
diff --git a/packages/inter-protocol/src/price/roundsManager.js b/packages/inter-protocol/src/price/roundsManager.js
index e6566c51d04..0e47ce4cc38 100644
--- a/packages/inter-protocol/src/price/roundsManager.js
+++ b/packages/inter-protocol/src/price/roundsManager.js
@@ -1,4 +1,4 @@
-import { Fail, q } from '@agoric/assert';
+import { Fail, q } from '@endo/errors';
import { AmountMath } from '@agoric/ertp';
import { makeTracer } from '@agoric/internal';
import { TimeMath, TimestampShape } from '@agoric/time';
diff --git a/packages/inter-protocol/src/proposals/addAssetToVault.js b/packages/inter-protocol/src/proposals/addAssetToVault.js
index a96bfb81ccb..f1481e09099 100644
--- a/packages/inter-protocol/src/proposals/addAssetToVault.js
+++ b/packages/inter-protocol/src/proposals/addAssetToVault.js
@@ -1,6 +1,7 @@
// @jessie-check
// @ts-check
+import { q } from '@endo/errors';
import { ToFarFunction } from '@endo/captp';
import { Far } from '@endo/marshal';
import { AmountMath, AssetKind } from '@agoric/ertp';
@@ -20,8 +21,6 @@ import {
export * from './startPSM.js';
-const { quote: q } = assert;
-
/**
* @typedef {object} InterchainAssetOptions
* @property {string} [issuerBoardId]
diff --git a/packages/inter-protocol/src/proposals/startPSM.js b/packages/inter-protocol/src/proposals/startPSM.js
index 121813acf99..8a6e0bd5daa 100644
--- a/packages/inter-protocol/src/proposals/startPSM.js
+++ b/packages/inter-protocol/src/proposals/startPSM.js
@@ -1,11 +1,12 @@
// @jessie-check
import { makeMap } from 'jessie.js';
+import { X } from '@endo/errors';
+import { E } from '@endo/far';
import { AmountMath, AssetKind } from '@agoric/ertp';
import { CONTRACT_ELECTORATE, ParamTypes } from '@agoric/governance';
import { makeStorageNodeChild } from '@agoric/internal/src/lib-chainStorage.js';
import { makeRatio } from '@agoric/zoe/src/contractSupport/index.js';
-import { E } from '@endo/far';
import {
makeHistoryReviver,
makeBoardRemote,
@@ -28,7 +29,6 @@ import {
/** @import {EconomyBootstrapPowers} from './econ-behaviors.js' */
const BASIS_POINTS = 10000n;
-const { details: X } = assert;
export { inviteCommitteeMembers, startEconCharter, inviteToEconCharter };
diff --git a/packages/inter-protocol/src/proposals/utils.js b/packages/inter-protocol/src/proposals/utils.js
index 9a4088c0691..4dce2abdad3 100644
--- a/packages/inter-protocol/src/proposals/utils.js
+++ b/packages/inter-protocol/src/proposals/utils.js
@@ -1,11 +1,10 @@
+import { Fail } from '@endo/errors';
+import { E } from '@endo/far';
import { WalletName } from '@agoric/internal';
import { getCopyMapEntries, makeCopyMap } from '@agoric/store';
-import { E } from '@endo/far';
/** @import {CopyMap} from '@endo/patterns') */
-const { Fail } = assert;
-
/**
* @param {ERef} nameAdmin
* @param {string[][]} paths
diff --git a/packages/inter-protocol/src/provisionPoolKit.js b/packages/inter-protocol/src/provisionPoolKit.js
index fb8136e2359..4e1c71aa704 100644
--- a/packages/inter-protocol/src/provisionPoolKit.js
+++ b/packages/inter-protocol/src/provisionPoolKit.js
@@ -1,4 +1,8 @@
// @ts-check
+import { X, q, Fail } from '@endo/errors';
+import { E } from '@endo/far';
+import { Far } from '@endo/marshal';
+
import { AmountMath, BrandShape } from '@agoric/ertp';
import { deeplyFulfilledObject, makeTracer } from '@agoric/internal';
import { UnguardedHelperI } from '@agoric/internal/src/typeGuards.js';
@@ -19,12 +23,8 @@ import {
makeRecorderTopic,
} from '@agoric/zoe/src/contractSupport/topics.js';
import { InstanceHandleShape } from '@agoric/zoe/src/typeGuards.js';
-import { E } from '@endo/far';
-import { Far } from '@endo/marshal';
import { isUpgradeDisconnection } from '@agoric/internal/src/upgrade-api.js';
-const { details: X, quote: q, Fail } = assert;
-
const trace = makeTracer('ProvPool');
const FIRST_UPPER_KEYWORD = /^[A-Z][a-zA-Z0-9_$]*$/;
diff --git a/packages/inter-protocol/src/psm/psm.js b/packages/inter-protocol/src/psm/psm.js
index eebcd9da605..f19e1cb9fe2 100644
--- a/packages/inter-protocol/src/psm/psm.js
+++ b/packages/inter-protocol/src/psm/psm.js
@@ -2,6 +2,8 @@
///
///
+import { Fail } from '@endo/errors';
+import { E } from '@endo/eventual-send';
import { AmountMath, AmountShape, BrandShape, RatioShape } from '@agoric/ertp';
import {
CONTRACT_ELECTORATE,
@@ -29,14 +31,11 @@ import {
InstanceHandleShape,
InvitationShape,
} from '@agoric/zoe/src/typeGuards.js';
-import { E } from '@endo/eventual-send';
import { mustMatch } from '@agoric/store';
import { makeCollectFeesInvitation } from '../collectFees.js';
import { makeNatAmountShape } from '../contractSupport.js';
-const { Fail } = assert;
-
/**
* @file The Parity Stability Module supports efficiently minting/burning a
* stable token at a specified fixed ratio to a reference stable token, which
diff --git a/packages/inter-protocol/src/reserve/assetReserveKit.js b/packages/inter-protocol/src/reserve/assetReserveKit.js
index ef682b83210..b21da11e2fe 100644
--- a/packages/inter-protocol/src/reserve/assetReserveKit.js
+++ b/packages/inter-protocol/src/reserve/assetReserveKit.js
@@ -1,4 +1,4 @@
-import { Fail } from '@agoric/assert';
+import { Fail, q } from '@endo/errors';
import { AmountMath, AmountShape, IssuerShape } from '@agoric/ertp';
import { makeTracer } from '@agoric/internal';
import { M, makeScalarBigMapStore, prepareExoClassKit } from '@agoric/vat-data';
@@ -11,8 +11,6 @@ import { AmountKeywordRecordShape } from '@agoric/zoe/src/typeGuards.js';
import { E } from '@endo/eventual-send';
import { UnguardedHelperI } from '@agoric/internal/src/typeGuards.js';
-const { quote: q } = assert;
-
const trace = makeTracer('ReserveKit', true);
/**
diff --git a/packages/inter-protocol/src/vaultFactory/vault.js b/packages/inter-protocol/src/vaultFactory/vault.js
index 2216ad24f16..70fed25f3fa 100644
--- a/packages/inter-protocol/src/vaultFactory/vault.js
+++ b/packages/inter-protocol/src/vaultFactory/vault.js
@@ -1,3 +1,4 @@
+import { q, Fail } from '@endo/errors';
import { AmountMath, AmountShape } from '@agoric/ertp';
import { StorageNodeShape, makeTracer } from '@agoric/internal';
import { UnguardedHelperI } from '@agoric/internal/src/typeGuards.js';
@@ -13,8 +14,6 @@ import { calculateCurrentDebt, reverseInterest } from '../interest-math.js';
import { calculateDebtCosts } from './math.js';
import { prepareVaultKit } from './vaultKit.js';
-const { quote: q, Fail } = assert;
-
const trace = makeTracer('Vault', true);
/**
diff --git a/packages/inter-protocol/src/vaultFactory/vaultDirector.js b/packages/inter-protocol/src/vaultFactory/vaultDirector.js
index 82504a08176..5eea587cd44 100644
--- a/packages/inter-protocol/src/vaultFactory/vaultDirector.js
+++ b/packages/inter-protocol/src/vaultFactory/vaultDirector.js
@@ -1,6 +1,9 @@
///
///
+import { Fail, q } from '@endo/errors';
+import { E } from '@endo/eventual-send';
+import { Far } from '@endo/marshal';
import { AmountMath, AmountShape, BrandShape, IssuerShape } from '@agoric/ertp';
import {
GovernorFacetShape,
@@ -22,8 +25,6 @@ import {
TopicsRecordShape,
unitAmount,
} from '@agoric/zoe/src/contractSupport/index.js';
-import { E } from '@endo/eventual-send';
-import { Far } from '@endo/marshal';
import { makeCollectFeesInvitation } from '../collectFees.js';
import {
setWakeupsForNextAuction,
@@ -39,8 +40,6 @@ import {
provideAndStartVaultManagerKits,
} from './vaultManager.js';
-const { Fail, quote: q } = assert;
-
const trace = makeTracer('VD', true);
/**
diff --git a/packages/inter-protocol/src/vaultFactory/vaultHolder.js b/packages/inter-protocol/src/vaultFactory/vaultHolder.js
index c4a4acd49b7..567849ae3e0 100644
--- a/packages/inter-protocol/src/vaultFactory/vaultHolder.js
+++ b/packages/inter-protocol/src/vaultFactory/vaultHolder.js
@@ -1,11 +1,10 @@
/** @file Use-object for the owner of a vault */
+import { Fail } from '@endo/errors';
import { AmountShape } from '@agoric/ertp';
import { M, prepareExoClassKit } from '@agoric/vat-data';
import { TopicsRecordShape } from '@agoric/zoe/src/contractSupport/index.js';
import { UnguardedHelperI } from '@agoric/internal/src/typeGuards.js';
-const { Fail } = assert;
-
/**
* @typedef {{
* topicKit: import('@agoric/zoe/src/contractSupport/recorder.js').RecorderKit;
diff --git a/packages/inter-protocol/src/vaultFactory/vaultManager.js b/packages/inter-protocol/src/vaultFactory/vaultManager.js
index e80341b5b61..ad5cffc37ed 100644
--- a/packages/inter-protocol/src/vaultFactory/vaultManager.js
+++ b/packages/inter-protocol/src/vaultFactory/vaultManager.js
@@ -18,6 +18,8 @@
*/
///
+import { X, Fail, q, makeError } from '@endo/errors';
+import { E } from '@endo/eventual-send';
import {
AmountMath,
AmountShape,
@@ -50,7 +52,6 @@ import {
TopicsRecordShape,
} from '@agoric/zoe/src/contractSupport/index.js';
import { PriceQuoteShape, SeatShape } from '@agoric/zoe/src/typeGuards.js';
-import { E } from '@endo/eventual-send';
import {
checkDebtLimit,
makeNatAmountShape,
@@ -69,8 +70,6 @@ import { AuctionPFShape } from '../auction/auctioneer.js';
* @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js';
*/
-const { details: X, Fail, quote: q } = assert;
-
const trace = makeTracer('VM');
/**
@@ -415,12 +414,12 @@ export const prepareVaultManagerKit = (
),
fail: reason => {
zcf.shutdownWithFailure(
- assert.error(X`Unable to continue without a timer: ${reason}`),
+ makeError(X`Unable to continue without a timer: ${reason}`),
);
},
finish: done => {
zcf.shutdownWithFailure(
- assert.error(X`Unable to continue without a timer: ${done}`),
+ makeError(X`Unable to continue without a timer: ${done}`),
);
},
});
diff --git a/packages/inter-protocol/test/auction/auctionContract.test.js b/packages/inter-protocol/test/auction/auctionContract.test.js
index d3715590bd2..95ff406c4e8 100644
--- a/packages/inter-protocol/test/auction/auctionContract.test.js
+++ b/packages/inter-protocol/test/auction/auctionContract.test.js
@@ -2,7 +2,11 @@ import { test as anyTest } from '@agoric/zoe/tools/prepare-test-env-ava.js';
import { AmountMath, makeIssuerKit } from '@agoric/ertp';
import { documentStorageSchema } from '@agoric/governance/tools/storageDoc.js';
-import { deeplyFulfilledObject, makeTracer } from '@agoric/internal';
+import {
+ deeplyFulfilledObject,
+ makeTracer,
+ NonNullish,
+} from '@agoric/internal';
import { subscribeEach } from '@agoric/notifier';
import { eventLoopIteration } from '@agoric/internal/src/testing-utils.js';
import { buildManualTimer } from '@agoric/swingset-vat/tools/manual-timer.js';
@@ -16,7 +20,6 @@ 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/assert';
import {
setupReserve,
diff --git a/packages/inter-protocol/test/auction/scheduleMath.test.js b/packages/inter-protocol/test/auction/scheduleMath.test.js
index 3358591d004..0b7e6cd3d3b 100644
--- a/packages/inter-protocol/test/auction/scheduleMath.test.js
+++ b/packages/inter-protocol/test/auction/scheduleMath.test.js
@@ -3,7 +3,7 @@ import { test } from '@agoric/zoe/tools/prepare-test-env-ava.js';
import { TimeMath } from '@agoric/time';
import { Far } from '@endo/marshal';
-import { NonNullish } from '@agoric/assert';
+import { NonNullish } from '@agoric/internal';
import {
computeRoundTiming,
nextDescendingStepTime,
diff --git a/packages/inter-protocol/test/psm/gov-replace-committee.js b/packages/inter-protocol/test/psm/gov-replace-committee.js
index 0a28d34bc51..aed086c3492 100644
--- a/packages/inter-protocol/test/psm/gov-replace-committee.js
+++ b/packages/inter-protocol/test/psm/gov-replace-committee.js
@@ -6,7 +6,7 @@
* (aka big hammer)
*/
-const { Fail } = assert;
+import { Fail } from '@endo/errors';
const runConfig = {
committeeName: 'Economic Committee',
diff --git a/packages/inter-protocol/test/psm/psm.test.js b/packages/inter-protocol/test/psm/psm.test.js
index b8cd41e40e6..ccd533147f7 100644
--- a/packages/inter-protocol/test/psm/psm.test.js
+++ b/packages/inter-protocol/test/psm/psm.test.js
@@ -16,9 +16,8 @@ import {
natSafeMath as NatMath,
} from '@agoric/zoe/src/contractSupport/index.js';
-import { NonNullish } from '@agoric/assert';
+import { NonNullish, makeTracer } from '@agoric/internal';
import { documentStorageSchema } from '@agoric/governance/tools/storageDoc.js';
-import { makeTracer } from '@agoric/internal';
import { eventLoopIteration } from '@agoric/internal/src/testing-utils.js';
import { makeAgoricNamesAccess, makePromiseSpace } from '@agoric/vats';
import {
diff --git a/packages/inter-protocol/test/smartWallet/boot-test-utils.js b/packages/inter-protocol/test/smartWallet/boot-test-utils.js
index c078f0fd445..c4674281b69 100644
--- a/packages/inter-protocol/test/smartWallet/boot-test-utils.js
+++ b/packages/inter-protocol/test/smartWallet/boot-test-utils.js
@@ -4,6 +4,7 @@
* integrates multiple bundles so should move to a bootstrap-style test.
*/
// @ts-check
+import { Fail } from '@endo/errors';
import {
makeFakeVatAdmin,
zcfBundleCap,
@@ -14,8 +15,6 @@ import { makeScalarBigMapStore } from '@agoric/vat-data';
import { vatRoots } from '@agoric/vats/tools/boot-test-utils.js';
import { bundles, devices } from './devices.js';
-const { Fail } = assert;
-
export const noop = () => {};
/** @type {DProxy} */
diff --git a/packages/inter-protocol/test/smartWallet/oracle-integration.test.js b/packages/inter-protocol/test/smartWallet/oracle-integration.test.js
index 2665d8e339b..e896b16ff88 100644
--- a/packages/inter-protocol/test/smartWallet/oracle-integration.test.js
+++ b/packages/inter-protocol/test/smartWallet/oracle-integration.test.js
@@ -1,8 +1,7 @@
import { test as anyTest } from '@agoric/zoe/tools/prepare-test-env-ava.js';
-import { NonNullish } from '@agoric/assert';
+import { NonNullish, zip } from '@agoric/internal';
import { AssetKind, makeIssuerKit } from '@agoric/ertp';
-import { 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';
diff --git a/packages/inter-protocol/test/smartWallet/psm-integration.test.js b/packages/inter-protocol/test/smartWallet/psm-integration.test.js
index 65450049c10..2444cc34f43 100644
--- a/packages/inter-protocol/test/smartWallet/psm-integration.test.js
+++ b/packages/inter-protocol/test/smartWallet/psm-integration.test.js
@@ -3,7 +3,7 @@ import { test as anyTest } from '@agoric/zoe/tools/prepare-test-env-ava.js';
import { AmountMath, makeIssuerKit } from '@agoric/ertp';
import { eventLoopIteration } from '@agoric/internal/src/testing-utils.js';
import { E } from '@endo/far';
-import { NonNullish } from '@agoric/assert';
+import { NonNullish } from '@agoric/internal';
import { keyEQ } from '@agoric/store';
import { coalesceUpdates } from '@agoric/smart-wallet/src/utils.js';
diff --git a/packages/inter-protocol/test/swingsetTests/fluxAggregator/bootstrap-fluxAggregator-service-upgrade.js b/packages/inter-protocol/test/swingsetTests/fluxAggregator/bootstrap-fluxAggregator-service-upgrade.js
index 3f75aacd182..cdc1f520358 100644
--- a/packages/inter-protocol/test/swingsetTests/fluxAggregator/bootstrap-fluxAggregator-service-upgrade.js
+++ b/packages/inter-protocol/test/swingsetTests/fluxAggregator/bootstrap-fluxAggregator-service-upgrade.js
@@ -1,9 +1,13 @@
// @ts-check
-import { Fail, NonNullish } from '@agoric/assert';
+import { Fail } from '@endo/errors';
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';
diff --git a/packages/inter-protocol/test/swingsetTests/fluxAggregator/fluxAggregator-service-upgrade.test.js b/packages/inter-protocol/test/swingsetTests/fluxAggregator/fluxAggregator-service-upgrade.test.js
index 3e3fafbbccc..a7aff689d51 100644
--- a/packages/inter-protocol/test/swingsetTests/fluxAggregator/fluxAggregator-service-upgrade.test.js
+++ b/packages/inter-protocol/test/swingsetTests/fluxAggregator/fluxAggregator-service-upgrade.test.js
@@ -1,6 +1,6 @@
import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava.js';
-import { assert } from '@agoric/assert';
+import { assert } from '@endo/errors';
import { resolve as importMetaResolve } from 'import-meta-resolve';
import { buildVatController } from '@agoric/swingset-vat';
diff --git a/packages/inter-protocol/test/swingsetTests/psmUpgrade/bootstrap-psm-upgrade.js b/packages/inter-protocol/test/swingsetTests/psmUpgrade/bootstrap-psm-upgrade.js
index cc81868644e..a0d47ea6942 100644
--- a/packages/inter-protocol/test/swingsetTests/psmUpgrade/bootstrap-psm-upgrade.js
+++ b/packages/inter-protocol/test/swingsetTests/psmUpgrade/bootstrap-psm-upgrade.js
@@ -1,9 +1,13 @@
// @ts-check
-import { Fail, NonNullish } from '@agoric/assert';
+import { Fail } from '@endo/errors';
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';
diff --git a/packages/inter-protocol/test/swingsetTests/psmUpgrade/psm-upgrade.test.js b/packages/inter-protocol/test/swingsetTests/psmUpgrade/psm-upgrade.test.js
index 45d4e66bf81..f2356d6dc7b 100644
--- a/packages/inter-protocol/test/swingsetTests/psmUpgrade/psm-upgrade.test.js
+++ b/packages/inter-protocol/test/swingsetTests/psmUpgrade/psm-upgrade.test.js
@@ -1,6 +1,6 @@
import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava.js';
-import { assert } from '@agoric/assert';
+import { assert } from '@endo/errors';
import { resolve as importMetaResolve } from 'import-meta-resolve';
import { buildVatController } from '@agoric/swingset-vat';
diff --git a/packages/inter-protocol/test/swingsetTests/reserve/assetReserve-upgrade.test.js b/packages/inter-protocol/test/swingsetTests/reserve/assetReserve-upgrade.test.js
index 06a5fd4f97d..37cd55ac94d 100644
--- a/packages/inter-protocol/test/swingsetTests/reserve/assetReserve-upgrade.test.js
+++ b/packages/inter-protocol/test/swingsetTests/reserve/assetReserve-upgrade.test.js
@@ -1,6 +1,6 @@
import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava.js';
-import { assert } from '@agoric/assert';
+import { assert } from '@endo/errors';
import { resolve as importMetaResolve } from 'import-meta-resolve';
import { buildVatController } from '@agoric/swingset-vat';
diff --git a/packages/inter-protocol/test/swingsetTests/reserve/bootstrap-assetReserve-upgrade.js b/packages/inter-protocol/test/swingsetTests/reserve/bootstrap-assetReserve-upgrade.js
index 1ce482ed2f9..d6bb13d4d50 100644
--- a/packages/inter-protocol/test/swingsetTests/reserve/bootstrap-assetReserve-upgrade.js
+++ b/packages/inter-protocol/test/swingsetTests/reserve/bootstrap-assetReserve-upgrade.js
@@ -1,9 +1,13 @@
// @ts-check
-import { Fail, NonNullish } from '@agoric/assert';
+import { Fail } from '@endo/errors';
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';
diff --git a/packages/inter-protocol/test/vaultFactory/driver.js b/packages/inter-protocol/test/vaultFactory/driver.js
index e0f0e7e56c7..7c486fd4ea2 100644
--- a/packages/inter-protocol/test/vaultFactory/driver.js
+++ b/packages/inter-protocol/test/vaultFactory/driver.js
@@ -1,5 +1,5 @@
import { AmountMath, AssetKind, makeIssuerKit } from '@agoric/ertp';
-import { allValues, makeTracer, objectMap } from '@agoric/internal';
+import { allValues, makeTracer, objectMap, NonNullish } from '@agoric/internal';
import { makeNotifierFromSubscriber } from '@agoric/notifier';
import { unsafeMakeBundleCache } from '@agoric/swingset-vat/tools/bundleTool.js';
import {
@@ -12,7 +12,6 @@ import { buildZoeManualTimer } from '@agoric/zoe/tools/manualTimer.js';
import { E } from '@endo/eventual-send';
import { deeplyFulfilled } from '@endo/marshal';
-import { NonNullish } from '@agoric/assert';
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';
diff --git a/packages/inter-protocol/test/vaultFactory/vault-interest.test.js b/packages/inter-protocol/test/vaultFactory/vault-interest.test.js
index 01ac44e96dd..72e4648fb88 100644
--- a/packages/inter-protocol/test/vaultFactory/vault-interest.test.js
+++ b/packages/inter-protocol/test/vaultFactory/vault-interest.test.js
@@ -1,5 +1,6 @@
import { test } from '@agoric/zoe/tools/prepare-test-env-ava.js';
+import { assert } from '@endo/errors';
import { E } from '@endo/eventual-send';
import { setUpZoeForTest } from '@agoric/zoe/tools/setup-zoe.js';
import bundleSource from '@endo/bundle-source';
@@ -7,7 +8,6 @@ import { resolve as importMetaResolve } from 'import-meta-resolve';
import { AmountMath } from '@agoric/ertp';
-import { assert } from '@agoric/assert';
import { makeTracer } from '@agoric/internal';
const vaultRoot = './vault-contract-wrapper.js';
diff --git a/packages/inter-protocol/test/vaultFactory/vault.test.js b/packages/inter-protocol/test/vaultFactory/vault.test.js
index 77e03690c57..c5712a70755 100644
--- a/packages/inter-protocol/test/vaultFactory/vault.test.js
+++ b/packages/inter-protocol/test/vaultFactory/vault.test.js
@@ -1,5 +1,6 @@
import { test } from '@agoric/zoe/tools/prepare-test-env-ava.js';
+import { assert } from '@endo/errors';
import { setUpZoeForTest } from '@agoric/zoe/tools/setup-zoe.js';
import bundleSource from '@endo/bundle-source';
import { E } from '@endo/eventual-send';
@@ -7,7 +8,6 @@ import { resolve as importMetaResolve } from 'import-meta-resolve';
import { AmountMath, makeIssuerKit } from '@agoric/ertp';
-import { assert } from '@agoric/assert';
import { makeTracer } from '@agoric/internal';
const vaultRoot = './vault-contract-wrapper.js';
diff --git a/packages/inter-protocol/test/vaultFactory/vaultLiquidation.test.js b/packages/inter-protocol/test/vaultFactory/vaultLiquidation.test.js
index 56aed15a328..9f9cad0738c 100644
--- a/packages/inter-protocol/test/vaultFactory/vaultLiquidation.test.js
+++ b/packages/inter-protocol/test/vaultFactory/vaultLiquidation.test.js
@@ -6,6 +6,7 @@ import {
deeplyFulfilledObject,
makeTracer,
objectMap,
+ NonNullish,
} from '@agoric/internal';
import { unsafeMakeBundleCache } from '@agoric/swingset-vat/tools/bundleTool.js';
import {
@@ -19,7 +20,6 @@ import { E } from '@endo/eventual-send';
import { TimeMath } from '@agoric/time';
import { assertPayoutAmount } from '@agoric/zoe/test/zoeTestHelpers.js';
import { multiplyBy } from '@agoric/zoe/src/contractSupport/ratio.js';
-import { NonNullish } from '@agoric/assert';
import {
SECONDS_PER_DAY as ONE_DAY,
diff --git a/packages/internal/package.json b/packages/internal/package.json
index 0c893089470..c4a62bdbadd 100755
--- a/packages/internal/package.json
+++ b/packages/internal/package.json
@@ -20,7 +20,7 @@
"lint:types": "tsc"
},
"dependencies": {
- "@agoric/assert": "^0.6.0",
+ "@endo/errors": "^1.2.2",
"@agoric/base-zone": "^0.1.0",
"@endo/common": "^1.2.2",
"@endo/far": "^1.1.2",
diff --git a/packages/internal/src/callback.js b/packages/internal/src/callback.js
index 51784b3f8a4..01350acfa58 100644
--- a/packages/internal/src/callback.js
+++ b/packages/internal/src/callback.js
@@ -1,4 +1,5 @@
// @ts-check
+import { Fail, makeError, q } from '@endo/errors';
import { E } from '@endo/far';
import { isObject, isPassableSymbol } from '@endo/marshal';
import { getInterfaceMethodKeys } from '@endo/patterns';
@@ -6,8 +7,6 @@ import { getInterfaceMethodKeys } from '@endo/patterns';
/** @import {ERef} from '@endo/far' */
/** @import {Callback, SyncCallback} from './types.js' */
-const { Fail, quote: q } = assert;
-
const { fromEntries } = Object;
const { ownKeys: rawOwnKeys } = Reflect;
@@ -223,9 +222,7 @@ export const prepareAttenuator = (
// Support both synchronous and async callbacks.
const cb = this.state.cbs[key];
if (!cb) {
- const err = assert.error(
- `unimplemented ${q(tag)} method ${q(key)}`,
- );
+ const err = makeError(`unimplemented ${q(tag)} method ${q(key)}`);
if (this.state.isSync) {
throw err;
}
diff --git a/packages/internal/src/errors.js b/packages/internal/src/errors.js
new file mode 100644
index 00000000000..473db1c25c2
--- /dev/null
+++ b/packages/internal/src/errors.js
@@ -0,0 +1,16 @@
+import { q } from '@endo/errors';
+
+/**
+ * @template T
+ * @param {T | null | undefined} val
+ * @param {string} [optDetails]
+ * @returns {T}
+ */
+export const NonNullish = (val, optDetails = `unexpected ${q(val)}`) => {
+ if (val != null) {
+ // This `!= null` idiom checks that `val` is neither `null` nor `undefined`.
+ return val;
+ }
+ assert.fail(optDetails);
+};
+harden(NonNullish);
diff --git a/packages/internal/src/index.js b/packages/internal/src/index.js
index c8e36af48ef..a9b3a7b0a3b 100644
--- a/packages/internal/src/index.js
+++ b/packages/internal/src/index.js
@@ -4,6 +4,7 @@
export * from './config.js';
export * from './debug.js';
+export * from './errors.js';
export * from './utils.js';
export * from './method-tools.js';
export * from './typeGuards.js';
diff --git a/packages/internal/src/lib-chainStorage.js b/packages/internal/src/lib-chainStorage.js
index 2f92e9c2abe..e67b5766166 100644
--- a/packages/internal/src/lib-chainStorage.js
+++ b/packages/internal/src/lib-chainStorage.js
@@ -1,5 +1,6 @@
// @ts-check
+import { Fail } from '@endo/errors';
import { E } from '@endo/far';
import { M } from '@endo/patterns';
import { makeHeapZone } from '@agoric/base-zone/heap.js';
@@ -10,8 +11,6 @@ import * as cb from './callback.js';
* @import {PassableCap} from '@endo/marshal';
*/
-const { Fail } = assert;
-
/** @typedef {ReturnType} Marshaller */
/** @typedef {Pick} Unserializer */
diff --git a/packages/internal/src/lib-nodejs/spawnSubprocessWorker.js b/packages/internal/src/lib-nodejs/spawnSubprocessWorker.js
index 364452b23aa..bd79838d3b1 100644
--- a/packages/internal/src/lib-nodejs/spawnSubprocessWorker.js
+++ b/packages/internal/src/lib-nodejs/spawnSubprocessWorker.js
@@ -1,7 +1,7 @@
// this file is loaded by the controller, in the start compartment
import { spawn } from 'child_process';
import { makePromiseKit } from '@endo/promise-kit';
-import { NonNullish } from '@agoric/assert';
+import { NonNullish } from '../errors.js';
import { arrayEncoderStream, arrayDecoderStream } from './worker-protocol.js';
import {
netstringEncoderStream,
diff --git a/packages/internal/src/marshal.js b/packages/internal/src/marshal.js
index 21f7205d86a..3750b910ad2 100644
--- a/packages/internal/src/marshal.js
+++ b/packages/internal/src/marshal.js
@@ -1,10 +1,9 @@
// @ts-check
+import { Fail } from '@endo/errors';
import { Far } from '@endo/far';
import { makeMarshal } from '@endo/marshal';
import { isStreamCell } from './lib-chainStorage.js';
-const { Fail } = assert;
-
/**
* Should be a union with Remotable, but that's `any`, making this type
* meaningless
diff --git a/packages/internal/src/netstring.js b/packages/internal/src/netstring.js
index 06feb874ea8..690d3c9f832 100644
--- a/packages/internal/src/netstring.js
+++ b/packages/internal/src/netstring.js
@@ -1,5 +1,5 @@
/* global Buffer */
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
// adapted from 'netstring-stream', https://github.com/tlivings/netstring-stream/
import { Transform } from 'stream';
diff --git a/packages/internal/src/node/createBundles.js b/packages/internal/src/node/createBundles.js
index ecc7d505b73..9b78839e0ac 100644
--- a/packages/internal/src/node/createBundles.js
+++ b/packages/internal/src/node/createBundles.js
@@ -5,7 +5,8 @@ import path from 'path';
import { spawnSync } from 'child_process';
import { createRequire } from 'module';
-const { Fail, quote: q } = assert;
+import { Fail, q } from '@endo/errors';
+
const BUNDLE_SOURCE_PROGRAM = 'bundle-source';
const req = createRequire(import.meta.url);
diff --git a/packages/internal/src/priority-senders.js b/packages/internal/src/priority-senders.js
index d56b22b4d8a..f47c3d2e7ad 100644
--- a/packages/internal/src/priority-senders.js
+++ b/packages/internal/src/priority-senders.js
@@ -1,7 +1,6 @@
+import { Fail, q } from '@endo/errors';
import { E, Far } from '@endo/far';
-const { Fail, quote: q } = assert;
-
const PRIORITY_SENDERS_NAMESPACE_RE = /^[a-zA-Z0-9_-]{1,50}$/;
/** @type {(namespace: string) => string} */
diff --git a/packages/internal/src/storage-test-utils.js b/packages/internal/src/storage-test-utils.js
index a54e610ac8f..9da583ab10a 100644
--- a/packages/internal/src/storage-test-utils.js
+++ b/packages/internal/src/storage-test-utils.js
@@ -1,4 +1,5 @@
// @ts-check
+import { Fail } from '@endo/errors';
import { Far } from '@endo/far';
import { makeMarshal, Remotable } from '@endo/marshal';
import { unmarshalFromVstorage } from './marshal.js';
@@ -11,8 +12,6 @@ import { eventLoopIteration } from './testing-utils.js';
* @import {Marshaller, StorageEntry, StorageMessage, StorageNode} from './lib-chainStorage.js';
*/
-const { Fail } = assert;
-
const trace = makeTracer('StorTU', false);
/**
diff --git a/packages/internal/src/utils.js b/packages/internal/src/utils.js
index be3cf6dc8a9..0ca49c8515c 100644
--- a/packages/internal/src/utils.js
+++ b/packages/internal/src/utils.js
@@ -1,6 +1,7 @@
// @ts-check
// @jessie-check
+import { q, Fail, makeError, annotateError, X } from '@endo/errors';
import { deeplyFulfilled, isObject } from '@endo/marshal';
import { makePromiseKit } from '@endo/promise-kit';
import { makeQueue } from '@endo/stream';
@@ -8,8 +9,6 @@ import { asyncGenerate } from 'jessie.js';
const { fromEntries, keys, values } = Object;
-const { quote: q, Fail } = assert;
-
export const BASIS_POINTS = 10_000n;
/** @import {ERef} from '@endo/far' */
@@ -204,8 +203,8 @@ export const synchronizedTee = (sourceStream, readerCount) => {
if (doneResult) {
result = Promise.resolve(doneResult);
} else if (rejections.length) {
- const error = assert.error(assert.details`Teed stream threw`);
- assert.note(error, assert.details`Teed rejections: ${rejections}`);
+ const error = makeError(X`Teed stream threw`);
+ annotateError(error, X`Teed rejections: ${rejections}`);
result =
sourceStream.throw?.(error) ||
Promise.resolve(sourceStream.return?.()).then(() =>
diff --git a/packages/kmarshal/package.json b/packages/kmarshal/package.json
index 78ba2d69074..6d0c4cb1bf6 100644
--- a/packages/kmarshal/package.json
+++ b/packages/kmarshal/package.json
@@ -23,7 +23,7 @@
"dependencies": {
"@endo/far": "^1.1.2",
"@endo/marshal": "^1.5.0",
- "@agoric/assert": "^0.6.0"
+ "@endo/errors": "^1.2.2"
},
"devDependencies": {
"ava": "^5.3.0"
diff --git a/packages/kmarshal/src/kmarshal.js b/packages/kmarshal/src/kmarshal.js
index 707daf6d828..aa6c7475d8c 100644
--- a/packages/kmarshal/src/kmarshal.js
+++ b/packages/kmarshal/src/kmarshal.js
@@ -1,6 +1,6 @@
+import { assert, Fail } from '@endo/errors';
import { Far, passStyleOf } from '@endo/far';
import { makeMarshal } from '@endo/marshal';
-import { assert, Fail } from '@agoric/assert';
/**
* @import { ERef } from '@endo/far';
diff --git a/packages/network/package.json b/packages/network/package.json
index 6fdc9586e55..dae88c70df4 100644
--- a/packages/network/package.json
+++ b/packages/network/package.json
@@ -21,7 +21,7 @@
"author": "Agoric",
"license": "Apache-2.0",
"dependencies": {
- "@agoric/assert": "^0.6.0",
+ "@endo/errors": "^1.2.2",
"@agoric/internal": "^0.3.2",
"@agoric/store": "^0.9.2",
"@agoric/vat-data": "^0.5.2",
diff --git a/packages/network/src/bytes.js b/packages/network/src/bytes.js
index e952b1b0dc4..67c0b79c241 100644
--- a/packages/network/src/bytes.js
+++ b/packages/network/src/bytes.js
@@ -1,5 +1,5 @@
// @ts-check
-import { details, Fail } from '@agoric/assert';
+import { X, Fail } from '@endo/errors';
import { encodeBase64, decodeBase64 } from '@endo/base64';
import { isObject } from '@endo/pass-style';
@@ -23,14 +23,11 @@ export function coerceToByteSource(specimen) {
}
isObject(specimen) ||
- assert.fail(details`non-object ${specimen} is not a ByteSource`, TypeError);
+ assert.fail(X`non-object ${specimen} is not a ByteSource`, TypeError);
const obj = /** @type {{}} */ (specimen);
typeof obj[Symbol.iterator] === 'function' ||
- assert.fail(
- details`non-iterable ${specimen} is not a ByteSource`,
- TypeError,
- );
+ assert.fail(X`non-iterable ${specimen} is not a ByteSource`, TypeError);
// Good enough... it's iterable and can be converted later.
return /** @type {ByteSource} */ (specimen);
diff --git a/packages/network/src/network.js b/packages/network/src/network.js
index b4d47be7464..d6e1a3bbc86 100644
--- a/packages/network/src/network.js
+++ b/packages/network/src/network.js
@@ -2,9 +2,9 @@
///
+import { Fail } from '@endo/errors';
import { E } from '@endo/far';
import { M } from '@endo/patterns';
-import { Fail } from '@agoric/assert';
import { toBytes } from './bytes.js';
import { Shape } from './shapes.js';
diff --git a/packages/network/src/router.js b/packages/network/src/router.js
index b18d1c06407..cea73335bd2 100644
--- a/packages/network/src/router.js
+++ b/packages/network/src/router.js
@@ -3,9 +3,9 @@
///
///
+import { Fail } from '@endo/errors';
import { E as defaultE } from '@endo/far';
import { M } from '@endo/patterns';
-import { Fail } from '@agoric/assert';
import { ENDPOINT_SEPARATOR, prepareNetworkProtocol } from './network.js';
import { Shape } from './shapes.js';
diff --git a/packages/notifier/package.json b/packages/notifier/package.json
index ebe1ca9b99c..0e05299584e 100644
--- a/packages/notifier/package.json
+++ b/packages/notifier/package.json
@@ -33,7 +33,7 @@
},
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
"dependencies": {
- "@agoric/assert": "^0.6.0",
+ "@endo/errors": "^1.2.2",
"@agoric/internal": "^0.3.2",
"@agoric/vat-data": "^0.5.2",
"@endo/far": "^1.1.2",
diff --git a/packages/notifier/src/notifier.js b/packages/notifier/src/notifier.js
index 42ed192c1fa..9439bbf528f 100644
--- a/packages/notifier/src/notifier.js
+++ b/packages/notifier/src/notifier.js
@@ -1,6 +1,6 @@
///
-import { assert } from '@agoric/assert';
+import { assert } from '@endo/errors';
import { E, Far } from '@endo/far';
import { makePublishKit } from './publish-kit.js';
diff --git a/packages/notifier/src/publish-kit.js b/packages/notifier/src/publish-kit.js
index ea1d2c5f636..86a3d1f295f 100644
--- a/packages/notifier/src/publish-kit.js
+++ b/packages/notifier/src/publish-kit.js
@@ -1,17 +1,16 @@
///
-import { canBeDurable, prepareExoClassKit } from '@agoric/vat-data';
+import { Fail, q } from '@endo/errors';
import { E, Far } from '@endo/far';
-import { M, getInterfaceGuardPayload } from '@endo/patterns';
import { makePromiseKit } from '@endo/promise-kit';
+import { M, getInterfaceGuardPayload } from '@endo/patterns';
+import { canBeDurable, prepareExoClassKit } from '@agoric/vat-data';
/**
* @import {ERef} from '@endo/far';
* @import {DurablePublishKitState, DurablePublishKitValueDurability, LatestTopic, Notifier, NotifierRecord, PublicationRecord, Publisher, PublishKit, Subscriber, UpdateRecord} from '../src/types.js';
*/
-const { Fail, quote: q } = assert;
-
const sink = () => {};
const makeQuietRejection = reason => {
const rejection = harden(Promise.reject(reason));
diff --git a/packages/notifier/src/subscribe.js b/packages/notifier/src/subscribe.js
index 2265bb21fbb..c0c2aec301f 100644
--- a/packages/notifier/src/subscribe.js
+++ b/packages/notifier/src/subscribe.js
@@ -1,3 +1,4 @@
+import { X, Fail, annotateError } from '@endo/errors';
import { E, Far } from '@endo/far';
import { isObject } from '@endo/marshal';
import { isUpgradeDisconnection } from '@agoric/internal/src/upgrade-api.js';
@@ -7,7 +8,6 @@ import { isUpgradeDisconnection } from '@agoric/internal/src/upgrade-api.js';
* @import {IterationObserver, LatestTopic, Notifier, NotifierRecord, PublicationRecord, Publisher, PublishKit, StoredPublishKit, StoredSubscription, StoredSubscriber, Subscriber, Subscription, UpdateRecord, EachTopic, ForkableAsyncIterableIterator} from '../src/types.js';
*/
-const { details: X, Fail } = assert;
const sink = () => {};
/**
@@ -48,7 +48,7 @@ const reconnectAsNeeded = async (getter, seed = []) => {
// for which it is a result.
if (isObject(err) && disconnection && disconnection !== err) {
try {
- assert.note(
+ annotateError(
err,
X`Attempting to recover from disconnection: ${disconnection}`,
);
diff --git a/packages/notifier/test/map-unum.js b/packages/notifier/test/map-unum.js
index c35bc302784..a0da12b78c8 100644
--- a/packages/notifier/test/map-unum.js
+++ b/packages/notifier/test/map-unum.js
@@ -7,7 +7,7 @@
// If this experiment works out, it or something like it may eventually move
// from test/ to src/
-import { q, Fail } from '@agoric/assert';
+import { q, Fail } from '@endo/errors';
import {
makeNotifierKit,
makeSubscriptionKit,
diff --git a/packages/notifier/test/publish-kit.test.js b/packages/notifier/test/publish-kit.test.js
index 58ff9dd83f6..29b53a81d5f 100644
--- a/packages/notifier/test/publish-kit.test.js
+++ b/packages/notifier/test/publish-kit.test.js
@@ -2,6 +2,8 @@
import '@agoric/swingset-liveslots/tools/prepare-test-env.js';
import test from 'ava';
+
+import { q } from '@endo/errors';
import { E } from '@endo/far';
import {
buildKernelBundles,
@@ -25,7 +27,6 @@ import { invertPromiseSettlement } from './iterable-testing-tools.js';
*/
const { ownKeys } = Reflect;
-const { quote: q } = assert;
const bfile = name => new URL(name, import.meta.url).pathname;
diff --git a/packages/orchestration/package.json b/packages/orchestration/package.json
index 1567a6550da..d80d108a8cf 100644
--- a/packages/orchestration/package.json
+++ b/packages/orchestration/package.json
@@ -34,7 +34,6 @@
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
"dependencies": {
"@agoric/async-flow": "^0.1.0",
- "@agoric/assert": "^0.6.0",
"@agoric/cosmic-proto": "^0.4.0",
"@agoric/ertp": "^0.16.2",
"@agoric/internal": "^0.3.2",
diff --git a/packages/orchestration/src/exos/chain-account-kit.js b/packages/orchestration/src/exos/chain-account-kit.js
index f4cae4c2867..cc2e7ac1f15 100644
--- a/packages/orchestration/src/exos/chain-account-kit.js
+++ b/packages/orchestration/src/exos/chain-account-kit.js
@@ -1,9 +1,9 @@
/** @file ChainAccount exo */
-import { NonNullish } from '@agoric/assert';
-import { makeTracer } from '@agoric/internal';
-import { VowShape } from '@agoric/vow';
+import { Fail } from '@endo/errors';
import { E } from '@endo/far';
import { M } from '@endo/patterns';
+import { NonNullish, makeTracer } from '@agoric/internal';
+import { VowShape } from '@agoric/vow';
import {
ChainAddressShape,
OutboundConnectionHandlerI,
@@ -22,7 +22,6 @@ import { makeTxPacket, parseTxPacket } from '../utils/packet.js';
* @import {ChainAddress} from '../types.js';
*/
-const { Fail } = assert;
const trace = makeTracer('ChainAccountKit');
/** @typedef {'UNPARSABLE_CHAIN_ADDRESS'} UnparsableChainAddress */
diff --git a/packages/orchestration/src/exos/chain-hub.js b/packages/orchestration/src/exos/chain-hub.js
index 55a178cc610..88ae11e8a15 100644
--- a/packages/orchestration/src/exos/chain-hub.js
+++ b/packages/orchestration/src/exos/chain-hub.js
@@ -1,17 +1,17 @@
+import { Fail, makeError } from '@endo/errors';
+import { E } from '@endo/far';
+import { M } from '@endo/patterns';
+
import { VowShape } from '@agoric/vow';
// eslint-disable-next-line no-restricted-syntax
import { heapVowTools } from '@agoric/vow/vat.js';
import { makeHeapZone } from '@agoric/zone';
-import { E } from '@endo/far';
-import { M } from '@endo/patterns';
import { CosmosChainInfoShape, IBCConnectionInfoShape } from '../typeGuards.js';
// FIXME test thoroughly whether heap suffices for ChainHub
// eslint-disable-next-line no-restricted-syntax
const { allVows, watch } = heapVowTools;
-const { Fail } = assert;
-
/**
* @import {NameHub} from '@agoric/vats';
* @import {Vow} from '@agoric/vow';
@@ -143,7 +143,7 @@ export const makeChainHub = (agoricNames, zone = makeHeapZone()) => {
return chainInfo;
},
onRejected: _cause => {
- throw assert.error(`chain not found:${chainName}`);
+ throw makeError(`chain not found:${chainName}`);
},
});
},
@@ -176,7 +176,7 @@ export const makeChainHub = (agoricNames, zone = makeHeapZone()) => {
return connectionInfo;
},
onRejected: _cause => {
- throw assert.error(`connection not found: ${chainId1}<->${chainId2}`);
+ throw makeError(`connection not found: ${chainId1}<->${chainId2}`);
},
});
},
diff --git a/packages/orchestration/src/exos/cosmos-orchestration-account.js b/packages/orchestration/src/exos/cosmos-orchestration-account.js
index 2a9bed7625b..025562003ae 100644
--- a/packages/orchestration/src/exos/cosmos-orchestration-account.js
+++ b/packages/orchestration/src/exos/cosmos-orchestration-account.js
@@ -1,4 +1,7 @@
/** @file Use-object for the owner of a staking account */
+import { Fail } from '@endo/errors';
+import { decodeBase64 } from '@endo/base64';
+import { E } from '@endo/far';
import { toRequestQueryJson } from '@agoric/cosmic-proto';
import {
QueryBalanceRequest,
@@ -20,8 +23,6 @@ import { Shape as NetworkShape } from '@agoric/network';
import { M } from '@agoric/vat-data';
import { VowShape } from '@agoric/vow';
import { TopicsRecordShape } from '@agoric/zoe/src/contractSupport/index.js';
-import { decodeBase64 } from '@endo/base64';
-import { E } from '@endo/far';
import {
AmountArgShape,
ChainAddressShape,
@@ -48,7 +49,6 @@ import { dateInSeconds } from '../utils/time.js';
const trace = makeTracer('ComosOrchestrationAccountHolder');
-const { Fail } = assert;
const { Vow$ } = NetworkShape; // TODO #9611
/**
diff --git a/packages/orchestration/src/exos/icq-connection-kit.js b/packages/orchestration/src/exos/icq-connection-kit.js
index a327540b0f4..cfe78cc8ae5 100644
--- a/packages/orchestration/src/exos/icq-connection-kit.js
+++ b/packages/orchestration/src/exos/icq-connection-kit.js
@@ -1,8 +1,8 @@
/** @file ICQConnection Exo */
-import { NonNullish } from '@agoric/assert';
-import { makeTracer } from '@agoric/internal';
+import { Fail } from '@endo/errors';
import { E } from '@endo/far';
import { M } from '@endo/patterns';
+import { NonNullish, makeTracer } from '@agoric/internal';
import { makeQueryPacket, parseQueryPacket } from '../utils/packet.js';
import { OutboundConnectionHandlerI } from '../typeGuards.js';
@@ -15,7 +15,6 @@ import { OutboundConnectionHandlerI } from '../typeGuards.js';
* @import {LocalIbcAddress, RemoteIbcAddress} from '@agoric/vats/tools/ibc-utils.js';
*/
-const { Fail } = assert;
const trace = makeTracer('Orchestration:ICQConnection');
export const ICQMsgShape = M.splitRecord(
diff --git a/packages/orchestration/src/facade.js b/packages/orchestration/src/facade.js
index 9d9b21e256c..53cdd699f00 100644
--- a/packages/orchestration/src/facade.js
+++ b/packages/orchestration/src/facade.js
@@ -1,6 +1,6 @@
/** @file Orchestration service */
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import { pickFacet } from '@agoric/vat-data';
import { prepareOrchestratorKit } from './exos/orchestrator.js';
diff --git a/packages/orchestration/src/proposals/orchestration-proposal.js b/packages/orchestration/src/proposals/orchestration-proposal.js
index b9b69beb96e..815e3bc7aad 100644
--- a/packages/orchestration/src/proposals/orchestration-proposal.js
+++ b/packages/orchestration/src/proposals/orchestration-proposal.js
@@ -1,7 +1,7 @@
-import { makeTracer } from '@agoric/internal';
+import { Fail } from '@endo/errors';
import { E, Far } from '@endo/far';
import { makeMarshal } from '@endo/marshal';
-import { Fail } from '@agoric/assert';
+import { makeTracer } from '@agoric/internal';
import { registerChainNamespace } from '../chain-info.js';
import { CHAIN_KEY, CONNECTIONS_KEY } from '../exos/chain-hub.js';
diff --git a/packages/orchestration/src/service.js b/packages/orchestration/src/service.js
index 15bb84a736d..93cbf1ab7ce 100644
--- a/packages/orchestration/src/service.js
+++ b/packages/orchestration/src/service.js
@@ -1,5 +1,6 @@
/** @file Orchestration service */
+import { Fail, b } from '@endo/errors';
import { E } from '@endo/far';
import { M } from '@endo/patterns';
import { Shape as NetworkShape } from '@agoric/network';
@@ -20,7 +21,6 @@ import {
* @import {ICQConnection, IcaAccount, ICQConnectionKit, ChainAccountKit} from './types.js';
*/
-const { Fail, bare } = assert;
const { Vow$ } = NetworkShape; // TODO #9611
/**
* @typedef {object} OrchestrationPowers
@@ -48,7 +48,7 @@ const { Vow$ } = NetworkShape; // TODO #9611
* @param {K} name
*/
const getPower = (powers, name) => {
- powers.has(name) || Fail`need powers.${bare(name)} for this method`;
+ powers.has(name) || Fail`need powers.${b(name)} for this method`;
return /** @type {OrchestrationPowers[K]} */ (powers.get(name));
};
diff --git a/packages/orchestration/src/utils/address.js b/packages/orchestration/src/utils/address.js
index e423895db91..3e0c608fa50 100644
--- a/packages/orchestration/src/utils/address.js
+++ b/packages/orchestration/src/utils/address.js
@@ -1,4 +1,4 @@
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
/**
* @import {IBCConnectionID} from '@agoric/vats';
diff --git a/packages/orchestration/src/utils/cosmos.js b/packages/orchestration/src/utils/cosmos.js
index d84a2e5f033..325b3183f01 100644
--- a/packages/orchestration/src/utils/cosmos.js
+++ b/packages/orchestration/src/utils/cosmos.js
@@ -1,6 +1,6 @@
-import { assert } from '@agoric/assert';
-import { Any } from '@agoric/cosmic-proto/google/protobuf/any.js';
+import { makeError } from '@endo/errors';
import { decodeBase64, encodeBase64 } from '@endo/base64';
+import { Any } from '@agoric/cosmic-proto/google/protobuf/any.js';
/** maximum clock skew, in seconds, for unbonding time reported from other chain */
export const maxClockSkew = 10n * 60n;
@@ -31,6 +31,6 @@ export const tryDecodeResponse = (ackStr, fromProtoMsg) => {
const msg = fromProtoMsg(protoMsg);
return msg;
} catch (cause) {
- throw assert.error(`bad response: ${ackStr}`, undefined, { cause });
+ throw makeError(`bad response: ${ackStr}`, undefined, { cause });
}
};
diff --git a/packages/orchestration/test/staking-ops.test.ts b/packages/orchestration/test/staking-ops.test.ts
index b1de3fc4b82..88e2ebf4591 100644
--- a/packages/orchestration/test/staking-ops.test.ts
+++ b/packages/orchestration/test/staking-ops.test.ts
@@ -1,5 +1,6 @@
import { test } from '@agoric/zoe/tools/prepare-test-env-ava.js';
+import { Fail } from '@endo/errors';
import type { AnyJson } from '@agoric/cosmic-proto';
import type { Coin } from '@agoric/cosmic-proto/cosmos/base/v1beta1/coin.js';
import { MsgWithdrawDelegatorRewardResponse } from '@agoric/cosmic-proto/cosmos/distribution/v1beta1/tx.js';
@@ -25,8 +26,6 @@ import { prepareCosmosOrchestrationAccountKit } from '../src/exos/cosmos-orchest
import type { ChainAddress, IcaAccount, ICQConnection } from '../src/types.js';
import { encodeTxResponse } from '../src/utils/cosmos.js';
-const { Fail } = assert;
-
const trivialDelegateResponse = encodeTxResponse(
{},
MsgDelegateResponse.toProtoMsg,
diff --git a/packages/pegasus/package.json b/packages/pegasus/package.json
index c4145c6194c..24328ef4325 100644
--- a/packages/pegasus/package.json
+++ b/packages/pegasus/package.json
@@ -28,7 +28,7 @@
},
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
"dependencies": {
- "@agoric/assert": "^0.6.0",
+ "@endo/errors": "^1.2.2",
"@agoric/ertp": "^0.16.2",
"@agoric/internal": "^0.3.2",
"@agoric/network": "^0.1.0",
diff --git a/packages/pegasus/src/courier.js b/packages/pegasus/src/courier.js
index fcee1c5b7d7..7397d8a6dcd 100644
--- a/packages/pegasus/src/courier.js
+++ b/packages/pegasus/src/courier.js
@@ -1,5 +1,5 @@
// @ts-check
-import { details as X } from '@agoric/assert';
+import { X } from '@endo/errors';
import { AmountMath } from '@agoric/ertp';
import { WalletName } from '@agoric/internal';
diff --git a/packages/pegasus/src/ibc-trace.js b/packages/pegasus/src/ibc-trace.js
index 1a075156c33..2460027ba17 100644
--- a/packages/pegasus/src/ibc-trace.js
+++ b/packages/pegasus/src/ibc-trace.js
@@ -1,6 +1,6 @@
// @ts-check
+import { Fail } from '@endo/errors';
import { Far } from '@endo/far';
-import { Fail } from '@agoric/assert';
import { parse } from '@agoric/network';
diff --git a/packages/pegasus/src/ics20.js b/packages/pegasus/src/ics20.js
index df96c2d8f4c..cd273368d86 100644
--- a/packages/pegasus/src/ics20.js
+++ b/packages/pegasus/src/ics20.js
@@ -1,7 +1,7 @@
// @ts-check
+import { assert, X, Fail, annotateError } from '@endo/errors';
import { Nat } from '@endo/nat';
import { Far } from '@endo/far';
-import { assert, details as X, Fail } from '@agoric/assert';
/**
* @typedef {object} ICS20TransferPacket Packet shape defined at:
@@ -30,7 +30,7 @@ const safeJSONParseObject = s => {
try {
obj = JSON.parse(s);
} catch (e) {
- assert.note(e, X`${s} is not valid JSON`);
+ annotateError(e, X`${s} is not valid JSON`);
throw e;
}
if (typeof obj !== 'object') {
diff --git a/packages/pegasus/src/once-promise-kit.js b/packages/pegasus/src/once-promise-kit.js
index ce50980cd7e..dbfcb355eb0 100644
--- a/packages/pegasus/src/once-promise-kit.js
+++ b/packages/pegasus/src/once-promise-kit.js
@@ -1,7 +1,17 @@
// @ts-check
-import { assert } from '@agoric/assert';
+import { assert } from '@endo/errors';
import { makePromiseKit } from '@endo/promise-kit';
+/**
+ * Should be
+ * at-import {DetailsToken} from '@endo/errors'
+ * but somehow @endo/errors is not exporting that type.
+ * See https://github.com/endojs/endo/issues/2339
+ * In the meantime...
+ *
+ * @typedef {{}} DetailsToken
+ */
+
/**
* Create a promise kit that will throw an exception if it is resolved or
* rejected more than once.
diff --git a/packages/pegasus/src/pegasus.js b/packages/pegasus/src/pegasus.js
index e73014804cc..d96a2b1dd1b 100644
--- a/packages/pegasus/src/pegasus.js
+++ b/packages/pegasus/src/pegasus.js
@@ -1,6 +1,6 @@
// @ts-check
-import { assert, details as X, Fail } from '@agoric/assert';
+import { assert, X, Fail, makeError } from '@endo/errors';
import { makeLegacyWeakMap, makeLegacyMap } from '@agoric/store';
import { E, Far } from '@endo/far';
import {
@@ -147,7 +147,7 @@ export const makePegasus = ({ zcf, board, namesByAddress, when }) => {
// handled it correctly and that flow doesn't need to trigger an
// additional UnhandledRejectionWarning in our vat.
promise.catch(() => {});
- reject(assert.error(X`${receiveDenom} is temporarily unavailable`));
+ reject(makeError(X`${receiveDenom} is temporarily unavailable`));
// Allow new transfers to be initiated after this rejection.
receiveDenomToCourierPK.delete(receiveDenom);
@@ -427,7 +427,7 @@ export const makePegasus = ({ zcf, board, namesByAddress, when }) => {
abort,
} = connectionToLocalDenomState.get(c);
connectionToLocalDenomState.delete(c);
- const err = assert.error(X`pegasusConnectionHandler closed`);
+ const err = makeError(X`pegasusConnectionHandler closed`);
receiveDenomPublication.fail(err);
/** @type {PegasusConnection} */
const state = harden({
diff --git a/packages/smart-wallet/package.json b/packages/smart-wallet/package.json
index e1bca3a44d9..8720c2b43fd 100644
--- a/packages/smart-wallet/package.json
+++ b/packages/smart-wallet/package.json
@@ -26,7 +26,7 @@
"import-meta-resolve": "^2.2.1"
},
"dependencies": {
- "@agoric/assert": "^0.6.0",
+ "@endo/errors": "^1.2.2",
"@agoric/casting": "^0.4.2",
"@agoric/ertp": "^0.16.2",
"@agoric/internal": "^0.3.2",
diff --git a/packages/smart-wallet/src/invitations.js b/packages/smart-wallet/src/invitations.js
index d877225d87e..75243d55b1f 100644
--- a/packages/smart-wallet/src/invitations.js
+++ b/packages/smart-wallet/src/invitations.js
@@ -1,11 +1,10 @@
+import { Fail } from '@endo/errors';
+import { E } from '@endo/far';
import { AmountMath } from '@agoric/ertp';
import { mustMatch } from '@agoric/store';
import { InvitationHandleShape } from '@agoric/zoe/src/typeGuards.js';
-import { E } from '@endo/far';
import { shape } from './typeGuards.js';
-const { Fail } = assert;
-
// A safety limit
const MAX_PIPE_LENGTH = 2;
diff --git a/packages/smart-wallet/src/marshal-contexts.js b/packages/smart-wallet/src/marshal-contexts.js
index d5303ff39af..2c6442aff03 100644
--- a/packages/smart-wallet/src/marshal-contexts.js
+++ b/packages/smart-wallet/src/marshal-contexts.js
@@ -1,11 +1,11 @@
// @ts-check
+import { Fail, q } from '@endo/errors';
+import { HandledPromise } from '@endo/eventual-send'; // TODO: convince tsc this isn't needed
+
import { makeScalarMapStore } from '@agoric/store';
import { Far, makeMarshal, Remotable } from '@endo/marshal';
-import { HandledPromise } from '@endo/eventual-send'; // TODO: convince tsc this isn't needed
import { DEFAULT_PREFIX } from '@agoric/vats/src/lib-board.js';
-const { Fail, quote: q } = assert;
-
/**
* @import {PassableCap, RemotableObject} from '@endo/marshal';
* @import {Key} from '@endo/patterns';
diff --git a/packages/smart-wallet/src/proposals/upgrade-walletFactory-proposal.js b/packages/smart-wallet/src/proposals/upgrade-walletFactory-proposal.js
index ea3e3e81826..7fd6db38760 100644
--- a/packages/smart-wallet/src/proposals/upgrade-walletFactory-proposal.js
+++ b/packages/smart-wallet/src/proposals/upgrade-walletFactory-proposal.js
@@ -1,12 +1,11 @@
// @ts-check
+import { Fail } from '@endo/errors';
import { E } from '@endo/far';
import { makeMarshal } from '@endo/marshal';
import { allValues } from '@agoric/internal';
console.warn('upgrade-walletFactory-proposal.js module evaluating');
-const { Fail } = assert;
-
// vstorage paths under published.*
const WALLET_STORAGE_PATH_SEGMENT = 'wallet';
const BOARD_AUX = 'boardAux';
diff --git a/packages/smart-wallet/src/smartWallet.js b/packages/smart-wallet/src/smartWallet.js
index 453ad6caf18..6953189257e 100644
--- a/packages/smart-wallet/src/smartWallet.js
+++ b/packages/smart-wallet/src/smartWallet.js
@@ -1,3 +1,4 @@
+import { Fail, q } from '@endo/errors';
import { E } from '@endo/far';
import {
AmountShape,
@@ -44,8 +45,6 @@ import { prepareOfferWatcher, watchOfferOutcomes } from './offerWatcher.js';
/** @import {OfferId, OfferStatus} from './offers.js'; */
-const { Fail, quote: q } = assert;
-
const trace = makeTracer('SmrtWlt');
/**
diff --git a/packages/smart-wallet/test/addAsset.test.js b/packages/smart-wallet/test/addAsset.test.js
index 89658d70f82..4effbf96878 100644
--- a/packages/smart-wallet/test/addAsset.test.js
+++ b/packages/smart-wallet/test/addAsset.test.js
@@ -1,20 +1,20 @@
// @ts-check
import { test as anyTest } from '@agoric/zoe/tools/prepare-test-env-ava.js';
+
+import { Fail } from '@endo/errors';
import { E, Far } from '@endo/far';
-import { AmountMath, makeIssuerKit } from '@agoric/ertp';
-import { eventLoopIteration } from '@agoric/internal/src/testing-utils.js';
-import { makeCopyBag } from '@agoric/store';
import { makePromiseKit } from '@endo/promise-kit';
import bundleSource from '@endo/bundle-source';
import { makeMarshal } from '@endo/marshal';
+import { AmountMath, makeIssuerKit } from '@agoric/ertp';
+import { eventLoopIteration } from '@agoric/internal/src/testing-utils.js';
+import { makeCopyBag } from '@agoric/store';
import { resolve as importMetaResolve } from 'import-meta-resolve';
import { makeFakeBankManagerKit } from '@agoric/vats/tools/bank-utils.js';
import { makeDefaultTestContext } from './contexts.js';
import { ActionType, headValue, makeMockTestSpace } from './supports.js';
import { makeImportContext } from '../src/marshal-contexts.js';
-const { Fail } = assert;
-
const importSpec = spec =>
importMetaResolve(spec, import.meta.url).then(u => new URL(u).pathname);
diff --git a/packages/smart-wallet/test/devices.js b/packages/smart-wallet/test/devices.js
index 1718fa3ed66..a25511e8eed 100644
--- a/packages/smart-wallet/test/devices.js
+++ b/packages/smart-wallet/test/devices.js
@@ -1,4 +1,4 @@
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import centralSupply from '@agoric/vats/bundles/bundle-centralSupply.js';
import mintHolder from '@agoric/vats/bundles/bundle-mintHolder.js';
import provisionPool from '@agoric/vats/bundles/bundle-provisionPool.js';
diff --git a/packages/smart-wallet/test/gameAssetContract.js b/packages/smart-wallet/test/gameAssetContract.js
index f2d6c68363d..356ec3f4236 100644
--- a/packages/smart-wallet/test/gameAssetContract.js
+++ b/packages/smart-wallet/test/gameAssetContract.js
@@ -1,13 +1,13 @@
/** @file illustrates using non-vbank assets */
// deep import to avoid dependency on all of ERTP, vat-data
+import { Fail, q } from '@endo/errors';
+import { E, Far } from '@endo/far';
+
import { AmountShape } from '@agoric/ertp/src/typeGuards.js';
import { AmountMath, AssetKind } from '@agoric/ertp/src/amountMath.js';
import { makeTracer } from '@agoric/internal';
import { M, getCopyBagEntries } from '@agoric/store';
-import { E, Far } from '@endo/far';
-
-const { Fail, quote: q } = assert;
const trace = makeTracer('Game', true);
diff --git a/packages/smart-wallet/test/start-game1-proposal.js b/packages/smart-wallet/test/start-game1-proposal.js
index 2cc662bd745..0cf619bf942 100644
--- a/packages/smart-wallet/test/start-game1-proposal.js
+++ b/packages/smart-wallet/test/start-game1-proposal.js
@@ -1,12 +1,11 @@
// @ts-check
+import { Fail } from '@endo/errors';
import { E } from '@endo/far';
import { makeMarshal } from '@endo/marshal';
import { AmountMath } from '@agoric/ertp/src/amountMath.js';
console.warn('start-game1-proposal.js module evaluating');
-const { Fail } = assert;
-
// vstorage paths under published.*
const BOARD_AUX = 'boardAux';
diff --git a/packages/smart-wallet/test/supports.js b/packages/smart-wallet/test/supports.js
index f929e42831a..c02c11b3b5b 100644
--- a/packages/smart-wallet/test/supports.js
+++ b/packages/smart-wallet/test/supports.js
@@ -1,4 +1,4 @@
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import { AmountMath, makeIssuerKit } from '@agoric/ertp';
import * as ActionType from '@agoric/internal/src/action-types.js';
import { makeMockChainStorageRoot } from '@agoric/internal/src/storage-test-utils.js';
diff --git a/packages/smart-wallet/test/swingsetTests/upgradeWalletFactory/bootstrap-walletFactory-service-upgrade.js b/packages/smart-wallet/test/swingsetTests/upgradeWalletFactory/bootstrap-walletFactory-service-upgrade.js
index 9a556dd926e..4557a4cc954 100644
--- a/packages/smart-wallet/test/swingsetTests/upgradeWalletFactory/bootstrap-walletFactory-service-upgrade.js
+++ b/packages/smart-wallet/test/swingsetTests/upgradeWalletFactory/bootstrap-walletFactory-service-upgrade.js
@@ -1,5 +1,5 @@
// @ts-check
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import { AmountMath, makeIssuerKit } from '@agoric/ertp';
import { makeTracer } from '@agoric/internal';
import { makeFakeStorageKit } from '@agoric/internal/src/storage-test-utils.js';
diff --git a/packages/smart-wallet/test/swingsetTests/upgradeWalletFactory/walletFactory-service-upgrade.test.js b/packages/smart-wallet/test/swingsetTests/upgradeWalletFactory/walletFactory-service-upgrade.test.js
index 84bb0a9bc2e..53fd7ec8db0 100644
--- a/packages/smart-wallet/test/swingsetTests/upgradeWalletFactory/walletFactory-service-upgrade.test.js
+++ b/packages/smart-wallet/test/swingsetTests/upgradeWalletFactory/walletFactory-service-upgrade.test.js
@@ -1,6 +1,6 @@
import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava.js';
-import { assert } from '@agoric/assert';
+import { assert } from '@endo/errors';
import { resolve as importMetaResolve } from 'import-meta-resolve';
import { buildVatController } from '@agoric/swingset-vat';
diff --git a/packages/solo/package.json b/packages/solo/package.json
index 90d2ed14525..49c99ac28c1 100644
--- a/packages/solo/package.json
+++ b/packages/solo/package.json
@@ -23,7 +23,7 @@
"license": "Apache-2.0",
"dependencies": {
"@agoric/access-token": "^0.4.21",
- "@agoric/assert": "^0.6.0",
+ "@endo/errors": "^1.2.2",
"@agoric/cache": "^0.3.2",
"@agoric/cosmic-swingset": "^0.41.3",
"@agoric/internal": "^0.3.2",
diff --git a/packages/solo/src/add-chain.js b/packages/solo/src/add-chain.js
index cf549cdd1f8..39aab2f9b3a 100644
--- a/packages/solo/src/add-chain.js
+++ b/packages/solo/src/add-chain.js
@@ -5,7 +5,7 @@ import djson from 'deterministic-json';
import path from 'path';
import fs from 'fs';
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import setGCIIngress from './set-gci-ingress.js';
const DEFAULT_CHAIN_CONFIG = 'https://testnet.agoric.com/network-config';
diff --git a/packages/solo/src/chain-cosmos-sdk.js b/packages/solo/src/chain-cosmos-sdk.js
index 9210a513c01..8b27bbaa2fb 100644
--- a/packages/solo/src/chain-cosmos-sdk.js
+++ b/packages/solo/src/chain-cosmos-sdk.js
@@ -8,10 +8,10 @@ import { open as tempOpen } from 'temp';
import WebSocket from 'ws';
import anylogger from 'anylogger';
-import { makeNotifierKit } from '@agoric/notifier';
+import { Fail, makeError } from '@endo/errors';
import { makePromiseKit } from '@endo/promise-kit';
-import { assert, Fail } from '@agoric/assert';
+import { makeNotifierKit } from '@agoric/notifier';
import {
DEFAULT_BATCH_TIMEOUT_MS,
makeBatchedDeliver,
@@ -697,13 +697,13 @@ ${chainID} chain does not yet know of address ${clientAddr}${adviseEgress(
if (txResult.code) {
// eslint-disable-next-line no-use-before-define
failedSend(
- assert.error(`Error in tx processing: ${txResult.log}`),
+ makeError(`Error in tx processing: ${txResult.log}`),
);
}
})
.catch(err =>
// eslint-disable-next-line no-use-before-define
- failedSend(assert.error(`Error in tx processing: ${err}`)),
+ failedSend(makeError(`Error in tx processing: ${err}`)),
);
// We submitted the transaction to the mempool successfully.
diff --git a/packages/solo/src/init-basedir.js b/packages/solo/src/init-basedir.js
index 2064447501f..7ad5d072c36 100644
--- a/packages/solo/src/init-basedir.js
+++ b/packages/solo/src/init-basedir.js
@@ -4,7 +4,7 @@ import fs from 'fs';
import path from 'path';
import { execFileSync } from 'child_process';
-import { assert, details as X } from '@agoric/assert';
+import { assert, X } from '@endo/errors';
import anylogger from 'anylogger';
import { HELPER } from './chain-cosmos-sdk.js';
diff --git a/packages/solo/src/main.js b/packages/solo/src/main.js
index 9dc2dea2ab8..7d9fd993af1 100644
--- a/packages/solo/src/main.js
+++ b/packages/solo/src/main.js
@@ -3,7 +3,7 @@ import path from 'path';
import parseArgs from 'minimist';
import process from 'process';
import { spawnSync } from 'child_process';
-import { assert } from '@agoric/assert';
+import { assert } from '@endo/errors';
import anylogger from 'anylogger';
diff --git a/packages/solo/src/outbound.js b/packages/solo/src/outbound.js
index b504965ef7d..8d6d3a2370e 100644
--- a/packages/solo/src/outbound.js
+++ b/packages/solo/src/outbound.js
@@ -1,7 +1,7 @@
/* global process */
import anylogger from 'anylogger';
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
// Limit the debug log length.
const SOLO_MAX_DEBUG_LENGTH =
diff --git a/packages/solo/src/pipe-entrypoint.js b/packages/solo/src/pipe-entrypoint.js
index 81781f78f9d..54266764b35 100644
--- a/packages/solo/src/pipe-entrypoint.js
+++ b/packages/solo/src/pipe-entrypoint.js
@@ -3,8 +3,9 @@
import '@endo/init/pre-bundle-source.js';
import '@endo/init/unsafe-fast.js';
-import { parse, stringify } from '@endo/marshal';
+import { makeError } from '@endo/errors';
import { makePromiseKit } from '@endo/promise-kit';
+import { parse, stringify } from '@endo/marshal';
import '@agoric/cosmic-swingset/src/anylogger-agoric.js';
import { connectToFakeChain } from '@agoric/cosmic-swingset/src/sim-chain.js';
@@ -52,7 +53,7 @@ const main = async () => {
break;
}
default: {
- assert.error(`unknown method ${method}`);
+ makeError(`unknown method ${method}`);
}
}
diff --git a/packages/solo/src/start.js b/packages/solo/src/start.js
index cf2237c2662..d138d35d742 100644
--- a/packages/solo/src/start.js
+++ b/packages/solo/src/start.js
@@ -16,7 +16,7 @@ import anylogger from 'anylogger';
// import connect from 'lotion-connect';
// import djson from 'deterministic-json';
-import { assert, Fail } from '@agoric/assert';
+import { assert, Fail } from '@endo/errors';
import { makeSlogSender, tryFlushSlogSender } from '@agoric/telemetry';
import {
loadSwingsetConfigFile,
diff --git a/packages/solo/src/vat-http.js b/packages/solo/src/vat-http.js
index bfa410ffcba..6f6b2b93653 100644
--- a/packages/solo/src/vat-http.js
+++ b/packages/solo/src/vat-http.js
@@ -1,10 +1,11 @@
-import { makeNotifierKit } from '@agoric/notifier';
-import { makeCache } from '@agoric/cache';
+import { Fail } from '@endo/errors';
import { E } from '@endo/eventual-send';
+import { makePromiseKit } from '@endo/promise-kit';
import { Far } from '@endo/marshal';
-import { Fail } from '@agoric/assert';
+
+import { makeNotifierKit } from '@agoric/notifier';
+import { makeCache } from '@agoric/cache';
import { getReplHandler } from '@agoric/vats/src/repl.js';
-import { makePromiseKit } from '@endo/promise-kit';
import { getCapTPHandler } from './captp.js';
// This vat contains the HTTP request handler.
diff --git a/packages/spawner/package.json b/packages/spawner/package.json
index a1adaccfa44..a284d4d537c 100644
--- a/packages/spawner/package.json
+++ b/packages/spawner/package.json
@@ -31,7 +31,7 @@
},
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
"dependencies": {
- "@agoric/assert": "^0.6.0",
+ "@endo/errors": "^1.2.2",
"@endo/eventual-send": "^1.2.2",
"@endo/import-bundle": "^1.1.2",
"@endo/marshal": "^1.5.0"
diff --git a/packages/spawner/src/contractHost.js b/packages/spawner/src/contractHost.js
index 7971e4e728f..84b6461d63f 100644
--- a/packages/spawner/src/contractHost.js
+++ b/packages/spawner/src/contractHost.js
@@ -1,7 +1,7 @@
// Copyright (C) 2019 Agoric, under Apache License 2.0
+import { assert } from '@endo/errors';
import { E } from '@endo/eventual-send';
-import { assert } from '@agoric/assert';
import { Far } from '@endo/marshal';
// spawnBundle is built with 'yarn build'
diff --git a/packages/spawner/test/swingsetTests/contractHost/bootstrap.js b/packages/spawner/test/swingsetTests/contractHost/bootstrap.js
index 573c1297125..a4773a1e6d7 100644
--- a/packages/spawner/test/swingsetTests/contractHost/bootstrap.js
+++ b/packages/spawner/test/swingsetTests/contractHost/bootstrap.js
@@ -1,7 +1,7 @@
// Copyright (C) 2019 Agoric, under Apache License 2.0
+import { Fail } from '@endo/errors';
import { E } from '@endo/eventual-send';
-import { Fail } from '@agoric/assert';
import { Far } from '@endo/marshal';
export function buildRootObject(vatPowers, vatParameters) {
diff --git a/packages/stat-logger/package.json b/packages/stat-logger/package.json
index 323b0030bea..d0db79beda8 100644
--- a/packages/stat-logger/package.json
+++ b/packages/stat-logger/package.json
@@ -15,6 +15,9 @@
"lint-fix": "yarn lint:eslint --fix",
"lint:eslint": "eslint ."
},
+ "dependencies": {
+ "@endo/errors": "^1.2.2"
+ },
"peerDependencies": {
"canvas": "^2.6.1",
"vega": "^5.22.1",
diff --git a/packages/stat-logger/src/statGraph.js b/packages/stat-logger/src/statGraph.js
index c85805ed3f0..800aae4a95c 100644
--- a/packages/stat-logger/src/statGraph.js
+++ b/packages/stat-logger/src/statGraph.js
@@ -2,7 +2,7 @@
import fs from 'fs';
import path from 'path';
-const { Fail } = assert;
+import { Fail } from '@endo/errors';
function scanMax(filePath, fields) {
const lines = fs.readFileSync(filePath, { encoding: 'utf8' }).split('\n');
diff --git a/packages/store/package.json b/packages/store/package.json
index 6f3f52aabab..1f1b530638c 100644
--- a/packages/store/package.json
+++ b/packages/store/package.json
@@ -30,6 +30,7 @@
},
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
"dependencies": {
+ "@endo/errors": "^1.2.2",
"@endo/exo": "^1.5.0",
"@endo/marshal": "^1.5.0",
"@endo/pass-style": "^1.4.0",
diff --git a/packages/store/src/legacy/legacyMap.js b/packages/store/src/legacy/legacyMap.js
index 6c07685c9fa..15ec3d29720 100644
--- a/packages/store/src/legacy/legacyMap.js
+++ b/packages/store/src/legacy/legacyMap.js
@@ -1,7 +1,7 @@
/** @import {LegacyMap, LegacyWeakMap} from '../types.js'; */
// TODO, once migrated to endo, import from @endo/errors instead
-const { Fail, quote: q } = assert;
+import { Fail, q } from '@endo/errors';
/**
* This module and its fraternal sibling legacyWeakMap exist only to ease a
diff --git a/packages/store/src/legacy/legacyWeakMap.js b/packages/store/src/legacy/legacyWeakMap.js
index 56ff91718b3..fba9ecf696b 100644
--- a/packages/store/src/legacy/legacyWeakMap.js
+++ b/packages/store/src/legacy/legacyWeakMap.js
@@ -1,7 +1,7 @@
/** @import {LegacyWeakMap} from '../types.js'; */
// TODO, once migrated to endo, import from @endo/errors instead
-const { Fail, quote: q } = assert;
+import { Fail, q } from '@endo/errors';
/**
* See doccomment in the closely related `legacyMap.js` module.
diff --git a/packages/store/src/stores/scalarMapStore.js b/packages/store/src/stores/scalarMapStore.js
index 6847800b33c..2a9cf63cd18 100644
--- a/packages/store/src/stores/scalarMapStore.js
+++ b/packages/store/src/stores/scalarMapStore.js
@@ -1,3 +1,4 @@
+import { q } from '@endo/errors';
import {
Far,
assertPassable,
@@ -21,8 +22,6 @@ import { makeCurrentKeysKit } from './store-utils.js';
* @import {MapStore, MapStoreMethods, StoreOptions} from '../types.js';
*/
-const { quote: q } = assert;
-
/**
* @template {Key} K
* @template {Passable} V
diff --git a/packages/store/src/stores/scalarSetStore.js b/packages/store/src/stores/scalarSetStore.js
index 5f4756fc628..e49b4edf077 100644
--- a/packages/store/src/stores/scalarSetStore.js
+++ b/packages/store/src/stores/scalarSetStore.js
@@ -1,3 +1,4 @@
+import { q } from '@endo/errors';
import { Far, filterIterable } from '@endo/pass-style';
import { compareRank } from '@endo/marshal';
import {
@@ -15,8 +16,6 @@ import { makeCurrentKeysKit } from './store-utils.js';
* @import {SetStore, SetStoreMethods, StoreOptions} from '../types.js';
*/
-const { quote: q } = assert;
-
/**
* @template {Key} K
* @param {Set} jsset
diff --git a/packages/store/src/stores/scalarWeakMapStore.js b/packages/store/src/stores/scalarWeakMapStore.js
index 6bf46df0cbc..3f9af270ace 100644
--- a/packages/store/src/stores/scalarWeakMapStore.js
+++ b/packages/store/src/stores/scalarWeakMapStore.js
@@ -1,3 +1,4 @@
+import { q, Fail } from '@endo/errors';
import { Far, assertPassable, passStyleOf } from '@endo/pass-style';
import {
getCopyMapEntries,
@@ -12,8 +13,6 @@ import {
* @import {WeakMapStore, StoreOptions} from '../types.js';
*/
-const { quote: q, Fail } = assert;
-
/**
* @template {Key} K
* @template {Passable} V
diff --git a/packages/store/src/stores/scalarWeakSetStore.js b/packages/store/src/stores/scalarWeakSetStore.js
index cc5762b4785..bc06011279c 100644
--- a/packages/store/src/stores/scalarWeakSetStore.js
+++ b/packages/store/src/stores/scalarWeakSetStore.js
@@ -1,3 +1,4 @@
+import { q, Fail } from '@endo/errors';
import { Far, passStyleOf } from '@endo/pass-style';
import {
getCopySetKeys,
@@ -6,8 +7,6 @@ import {
isCopySet,
} from '@endo/patterns';
-const { quote: q, Fail } = assert;
-
/**
* @import {Key} from '@endo/patterns';
* @import {StoreOptions, WeakSetStore, WeakSetStoreMethods} from '@agoric/store';
diff --git a/packages/store/src/stores/store-utils.js b/packages/store/src/stores/store-utils.js
index 77ca084ee42..692c18a9323 100644
--- a/packages/store/src/stores/store-utils.js
+++ b/packages/store/src/stores/store-utils.js
@@ -1,3 +1,4 @@
+import { Fail, q } from '@endo/errors';
import { Far } from '@endo/marshal';
import { M, matches } from '@endo/patterns';
@@ -8,8 +9,6 @@ import { M, matches } from '@endo/patterns';
* @import {Key} from '@endo/patterns';
*/
-const { Fail, quote: q } = assert;
-
// TODO: Undate `@endo/patterns` to export the original, and delete the
// reimplementation here.
/**
diff --git a/packages/swing-store/package.json b/packages/swing-store/package.json
index a1972774c41..ac7ce9a749a 100644
--- a/packages/swing-store/package.json
+++ b/packages/swing-store/package.json
@@ -21,7 +21,7 @@
"lint:eslint": "eslint ."
},
"dependencies": {
- "@agoric/assert": "^0.6.0",
+ "@endo/errors": "^1.2.2",
"@agoric/internal": "^0.3.2",
"@endo/base64": "^1.0.5",
"@endo/bundle-source": "^3.2.3",
diff --git a/packages/swing-store/src/bundleStore.js b/packages/swing-store/src/bundleStore.js
index 6482d696757..ebabd352e59 100644
--- a/packages/swing-store/src/bundleStore.js
+++ b/packages/swing-store/src/bundleStore.js
@@ -2,10 +2,10 @@
import { createHash } from 'crypto';
import { Readable } from 'stream';
import { Buffer } from 'buffer';
+import { Fail, q } from '@endo/errors';
import { encodeBase64, decodeBase64 } from '@endo/base64';
import { checkBundle } from '@endo/check-bundle/lite.js';
import { Nat } from '@endo/nat';
-import { Fail, q } from '@agoric/assert';
import { createSHA256 } from './hasher.js';
/**
diff --git a/packages/swing-store/src/exporter.js b/packages/swing-store/src/exporter.js
index 87590835c29..7e9a745f25f 100644
--- a/packages/swing-store/src/exporter.js
+++ b/packages/swing-store/src/exporter.js
@@ -1,6 +1,6 @@
import sqlite3 from 'better-sqlite3';
-import { Fail, q } from '@agoric/assert';
+import { Fail, q } from '@endo/errors';
import { dbFileInDirectory } from './util.js';
import { getKeyType } from './kvStore.js';
diff --git a/packages/swing-store/src/hasher.js b/packages/swing-store/src/hasher.js
index 17153494b35..384425517e5 100644
--- a/packages/swing-store/src/hasher.js
+++ b/packages/swing-store/src/hasher.js
@@ -1,4 +1,4 @@
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import { createHash } from 'crypto';
diff --git a/packages/swing-store/src/importer.js b/packages/swing-store/src/importer.js
index 8b13bfbaddb..4fb1af6b4f6 100644
--- a/packages/swing-store/src/importer.js
+++ b/packages/swing-store/src/importer.js
@@ -1,4 +1,4 @@
-import { Fail, q } from '@agoric/assert';
+import { Fail, q } from '@endo/errors';
import { makeSwingStore } from './swingStore.js';
import { buffer } from './util.js';
diff --git a/packages/swing-store/src/internal.js b/packages/swing-store/src/internal.js
index 890c04b02d3..6abc2485e6d 100644
--- a/packages/swing-store/src/internal.js
+++ b/packages/swing-store/src/internal.js
@@ -1,4 +1,4 @@
-import { Fail, q } from '@agoric/assert';
+import { Fail, q } from '@endo/errors';
/**
* @typedef { import('./snapStore.js').SnapStoreInternal } SnapStoreInternal
diff --git a/packages/swing-store/src/kvStore.js b/packages/swing-store/src/kvStore.js
index bf3e80e740c..646aaf3ae1c 100644
--- a/packages/swing-store/src/kvStore.js
+++ b/packages/swing-store/src/kvStore.js
@@ -1,5 +1,5 @@
// @ts-check
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
/**
* @typedef {{
diff --git a/packages/swing-store/src/repairMetadata.js b/packages/swing-store/src/repairMetadata.js
index 1e40498c30c..dc570dca659 100644
--- a/packages/swing-store/src/repairMetadata.js
+++ b/packages/swing-store/src/repairMetadata.js
@@ -1,4 +1,4 @@
-import { Fail, q } from '@agoric/assert';
+import { Fail, q } from '@endo/errors';
import { assertComplete } from './assertComplete.js';
/**
diff --git a/packages/swing-store/src/snapStore.js b/packages/swing-store/src/snapStore.js
index 60ae903d899..c96a49c0343 100644
--- a/packages/swing-store/src/snapStore.js
+++ b/packages/swing-store/src/snapStore.js
@@ -3,7 +3,7 @@ import { createHash } from 'crypto';
import { finished as finishedCallback, PassThrough, Readable } from 'stream';
import { promisify } from 'util';
import { createGzip, createGunzip } from 'zlib';
-import { Fail, q } from '@agoric/assert';
+import { Fail, q } from '@endo/errors';
import {
aggregateTryFinally,
PromiseAllOrErrors,
diff --git a/packages/swing-store/src/swingStore.js b/packages/swing-store/src/swingStore.js
index 8201d75b441..ccf9c200687 100644
--- a/packages/swing-store/src/swingStore.js
+++ b/packages/swing-store/src/swingStore.js
@@ -5,7 +5,7 @@ import * as path from 'path';
import sqlite3 from 'better-sqlite3';
-import { Fail, q } from '@agoric/assert';
+import { Fail, q } from '@endo/errors';
import { dbFileInDirectory } from './util.js';
import { makeKVStore, getKeyType } from './kvStore.js';
diff --git a/packages/swing-store/src/transcriptStore.js b/packages/swing-store/src/transcriptStore.js
index b3797d73ec3..adbcb71e5d1 100644
--- a/packages/swing-store/src/transcriptStore.js
+++ b/packages/swing-store/src/transcriptStore.js
@@ -1,7 +1,7 @@
// @ts-check
import { Readable } from 'stream';
import { Buffer } from 'buffer';
-import { Fail, q } from '@agoric/assert';
+import { Fail, q } from '@endo/errors';
import BufferLineTransform from '@agoric/internal/src/node/buffer-line-transform.js';
import { createSHA256 } from './hasher.js';
diff --git a/packages/swingset-liveslots/package.json b/packages/swingset-liveslots/package.json
index a9a58537640..82706c32f80 100644
--- a/packages/swingset-liveslots/package.json
+++ b/packages/swingset-liveslots/package.json
@@ -17,7 +17,7 @@
"lint:eslint": "eslint ."
},
"dependencies": {
- "@agoric/assert": "^0.6.0",
+ "@endo/errors": "^1.2.2",
"@agoric/internal": "^0.3.2",
"@agoric/store": "^0.9.2",
"@endo/env-options": "^1.1.4",
diff --git a/packages/swingset-liveslots/src/cache.js b/packages/swingset-liveslots/src/cache.js
index f0129b1ccd4..8c484267223 100644
--- a/packages/swingset-liveslots/src/cache.js
+++ b/packages/swingset-liveslots/src/cache.js
@@ -1,4 +1,4 @@
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
/**
* @template V
diff --git a/packages/swingset-liveslots/src/capdata.js b/packages/swingset-liveslots/src/capdata.js
index 2514cfd75d7..bdb9013b81d 100644
--- a/packages/swingset-liveslots/src/capdata.js
+++ b/packages/swingset-liveslots/src/capdata.js
@@ -1,4 +1,4 @@
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
/**
* Assert function to ensure that something expected to be a capdata object
diff --git a/packages/swingset-liveslots/src/collectionManager.js b/packages/swingset-liveslots/src/collectionManager.js
index 178514988f8..8aa7ddd6e57 100644
--- a/packages/swingset-liveslots/src/collectionManager.js
+++ b/packages/swingset-liveslots/src/collectionManager.js
@@ -1,4 +1,4 @@
-import { assert, q, Fail } from '@agoric/assert';
+import { assert, q, Fail } from '@endo/errors';
import { Far, passStyleOf } from '@endo/far';
import {
zeroPad,
diff --git a/packages/swingset-liveslots/src/facetiousness.js b/packages/swingset-liveslots/src/facetiousness.js
index bd48e206b28..c58b966a3b2 100644
--- a/packages/swingset-liveslots/src/facetiousness.js
+++ b/packages/swingset-liveslots/src/facetiousness.js
@@ -1,4 +1,4 @@
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
/**
* Assess the facetiousness of a value. If the value is an object containing
diff --git a/packages/swingset-liveslots/src/liveslots.js b/packages/swingset-liveslots/src/liveslots.js
index f34d9e3db44..7246f41f2d8 100644
--- a/packages/swingset-liveslots/src/liveslots.js
+++ b/packages/swingset-liveslots/src/liveslots.js
@@ -1,10 +1,10 @@
+import { annotateError, assert, Fail, makeError, X } from '@endo/errors';
import {
Remotable,
passStyleOf,
getInterfaceOf,
makeMarshal,
} from '@endo/marshal';
-import { assert, Fail } from '@agoric/assert';
import { isPromise } from '@endo/promise-kit';
import { E, HandledPromise } from '@endo/eventual-send';
import { insistVatType, makeVatSlot, parseVatSlot } from './parseVatSlots.js';
@@ -19,8 +19,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
@@ -747,8 +745,8 @@ function build(
try {
val = vrm.reanimate(baseRef);
} catch (err) {
- const wrappedError = assert.error(X`failed to reanimate ${iface}`);
- assert.note(wrappedError, X`Original error: ${err}`);
+ const wrappedError = makeError(X`failed to reanimate ${iface}`);
+ annotateError(wrappedError, X`Original error: ${err}`);
throw wrappedError;
}
if (facet !== undefined) {
diff --git a/packages/swingset-liveslots/src/message.js b/packages/swingset-liveslots/src/message.js
index 3da9e83e63f..5dcc513b6d9 100644
--- a/packages/swingset-liveslots/src/message.js
+++ b/packages/swingset-liveslots/src/message.js
@@ -1,4 +1,4 @@
-import { assert, Fail } from '@agoric/assert';
+import { assert, Fail } from '@endo/errors';
import { insistCapData } from './capdata.js';
/**
diff --git a/packages/swingset-liveslots/src/parseVatSlots.js b/packages/swingset-liveslots/src/parseVatSlots.js
index ade5c09651e..b5e945a30a8 100644
--- a/packages/swingset-liveslots/src/parseVatSlots.js
+++ b/packages/swingset-liveslots/src/parseVatSlots.js
@@ -1,5 +1,5 @@
import { Nat } from '@endo/nat';
-import { assert, Fail } from '@agoric/assert';
+import { assert, Fail } from '@endo/errors';
// NOTE: confusing terminology: "slot" vs. "reference". All these things
// called "slots" are references, but the word "slot" suggests something into
diff --git a/packages/swingset-liveslots/src/virtualObjectManager.js b/packages/swingset-liveslots/src/virtualObjectManager.js
index 3a349f483cc..e58430f6c4c 100644
--- a/packages/swingset-liveslots/src/virtualObjectManager.js
+++ b/packages/swingset-liveslots/src/virtualObjectManager.js
@@ -2,12 +2,7 @@
/* eslint-disable no-use-before-define, jsdoc/require-returns-type */
import { environmentOptionsListHas } from '@endo/env-options';
-import {
- assert,
- throwRedacted as Fail,
- quote as q,
- bare as b,
-} from '@endo/errors';
+import { assert, Fail, q, b } from '@endo/errors';
import { assertPattern, mustMatch } from '@agoric/store';
import { defendPrototype, defendPrototypeKit } from '@endo/exo/tools.js';
import { Far, passStyleOf } from '@endo/marshal';
diff --git a/packages/swingset-liveslots/src/virtualReferences.js b/packages/swingset-liveslots/src/virtualReferences.js
index 71bdc328db4..10ed3785140 100644
--- a/packages/swingset-liveslots/src/virtualReferences.js
+++ b/packages/swingset-liveslots/src/virtualReferences.js
@@ -1,6 +1,6 @@
/* eslint-disable no-use-before-define, jsdoc/require-returns-type */
-import { assert, Fail } from '@agoric/assert';
+import { assert, Fail } from '@endo/errors';
import { Nat } from '@endo/nat';
import { parseVatSlot } from './parseVatSlots.js';
import {
diff --git a/packages/swingset-liveslots/src/watchedPromises.js b/packages/swingset-liveslots/src/watchedPromises.js
index d1095eaee68..e6ccad5d755 100644
--- a/packages/swingset-liveslots/src/watchedPromises.js
+++ b/packages/swingset-liveslots/src/watchedPromises.js
@@ -2,9 +2,8 @@
// no-lonely-if is a stupid rule that really should be disabled globally
/* eslint-disable no-lonely-if */
-import { Fail } from '@endo/errors';
+import { Fail, assert } from '@endo/errors';
import { E } from '@endo/eventual-send';
-import { assert } from '@agoric/assert';
import { initEmpty, M } from '@agoric/store';
import { parseVatSlot } from './parseVatSlots.js';
diff --git a/packages/swingset-liveslots/test/dummyMeterControl.js b/packages/swingset-liveslots/test/dummyMeterControl.js
index 4ff5604bd87..37f9a850bff 100644
--- a/packages/swingset-liveslots/test/dummyMeterControl.js
+++ b/packages/swingset-liveslots/test/dummyMeterControl.js
@@ -1,4 +1,4 @@
-import { assert } from '@agoric/assert';
+import { assert } from '@endo/errors';
export function makeDummyMeterControl() {
let meteringDisabled = 0;
diff --git a/packages/swingset-liveslots/test/handled-promises.test.js b/packages/swingset-liveslots/test/handled-promises.test.js
index e13c0055cae..be97ea4219b 100644
--- a/packages/swingset-liveslots/test/handled-promises.test.js
+++ b/packages/swingset-liveslots/test/handled-promises.test.js
@@ -1,7 +1,7 @@
import test from 'ava';
+import { Fail } from '@endo/errors';
import { Far } from '@endo/marshal';
-import { Fail } from '@agoric/assert';
import { M, provideLazy as provide } from '@agoric/store';
import { makePromiseKit } from '@endo/promise-kit';
// Disabled to avoid circular dependencies.
diff --git a/packages/swingset-liveslots/test/liveslots.test.js b/packages/swingset-liveslots/test/liveslots.test.js
index d926212eb86..24eeed6182f 100644
--- a/packages/swingset-liveslots/test/liveslots.test.js
+++ b/packages/swingset-liveslots/test/liveslots.test.js
@@ -1,10 +1,10 @@
// @ts-nocheck
import test from 'ava';
+import { Fail } from '@endo/errors';
import { E } from '@endo/eventual-send';
import { Far } from '@endo/marshal';
import { makePromiseKit } from '@endo/promise-kit';
-import { Fail } from '@agoric/assert';
import { kslot, kser, kunser } from '@agoric/kmarshal';
import { M } from '@agoric/store';
import { makeLiveSlots, makeMarshaller } from '../src/liveslots.js';
diff --git a/packages/swingset-liveslots/test/vat-util.js b/packages/swingset-liveslots/test/vat-util.js
index 112205ab790..974addf801c 100644
--- a/packages/swingset-liveslots/test/vat-util.js
+++ b/packages/swingset-liveslots/test/vat-util.js
@@ -1,7 +1,7 @@
// this file is imported by some test vats, so don't import any non-pure
// modules
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import { kser, kunser } from '@agoric/kmarshal';
export function extractMessage(vatDeliverObject) {
diff --git a/packages/swingset-liveslots/test/virtual-objects/rep-tostring.test.js b/packages/swingset-liveslots/test/virtual-objects/rep-tostring.test.js
index e75ccf2ee6b..ebf6079f9f6 100644
--- a/packages/swingset-liveslots/test/virtual-objects/rep-tostring.test.js
+++ b/packages/swingset-liveslots/test/virtual-objects/rep-tostring.test.js
@@ -5,12 +5,11 @@ import './set-debug-label-instances.js';
import { passStyleOf } from '@endo/far';
// this samples it
+import { q } from '@endo/errors';
import { makeFakeVirtualStuff } from '../../tools/fakeVirtualSupport.js';
// all tests in this file will be run with DEBUG='label-instances'
import { parseVatSlot } from '../../src/parseVatSlots.js';
-const { quote: q } = assert;
-
const init = () => ({});
const behavior = {};
const facets = { foo: {}, bar: {} };
diff --git a/packages/swingset-liveslots/test/vpid-liveslots.test.js b/packages/swingset-liveslots/test/vpid-liveslots.test.js
index e565283c1a8..2aa0f5d6275 100644
--- a/packages/swingset-liveslots/test/vpid-liveslots.test.js
+++ b/packages/swingset-liveslots/test/vpid-liveslots.test.js
@@ -1,10 +1,10 @@
// @ts-nocheck
import test from 'ava';
+import { Fail } from '@endo/errors';
import { E } from '@endo/eventual-send';
import { makePromiseKit } from '@endo/promise-kit';
import { Far } from '@endo/marshal';
-import { Fail } from '@agoric/assert';
import { kser, kslot } from '@agoric/kmarshal';
import { buildSyscall, makeDispatch } from './liveslots-helpers.js';
import { makeMessage, makeResolve, makeReject } from './util.js';
diff --git a/packages/swingset-liveslots/tools/fakeVirtualSupport.js b/packages/swingset-liveslots/tools/fakeVirtualSupport.js
index 26a6ee51627..9a4658c0163 100644
--- a/packages/swingset-liveslots/tools/fakeVirtualSupport.js
+++ b/packages/swingset-liveslots/tools/fakeVirtualSupport.js
@@ -1,7 +1,7 @@
/* global globalThis */
/* eslint-disable max-classes-per-file */
+import { assert, Fail } from '@endo/errors';
import { makeMarshal } from '@endo/marshal';
-import { assert } from '@agoric/assert';
import { isPromise } from '@endo/promise-kit';
import { parseVatSlot } from '../src/parseVatSlots.js';
@@ -10,8 +10,6 @@ import { makeWatchedPromiseManager } from '../src/watchedPromises.js';
import { makeFakeVirtualObjectManager } from './fakeVirtualObjectManager.js';
import { makeFakeCollectionManager } from './fakeCollectionManager.js';
-const { Fail } = assert;
-
const {
WeakRef: RealWeakRef,
WeakMap: RealWeakMap,
diff --git a/packages/swingset-runner/demo/vatFailure/vat-bad.js b/packages/swingset-runner/demo/vatFailure/vat-bad.js
index bea73c6da98..c4343ce5f9c 100644
--- a/packages/swingset-runner/demo/vatFailure/vat-bad.js
+++ b/packages/swingset-runner/demo/vatFailure/vat-bad.js
@@ -1,4 +1,4 @@
-import { assert } from '@agoric/assert';
+import { assert } from '@endo/errors';
import { kser } from '@agoric/kmarshal';
export default function setup(syscall, _state, _helpers, _vatPowers) {
diff --git a/packages/swingset-runner/demo/vatStore2/bootstrap.js b/packages/swingset-runner/demo/vatStore2/bootstrap.js
index 83f3f5d2bba..8c86e3e2459 100644
--- a/packages/swingset-runner/demo/vatStore2/bootstrap.js
+++ b/packages/swingset-runner/demo/vatStore2/bootstrap.js
@@ -1,6 +1,6 @@
+import { Fail } from '@endo/errors';
import { E } from '@endo/eventual-send';
import { Far } from '@endo/marshal';
-import { Fail } from '@agoric/assert';
import { makeXorShift128 } from './xorshift128.js';
const p = console.log;
diff --git a/packages/swingset-runner/demo/vaultPerfTest/vat-benchmark.js b/packages/swingset-runner/demo/vaultPerfTest/vat-benchmark.js
index 69b82ba7dc8..8a211a30f05 100644
--- a/packages/swingset-runner/demo/vaultPerfTest/vat-benchmark.js
+++ b/packages/swingset-runner/demo/vaultPerfTest/vat-benchmark.js
@@ -10,9 +10,9 @@
// vat-benchmark.js driver and the JSON config file (and possibly the runner
// itself, if it's not on your $PATH) accordingly.
+import { assert } from '@endo/errors';
import { E } from '@endo/eventual-send';
import { Far } from '@endo/marshal';
-import { assert } from '@agoric/assert';
import { Offers } from '@agoric/inter-protocol/src/clientSupport.js';
diff --git a/packages/swingset-runner/demo/zoeTests/vat-alice.js b/packages/swingset-runner/demo/zoeTests/vat-alice.js
index ffedcdbcb5e..5b8fdb4cdf7 100644
--- a/packages/swingset-runner/demo/zoeTests/vat-alice.js
+++ b/packages/swingset-runner/demo/zoeTests/vat-alice.js
@@ -1,6 +1,6 @@
import { E } from '@endo/eventual-send';
import { Far } from '@endo/marshal';
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import { AmountMath } from '@agoric/ertp';
import { SECOND_PRICE } from '@agoric/zoe/src/contracts/auction/index.js';
diff --git a/packages/swingset-runner/demo/zoeTests/vat-bob.js b/packages/swingset-runner/demo/zoeTests/vat-bob.js
index cba3b8f0acd..2291af8de87 100644
--- a/packages/swingset-runner/demo/zoeTests/vat-bob.js
+++ b/packages/swingset-runner/demo/zoeTests/vat-bob.js
@@ -1,6 +1,6 @@
+import { assert, X, Fail } from '@endo/errors';
import { E } from '@endo/eventual-send';
import { Far } from '@endo/marshal';
-import { assert, details as X, Fail } from '@agoric/assert';
import { keyEQ } from '@agoric/store';
import { AmountMath, isSetValue } from '@agoric/ertp';
import { claim } from '@agoric/ertp/src/legacy-payment-helpers.js';
diff --git a/packages/swingset-runner/demo/zoeTests/vat-carol.js b/packages/swingset-runner/demo/zoeTests/vat-carol.js
index aac126c06a2..bf4e22f5430 100644
--- a/packages/swingset-runner/demo/zoeTests/vat-carol.js
+++ b/packages/swingset-runner/demo/zoeTests/vat-carol.js
@@ -1,6 +1,6 @@
+import { assert, Fail } from '@endo/errors';
import { E } from '@endo/eventual-send';
import { Far } from '@endo/marshal';
-import { assert, Fail } from '@agoric/assert';
import { keyEQ } from '@agoric/store';
import { claim } from '@agoric/ertp/src/legacy-payment-helpers.js';
import { showPurseBalance, setupIssuers } from './helpers.js';
diff --git a/packages/swingset-runner/demo/zoeTests/vat-dave.js b/packages/swingset-runner/demo/zoeTests/vat-dave.js
index f65526d7908..28a80c0a9e8 100644
--- a/packages/swingset-runner/demo/zoeTests/vat-dave.js
+++ b/packages/swingset-runner/demo/zoeTests/vat-dave.js
@@ -1,6 +1,6 @@
+import { assert, X, Fail } from '@endo/errors';
import { E } from '@endo/eventual-send';
import { Far } from '@endo/marshal';
-import { assert, details as X, Fail } from '@agoric/assert';
import { keyEQ } from '@agoric/store';
import { AmountMath } from '@agoric/ertp';
import { claim } from '@agoric/ertp/src/legacy-payment-helpers.js';
diff --git a/packages/swingset-runner/package.json b/packages/swingset-runner/package.json
index 218c8a0ede2..3b43718ee38 100644
--- a/packages/swingset-runner/package.json
+++ b/packages/swingset-runner/package.json
@@ -19,7 +19,7 @@
"ci:autobench": "./autobench.js"
},
"dependencies": {
- "@agoric/assert": "^0.6.0",
+ "@endo/errors": "^1.2.2",
"@agoric/deploy-script-support": "^0.10.3",
"@agoric/ertp": "^0.16.2",
"@agoric/internal": "^0.3.2",
diff --git a/packages/swingset-runner/src/auditstore.js b/packages/swingset-runner/src/auditstore.js
index e024734c86f..568196df3a1 100644
--- a/packages/swingset-runner/src/auditstore.js
+++ b/packages/swingset-runner/src/auditstore.js
@@ -1,4 +1,4 @@
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import { parseReachableAndVatSlot } from '@agoric/swingset-vat/src/kernel/state/reachable.js';
import { parseVatSlot } from '@agoric/swingset-vat/src/lib/parseVatSlots.js';
diff --git a/packages/swingset-runner/src/chain.js b/packages/swingset-runner/src/chain.js
index 7564c768fb0..888dba5a84a 100644
--- a/packages/swingset-runner/src/chain.js
+++ b/packages/swingset-runner/src/chain.js
@@ -1,11 +1,10 @@
+import { Fail, q } from '@endo/errors';
import { buildBridge } from '@agoric/swingset-vat';
import { BridgeId, VBankAccount } from '@agoric/internal';
import { makeFakeStorageKit } from '@agoric/internal/src/storage-test-utils.js';
import * as STORAGE_PATH from '@agoric/internal/src/chain-storage-paths.js';
import { extractCoreProposalBundles } from '@agoric/deploy-script-support/src/extract-proposal.js';
-const { Fail, quote: q } = assert;
-
/**
* Export any specified storage subtrees, then delete the ones marked to clear.
*
diff --git a/packages/swingset-runner/src/slogulator.js b/packages/swingset-runner/src/slogulator.js
index b6a7bd301a7..9d8bb9c504a 100644
--- a/packages/swingset-runner/src/slogulator.js
+++ b/packages/swingset-runner/src/slogulator.js
@@ -3,7 +3,7 @@ import process from 'process';
import Readlines from 'n-readlines';
import yargs from 'yargs';
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
/* eslint-disable no-use-before-define */
diff --git a/packages/swingset-xsnap-supervisor/lib/capdata.js b/packages/swingset-xsnap-supervisor/lib/capdata.js
index 9810af65a23..9466b9058bf 100644
--- a/packages/swingset-xsnap-supervisor/lib/capdata.js
+++ b/packages/swingset-xsnap-supervisor/lib/capdata.js
@@ -1,4 +1,4 @@
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
/**
* Assert function to ensure that something expected to be a capdata object
diff --git a/packages/swingset-xsnap-supervisor/lib/supervisor-subprocess-xsnap.js b/packages/swingset-xsnap-supervisor/lib/supervisor-subprocess-xsnap.js
index ca81d767176..d7eb1325744 100644
--- a/packages/swingset-xsnap-supervisor/lib/supervisor-subprocess-xsnap.js
+++ b/packages/swingset-xsnap-supervisor/lib/supervisor-subprocess-xsnap.js
@@ -1,5 +1,5 @@
/* global globalThis WeakRef FinalizationRegistry */
-import { assert, Fail } from '@agoric/assert';
+import { assert, Fail } from '@endo/errors';
import { importBundle } from '@endo/import-bundle';
import {
makeLiveSlots,
diff --git a/packages/swingset-xsnap-supervisor/package.json b/packages/swingset-xsnap-supervisor/package.json
index f7ab24f2db7..89e2b2f20b1 100644
--- a/packages/swingset-xsnap-supervisor/package.json
+++ b/packages/swingset-xsnap-supervisor/package.json
@@ -23,7 +23,7 @@
"test:xs": "exit 0"
},
"devDependencies": {
- "@agoric/assert": "^0.6.0",
+ "@endo/errors": "^1.2.2",
"@agoric/swingset-liveslots": "^0.10.2",
"@endo/bundle-source": "^3.2.3",
"@endo/import-bundle": "^1.1.2",
diff --git a/packages/telemetry/package.json b/packages/telemetry/package.json
index 130435fd8e3..f4d3b6e189f 100644
--- a/packages/telemetry/package.json
+++ b/packages/telemetry/package.json
@@ -22,7 +22,7 @@
"author": "Agoric",
"license": "Apache-2.0",
"dependencies": {
- "@agoric/assert": "^0.6.0",
+ "@endo/errors": "^1.2.2",
"@agoric/internal": "^0.3.2",
"@agoric/store": "^0.9.2",
"@endo/init": "^1.1.2",
diff --git a/packages/telemetry/src/flight-recorder.js b/packages/telemetry/src/flight-recorder.js
index e6c3048fd5b..8273396c6fe 100644
--- a/packages/telemetry/src/flight-recorder.js
+++ b/packages/telemetry/src/flight-recorder.js
@@ -5,10 +5,9 @@
import fs from 'node:fs';
import fsp from 'node:fs/promises';
import path from 'node:path';
+import { Fail } from '@endo/errors';
import { serializeSlogObj } from './serialize-slog-obj.js';
-const { Fail } = assert;
-
export const DEFAULT_CBUF_SIZE = 100 * 1024 * 1024;
export const DEFAULT_CBUF_FILE = 'flight-recorder.bin';
export const SLOG_MAGIC = 0x41472d534c4f4721n; // 'AG-SLOG!'
diff --git a/packages/telemetry/src/otel-and-flight-recorder.js b/packages/telemetry/src/otel-and-flight-recorder.js
index 53818c6d04f..5ce1103daa1 100644
--- a/packages/telemetry/src/otel-and-flight-recorder.js
+++ b/packages/telemetry/src/otel-and-flight-recorder.js
@@ -1,4 +1,4 @@
-import { NonNullish } from '@agoric/assert';
+import { NonNullish } from '@agoric/internal';
import { makeSlogSender as makeSlogSenderFromEnv } from './make-slog-sender.js';
/**
diff --git a/packages/telemetry/src/slog-to-otel.js b/packages/telemetry/src/slog-to-otel.js
index e53583d1b21..d4b4abc4a44 100644
--- a/packages/telemetry/src/slog-to-otel.js
+++ b/packages/telemetry/src/slog-to-otel.js
@@ -1,7 +1,7 @@
import otel, { SpanStatusCode } from '@opentelemetry/api';
+import { Fail, q } from '@endo/errors';
import { makeMarshal, Remotable } from '@endo/marshal';
-import { Fail, q } from '@agoric/assert';
import { makeLegacyMap } from '@agoric/store';
import {
diff --git a/packages/time/package.json b/packages/time/package.json
index b116686e2ae..18e541a7295 100644
--- a/packages/time/package.json
+++ b/packages/time/package.json
@@ -31,7 +31,7 @@
},
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
"dependencies": {
- "@agoric/assert": "^0.6.0",
+ "@endo/errors": "^1.2.2",
"@endo/nat": "^5.0.7",
"@endo/patterns": "^1.4.0"
},
diff --git a/packages/time/src/timeMath.js b/packages/time/src/timeMath.js
index 242246609d3..925eb59cc04 100644
--- a/packages/time/src/timeMath.js
+++ b/packages/time/src/timeMath.js
@@ -1,11 +1,10 @@
import { Nat } from '@endo/nat';
+import { Fail, q } from '@endo/errors';
import { mustMatch } from '@endo/patterns';
import { RelativeTimeRecordShape, TimestampRecordShape } from './typeGuards.js';
/** @import {RelativeTime, RelativeTimeValue, TimerBrand, TimeMathType, Timestamp, TimestampRecord, TimestampValue} from './types.js' */
-const { Fail, quote: q } = assert;
-
/**
* `agreedTimerBrand` is internal to this module.
*
diff --git a/packages/vat-data/package.json b/packages/vat-data/package.json
index 4709fa621fe..640f61fe7b6 100644
--- a/packages/vat-data/package.json
+++ b/packages/vat-data/package.json
@@ -19,7 +19,7 @@
"author": "Agoric",
"license": "Apache-2.0",
"dependencies": {
- "@agoric/assert": "^0.6.0",
+ "@endo/errors": "^1.2.2",
"@agoric/base-zone": "^0.1.0",
"@agoric/store": "^0.9.2",
"@agoric/swingset-liveslots": "^0.10.2",
diff --git a/packages/vat-data/src/vat-data-bindings.js b/packages/vat-data/src/vat-data-bindings.js
index d4dfd34ae9c..c4264ebce6e 100644
--- a/packages/vat-data/src/vat-data-bindings.js
+++ b/packages/vat-data/src/vat-data-bindings.js
@@ -1,6 +1,6 @@
/* global globalThis */
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import { provideLazy } from '@agoric/store';
/** @import {Baggage, PickFacet, VatData} from '@agoric/swingset-liveslots' */
diff --git a/packages/vats/package.json b/packages/vats/package.json
index 5510a296a5a..848e8899cde 100644
--- a/packages/vats/package.json
+++ b/packages/vats/package.json
@@ -22,7 +22,7 @@
"author": "Agoric",
"license": "Apache-2.0",
"dependencies": {
- "@agoric/assert": "^0.6.0",
+ "@endo/errors": "^1.2.2",
"@agoric/cosmic-proto": "^0.4.0",
"@agoric/ertp": "^0.16.2",
"@agoric/governance": "^0.10.3",
diff --git a/packages/vats/src/bridge-target.js b/packages/vats/src/bridge-target.js
index e5ea1d29228..626d9f5e22e 100644
--- a/packages/vats/src/bridge-target.js
+++ b/packages/vats/src/bridge-target.js
@@ -1,3 +1,4 @@
+import { X, Fail, makeError } from '@endo/errors';
import { E } from '@endo/far';
import { M } from '@endo/patterns';
@@ -8,8 +9,6 @@ import { BridgeHandlerI } from './bridge.js';
* too restrictive to work out-of-the-box.
*/
-const { details: X, Fail } = assert;
-
/**
* @typedef {object} TargetApp an object representing the app that receives
* upcalls from the low-level TargetHost on the other side of a bridge
@@ -232,11 +231,9 @@ export const prepareBridgeTargetKit = (zone, makeTargetRegistration) =>
try {
targetToApp.init(target, wrappedApp);
} catch (cause) {
- throw assert.error(
- X`Target ${target} already registered`,
- undefined,
- { cause },
- );
+ throw makeError(X`Target ${target} already registered`, undefined, {
+ cause,
+ });
}
await E(targetHost).sendDowncall({
@@ -274,7 +271,7 @@ export const prepareBridgeTargetKit = (zone, makeTargetRegistration) =>
try {
targetToApp.set(target, wrappedApp);
} catch (cause) {
- throw assert.error(
+ throw makeError(
X`Target ${target} is already unregistered`,
undefined,
{ cause },
diff --git a/packages/vats/src/bridge.js b/packages/vats/src/bridge.js
index 4d52963e2d3..1da85fc9c57 100644
--- a/packages/vats/src/bridge.js
+++ b/packages/vats/src/bridge.js
@@ -1,8 +1,7 @@
+import { Fail, X } from '@endo/errors';
import { M } from '@agoric/store';
import { E } from '@endo/far';
-const { Fail, details: X } = assert;
-
/**
* Helper to type the registered scoped bridge correctly.
*
diff --git a/packages/vats/src/core/basic-behaviors.js b/packages/vats/src/core/basic-behaviors.js
index a344d42c96b..4bbbdf69ad9 100644
--- a/packages/vats/src/core/basic-behaviors.js
+++ b/packages/vats/src/core/basic-behaviors.js
@@ -1,3 +1,7 @@
+import { Nat } from '@endo/nat';
+import { Fail, X } from '@endo/errors';
+import { E, getInterfaceOf } from '@endo/far';
+
import { AssetKind } from '@agoric/ertp';
import { CONTRACT_ELECTORATE, ParamTypes } from '@agoric/governance';
import { Stable, Stake } from '@agoric/internal/src/tokens.js';
@@ -6,13 +10,10 @@ import {
deeplyFulfilledObject,
VBankAccount,
WalletName,
+ NonNullish,
} from '@agoric/internal';
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, NonNullish } from '@agoric/assert';
import { makeNameHubKit } from '../nameHub.js';
import { PowerFlags } from '../walletFlags.js';
import { feeIssuerConfig, makeMyAddressNameAdminKit } from './utils.js';
@@ -20,8 +21,6 @@ import { makeScopedBridge } from '../bridge.js';
/** @import {GovernableStartFn, GovernanceFacetKit} from '@agoric/governance/src/types.js'; */
-const { details: X } = assert;
-
/**
* In golang/cosmos/app/app.go, we define cosmosInitAction with type
* AG_COSMOS_INIT, with the following shape.
diff --git a/packages/vats/src/core/chain-behaviors.js b/packages/vats/src/core/chain-behaviors.js
index 71ab4246705..b8b14c01c11 100644
--- a/packages/vats/src/core/chain-behaviors.js
+++ b/packages/vats/src/core/chain-behaviors.js
@@ -1,4 +1,10 @@
/* global globalThis */
+import { Fail } from '@endo/errors';
+import * as farExports from '@endo/far';
+import { E, Far } from '@endo/far';
+import { importBundle } from '@endo/import-bundle';
+import { makePromiseKit } from '@endo/promise-kit';
+
import { allValues, BridgeId as BRIDGE_ID } from '@agoric/internal';
import * as STORAGE_PATH from '@agoric/internal/src/chain-storage-paths.js';
import { makePrioritySendersManager } from '@agoric/internal/src/priority-senders.js';
@@ -9,16 +15,11 @@ import {
} from '@agoric/notifier';
import { makeScalarBigMapStore } from '@agoric/vat-data';
import { prepareRecorderKit } from '@agoric/zoe/src/contractSupport/recorder.js';
-import * as farExports from '@endo/far';
-import { E, Far } from '@endo/far';
-import { importBundle } from '@endo/import-bundle';
-import { makePromiseKit } from '@endo/promise-kit';
import { PowerFlags } from '../walletFlags.js';
import { BASIC_BOOTSTRAP_PERMITS } from './basic-behaviors.js';
import { agoricNamesReserved, callProperties, extractPowers } from './utils.js';
import { makeScopedBridge } from '../bridge.js';
-const { Fail } = assert;
const { keys } = Object;
/**
diff --git a/packages/vats/src/core/client-behaviors.js b/packages/vats/src/core/client-behaviors.js
index 778ceb8a86a..5fae7cfced0 100644
--- a/packages/vats/src/core/client-behaviors.js
+++ b/packages/vats/src/core/client-behaviors.js
@@ -1,3 +1,4 @@
+import { Fail } from '@endo/errors';
import { E, Far } from '@endo/far';
import { makePluginManager } from '@agoric/swingset-vat/src/vats/plugin-manager.js';
import { observeNotifier } from '@agoric/notifier';
@@ -5,8 +6,6 @@ import { deeplyFulfilledObject } from '@agoric/internal';
import { registerNetworkProtocols } from '../proposals/network-proposal.js';
import { makeVatsFromBundles } from './basic-behaviors.js';
-const { Fail } = assert;
-
const PROVISIONER_INDEX = 1;
function makeVattpFrom(vats) {
diff --git a/packages/vats/src/core/demoIssuers.js b/packages/vats/src/core/demoIssuers.js
index b8476f0219f..c48a8890969 100644
--- a/packages/vats/src/core/demoIssuers.js
+++ b/packages/vats/src/core/demoIssuers.js
@@ -1,15 +1,16 @@
+import { Fail, q } from '@endo/errors';
+import { Nat } from '@endo/nat';
+import { E, Far } from '@endo/far';
+
import { AmountMath, AssetKind } from '@agoric/ertp';
import { split, splitMany } from '@agoric/ertp/src/legacy-payment-helpers.js';
import {
makeRatio,
natSafeMath,
} from '@agoric/zoe/src/contractSupport/index.js';
-import { E, Far } from '@endo/far';
-import { Nat } from '@endo/nat';
import { notForProductionUse } from '@agoric/internal/src/magic-cookie-test-only.js';
import { Stake, Stable } from '@agoric/internal/src/tokens.js';
-const { Fail, quote: q } = assert;
const { multiply, floorDivide } = natSafeMath;
const { entries, fromEntries, keys, values } = Object;
diff --git a/packages/vats/src/core/lib-boot.js b/packages/vats/src/core/lib-boot.js
index 29da9135545..5cf6771eb8d 100644
--- a/packages/vats/src/core/lib-boot.js
+++ b/packages/vats/src/core/lib-boot.js
@@ -1,3 +1,4 @@
+import { Fail, q } from '@endo/errors';
import { E, Far } from '@endo/far';
import { makeHeapZone } from '@agoric/zone';
import {
@@ -7,8 +8,6 @@ import {
} from './utils.js';
import { makePromiseSpace } from './promise-space.js';
-const { Fail, quote: q } = assert;
-
/**
* @typedef {true
* | string
diff --git a/packages/vats/src/core/utils.js b/packages/vats/src/core/utils.js
index 25aee277603..95020941bab 100644
--- a/packages/vats/src/core/utils.js
+++ b/packages/vats/src/core/utils.js
@@ -1,3 +1,4 @@
+import { Fail, q } from '@endo/errors';
import { Stable, Stake } from '@agoric/internal/src/tokens.js';
import { WalletName } from '@agoric/internal';
import { E, Far } from '@endo/far';
@@ -10,7 +11,6 @@ import { makeLogHooks, makePromiseSpace } from './promise-space.js';
import './types-ambient.js';
const { entries, fromEntries, keys } = Object;
-const { Fail, quote: q } = assert;
/**
* Used in bootstrap to reserve names in the agoricNames namespace before any
diff --git a/packages/vats/src/ibc.js b/packages/vats/src/ibc.js
index c54ae476bce..d75bd27fd18 100644
--- a/packages/vats/src/ibc.js
+++ b/packages/vats/src/ibc.js
@@ -1,6 +1,6 @@
// @ts-check
-import { assert, details as X, Fail } from '@agoric/assert';
+import { assert, X, Fail } from '@endo/errors';
import { E } from '@endo/far';
import { byteSourceToBase64, base64ToBytes } from '@agoric/network';
diff --git a/packages/vats/src/lib-board.js b/packages/vats/src/lib-board.js
index 90b305b9303..f1c7a23a48f 100644
--- a/packages/vats/src/lib-board.js
+++ b/packages/vats/src/lib-board.js
@@ -3,7 +3,7 @@
* @see prepareBoardKit()
*/
-import { assert, Fail, q } from '@agoric/assert';
+import { assert, Fail, q } from '@endo/errors';
import { prepareDurablePublishKit } from '@agoric/notifier';
import { M, makeScalarBigMapStore, prepareExoClassKit } from '@agoric/vat-data';
import {
diff --git a/packages/vats/src/localchain.js b/packages/vats/src/localchain.js
index 91f544bc39a..b9aae359835 100644
--- a/packages/vats/src/localchain.js
+++ b/packages/vats/src/localchain.js
@@ -1,10 +1,10 @@
// @ts-check
+import { Fail } from '@endo/errors';
import { E } from '@endo/far';
import { M } from '@endo/patterns';
import { AmountShape, BrandShape, PaymentShape } from '@agoric/ertp';
import { Shape as NetworkShape } from '@agoric/network';
-const { Fail } = assert;
const { Vow$ } = NetworkShape;
/**
diff --git a/packages/vats/src/nameHub.js b/packages/vats/src/nameHub.js
index d93d449fb13..c6597c78725 100644
--- a/packages/vats/src/nameHub.js
+++ b/packages/vats/src/nameHub.js
@@ -1,4 +1,4 @@
-import { assert, NonNullish } from '@agoric/assert';
+import { assert, Fail, q } from '@endo/errors';
import { E } from '@endo/far';
import { makePromiseKit } from '@endo/promise-kit';
import { M, getInterfaceGuardPayload } from '@endo/patterns';
@@ -9,9 +9,7 @@ import {
prepareGuardedAttenuator,
} from '@agoric/internal/src/callback.js';
import { makeHeapZone } from '@agoric/zone';
-import { deeplyFulfilledObject } from '@agoric/internal';
-
-const { Fail, quote: q } = assert;
+import { deeplyFulfilledObject, NonNullish } from '@agoric/internal';
const KeyShape = M.string();
const PathShape = M.arrayOf(KeyShape);
diff --git a/packages/vats/src/priceAuthorityRegistry.js b/packages/vats/src/priceAuthorityRegistry.js
index eb8bb0e3013..a6ebab20258 100644
--- a/packages/vats/src/priceAuthorityRegistry.js
+++ b/packages/vats/src/priceAuthorityRegistry.js
@@ -1,3 +1,7 @@
+import { Fail } from '@endo/errors';
+import { E } from '@endo/far';
+import { Far } from '@endo/marshal';
+
import { BrandShape } from '@agoric/ertp';
import {
M,
@@ -6,8 +10,6 @@ import {
provideDurableMapStore,
} from '@agoric/vat-data';
import { provideLazy } from '@agoric/store';
-import { E } from '@endo/far';
-import { Far } from '@endo/marshal';
import { PriceAuthorityI } from '@agoric/zoe/src/contractSupport/priceAuthority.js';
/**
@@ -15,8 +17,6 @@ import { PriceAuthorityI } from '@agoric/zoe/src/contractSupport/priceAuthority.
* @import {MutableQuote, PriceAuthority, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js';
*/
-const { Fail } = assert;
-
/**
* @typedef {object} Deleter
* @property {() => void} delete
diff --git a/packages/vats/src/proposals/restart-vats-proposal.js b/packages/vats/src/proposals/restart-vats-proposal.js
index 7613d833e51..fe4d1611034 100644
--- a/packages/vats/src/proposals/restart-vats-proposal.js
+++ b/packages/vats/src/proposals/restart-vats-proposal.js
@@ -1,4 +1,4 @@
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import { deeplyFulfilledObject, makeTracer } from '@agoric/internal';
import { M, mustMatch } from '@agoric/store';
import { E, getInterfaceOf } from '@endo/far';
diff --git a/packages/vats/src/transfer.js b/packages/vats/src/transfer.js
index a9a04bd36a7..5df07f7aadc 100644
--- a/packages/vats/src/transfer.js
+++ b/packages/vats/src/transfer.js
@@ -1,4 +1,5 @@
// @ts-check
+import { Fail, b } from '@endo/errors';
import { E } from '@endo/far';
import { M } from '@endo/patterns';
import { VTRANSFER_IBC_EVENT } from '@agoric/internal';
@@ -9,8 +10,6 @@ import { TargetAppI, AppTransformerI } from './bridge-target.js';
* @import {TargetApp, TargetHost} from './bridge-target.js'
*/
-const { Fail, bare } = assert;
-
/**
* The least possibly restrictive guard for a `watch` watcher's `onFulfilled` or
* `onRejected` reaction
@@ -54,7 +53,7 @@ const prepareTransferInterceptor = (zone, vowTools) => {
const { isActiveTap, tap } = this.state;
obj.type === VTRANSFER_IBC_EVENT ||
- Fail`Invalid upcall argument type ${obj.type}; expected ${bare(VTRANSFER_IBC_EVENT)}`;
+ Fail`Invalid upcall argument type ${obj.type}; expected ${b(VTRANSFER_IBC_EVENT)}`;
// First, call our target contract listener.
// A VTransfer active interceptor can return a write acknowledgement
diff --git a/packages/vats/src/vat-bank.js b/packages/vats/src/vat-bank.js
index 55d2771ea1c..63630a20874 100644
--- a/packages/vats/src/vat-bank.js
+++ b/packages/vats/src/vat-bank.js
@@ -1,3 +1,7 @@
+import { Fail } from '@endo/errors';
+import { E, Far } from '@endo/far';
+import { M, getInterfaceGuardPayload } from '@endo/patterns';
+
import { AmountMath, AssetKind, BrandShape } from '@agoric/ertp';
import { deeplyFulfilledObject } from '@agoric/internal';
import { prepareGuardedAttenuator } from '@agoric/internal/src/callback.js';
@@ -8,10 +12,8 @@ import {
prepareDurablePublishKit,
subscribeEach,
} from '@agoric/notifier';
-import { M, getInterfaceGuardPayload } from '@endo/patterns';
import { provideLazy } from '@agoric/store';
import { makeDurableZone } from '@agoric/zone/durable.js';
-import { E, Far } from '@endo/far';
import { makeAtomicProvider } from '@agoric/store/src/stores/store-utils.js';
import { BridgeHandlerI, BridgeScopedManagerI } from './bridge.js';
import {
@@ -24,8 +26,6 @@ import {
* @import {Passable, RemotableObject} from '@endo/pass-style')
*/
-const { Fail } = assert;
-
const { VirtualPurseControllerI } = makeVirtualPurseKitIKit();
const BridgeChannelI = M.interface('BridgeChannel', {
diff --git a/packages/vats/src/vat-bridge.js b/packages/vats/src/vat-bridge.js
index e18a80fea18..12afdf1e09e 100644
--- a/packages/vats/src/vat-bridge.js
+++ b/packages/vats/src/vat-bridge.js
@@ -1,4 +1,4 @@
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import { Far } from '@endo/far';
import { makeDurableZone } from '@agoric/zone/durable.js';
import * as cb from '@agoric/internal/src/callback.js';
diff --git a/packages/vats/src/virtual-purse.js b/packages/vats/src/virtual-purse.js
index c08b39751ae..68addb78ceb 100644
--- a/packages/vats/src/virtual-purse.js
+++ b/packages/vats/src/virtual-purse.js
@@ -1,7 +1,9 @@
-import { M } from '@agoric/store';
+import { Fail } from '@endo/errors';
import { E } from '@endo/far';
import { isPromise } from '@endo/promise-kit';
+import { getInterfaceGuardPayload } from '@endo/patterns';
+import { M } from '@agoric/store';
import {
AmountShape,
BrandShape,
@@ -10,10 +12,6 @@ import {
PaymentShape,
} from '@agoric/ertp/src/typeGuards.js';
-import { getInterfaceGuardPayload } from '@endo/patterns';
-
-const { Fail } = assert;
-
/**
* @param {Pattern} [brandShape]
* @param {Pattern} [amountShape]
diff --git a/packages/vats/test/localchain.test.js b/packages/vats/test/localchain.test.js
index 3a267c8150d..f2aaf5cf361 100644
--- a/packages/vats/test/localchain.test.js
+++ b/packages/vats/test/localchain.test.js
@@ -1,13 +1,12 @@
// @ts-check
import { test as anyTest } from '@agoric/swingset-vat/tools/prepare-test-env-ava.js';
-import { NonNullish } from '@agoric/assert';
+import { NonNullish, VTRANSFER_IBC_EVENT } from '@agoric/internal';
import { AmountMath, AssetKind, makeIssuerKit } from '@agoric/ertp';
import { reincarnate } from '@agoric/swingset-liveslots/tools/setup-vat-data.js';
import { withAmountUtils } from '@agoric/zoe/tools/test-utils.js';
import { makeDurableZone } from '@agoric/zone/durable.js';
import { getInterfaceOf } from '@endo/marshal';
-import { VTRANSFER_IBC_EVENT } from '@agoric/internal';
import { prepareVowTools, heapVowE as E } from '@agoric/vow/vat.js';
import { prepareLocalChainTools } from '../src/localchain.js';
import { prepareBridgeTargetModule } from '../src/bridge-target.js';
diff --git a/packages/vats/tools/boot-test-utils.js b/packages/vats/tools/boot-test-utils.js
index 827f8f4f2c0..cb8fc7b9cf6 100644
--- a/packages/vats/tools/boot-test-utils.js
+++ b/packages/vats/tools/boot-test-utils.js
@@ -1,9 +1,11 @@
+import { Fail } from '@endo/errors';
+import { Far } from '@endo/marshal';
+
import {
makeFakeVatAdmin,
zcfBundleCap,
} from '@agoric/zoe/tools/fakeVatAdmin.js';
import { buildZoeManualTimer } from '@agoric/zoe/tools/manualTimer.js';
-import { Far } from '@endo/marshal';
import { makeScalarBigMapStore } from '@agoric/vat-data';
import { bundles, devices } from '../test/devices.js';
@@ -17,8 +19,6 @@ import { buildRootObject as priceAuthorityRoot } from '../src/vat-priceAuthority
import { buildRootObject as provisioningRoot } from '../src/vat-provisioning.js';
import { buildRootObject as zoeRoot } from '../src/vat-zoe.js';
-const { Fail } = assert;
-
export const vatRoots = {
agoricNames: agoricNamesRoot,
bank: bankRoot,
diff --git a/packages/vats/tools/fake-bridge.js b/packages/vats/tools/fake-bridge.js
index 7920c570f79..74feaa7d2c8 100644
--- a/packages/vats/tools/fake-bridge.js
+++ b/packages/vats/tools/fake-bridge.js
@@ -1,5 +1,5 @@
// @ts-check
-import { assert, Fail } from '@agoric/assert';
+import { assert, Fail } from '@endo/errors';
import { makeTracer, VBankAccount } from '@agoric/internal';
import { E } from '@endo/far';
import { makeWhen } from '@agoric/vow/src/when.js';
diff --git a/packages/vow/package.json b/packages/vow/package.json
index 591d2e4793f..fb69de3aa1d 100755
--- a/packages/vow/package.json
+++ b/packages/vow/package.json
@@ -23,6 +23,7 @@
"@agoric/base-zone": "^0.1.0",
"@agoric/internal": "^0.3.2",
"@endo/env-options": "^1.1.4",
+ "@endo/errors": "^1.2.2",
"@endo/eventual-send": "^1.2.2",
"@endo/pass-style": "^1.4.0",
"@endo/patterns": "^1.4.0",
diff --git a/packages/vow/src/E.js b/packages/vow/src/E.js
index e243a2304c5..c07bb8f3f8d 100644
--- a/packages/vow/src/E.js
+++ b/packages/vow/src/E.js
@@ -15,10 +15,10 @@
* designed to be a drop-in replacement for the version in
* `@endo/eventual-send/src/E.js` which contained no concept of "unwrap",
*/
+import { X, q, Fail, makeError } from '@endo/errors';
import { trackTurns } from './track-turns.js';
import { makeMessageBreakpointTester } from './message-breakpoints.js';
-const { details: X, quote: q, Fail } = assert;
const { assign, create } = Object;
const onSend = makeMessageBreakpointTester('ENDO_SEND_BREAKPOINTS');
@@ -79,7 +79,7 @@ const makeEProxyHandler = (recipient, HandledPromise, unwrap) =>
if (this !== receiver) {
// Reject the async function call
return HandledPromise.reject(
- assert.error(
+ makeError(
X`Unexpected receiver for "${q(propertyKey)}" method of E(${q(
recipient,
)})`,
diff --git a/packages/vow/src/message-breakpoints.js b/packages/vow/src/message-breakpoints.js
index fd161cde942..860cf6fbe1a 100644
--- a/packages/vow/src/message-breakpoints.js
+++ b/packages/vow/src/message-breakpoints.js
@@ -1,7 +1,7 @@
// @ts-check
import { getEnvironmentOption } from '@endo/env-options';
-const { quote: q, Fail } = assert;
+import { q, Fail } from '@endo/errors';
const { hasOwn, freeze, entries } = Object;
diff --git a/packages/vow/src/track-turns.js b/packages/vow/src/track-turns.js
index 154121142df..e81b0c4b2dd 100644
--- a/packages/vow/src/track-turns.js
+++ b/packages/vow/src/track-turns.js
@@ -5,8 +5,10 @@ import {
environmentOptionsListHas,
} from '@endo/env-options';
-// NOTE: We can't import these because they're not in scope before lockdown.
-// import { assert, details as X, Fail } from '@agoric/assert';
+// Note that in the original track-turns.js in @endo/eventual-send we
+// can't simply import these because `assert` is not in scope before lockdown.
+// But this copy in @agoric/vow the import is fine.
+import { annotateError, X } from '@endo/errors';
// WARNING: Global Mutable State!
// This state is communicated to `assert` that makes it available to the
@@ -34,7 +36,7 @@ const ENABLED =
const addRejectionNote = detailsNote => reason => {
if (reason instanceof Error) {
- assert.note(reason, detailsNote);
+ annotateError(reason, detailsNote);
}
if (VERBOSE) {
console.log('REJECTED at top of event loop', reason);
@@ -42,7 +44,7 @@ const addRejectionNote = detailsNote => reason => {
};
const wrapFunction =
- (func, sendingError, X) =>
+ (func, sendingError) =>
(...args) => {
hiddenPriorError = sendingError;
hiddenCurrentTurn += 1;
@@ -53,7 +55,7 @@ const wrapFunction =
result = func(...args);
} catch (err) {
if (err instanceof Error) {
- assert.note(
+ annotateError(
err,
X`Thrown from: ${hiddenPriorError}:${hiddenCurrentTurn}.${hiddenCurrentEvent}`,
);
@@ -91,18 +93,17 @@ export const trackTurns = funcs => {
if (!ENABLED || typeof globalThis === 'undefined' || !globalThis.assert) {
return funcs;
}
- const { details: X } = assert;
hiddenCurrentEvent += 1;
const sendingError = Error(
`Event: ${hiddenCurrentTurn}.${hiddenCurrentEvent}`,
);
if (hiddenPriorError !== undefined) {
- assert.note(sendingError, X`Caused by: ${hiddenPriorError}`);
+ annotateError(sendingError, X`Caused by: ${hiddenPriorError}`);
}
return /** @type {T} */ (
- funcs.map(func => func && wrapFunction(func, sendingError, X))
+ funcs.map(func => func && wrapFunction(func, sendingError))
);
};
diff --git a/packages/wallet/api/deploy.js b/packages/wallet/api/deploy.js
index 0fd036d40ef..deb72b241c7 100644
--- a/packages/wallet/api/deploy.js
+++ b/packages/wallet/api/deploy.js
@@ -2,8 +2,8 @@
// Agoric wallet deployment script.
// FIXME: This is just hacked together for the legacy wallet.
+import { Fail } from '@endo/errors';
import { E } from '@endo/eventual-send';
-import { Fail } from '@agoric/assert';
import path from 'path';
const dirname = path.dirname(new URL(import.meta.url).pathname);
diff --git a/packages/wallet/api/package.json b/packages/wallet/api/package.json
index 217d8791f7c..572196f329a 100644
--- a/packages/wallet/api/package.json
+++ b/packages/wallet/api/package.json
@@ -21,7 +21,7 @@
"ava": "^5.3.0"
},
"dependencies": {
- "@agoric/assert": "^0.6.0",
+ "@endo/errors": "^1.2.2",
"@agoric/cache": "^0.3.2",
"@agoric/ertp": "^0.16.2",
"@agoric/internal": "^0.3.2",
diff --git a/packages/wallet/api/src/findOrMakeInvitation.js b/packages/wallet/api/src/findOrMakeInvitation.js
index e0f49b42266..a993a179343 100644
--- a/packages/wallet/api/src/findOrMakeInvitation.js
+++ b/packages/wallet/api/src/findOrMakeInvitation.js
@@ -1,4 +1,4 @@
-import { assert, Fail, q } from '@agoric/assert';
+import { assert, Fail, q } from '@endo/errors';
import { E } from '@endo/eventual-send';
import { passStyleOf } from '@endo/marshal';
import { AmountMath } from '@agoric/ertp';
diff --git a/packages/wallet/api/src/issuerTable.js b/packages/wallet/api/src/issuerTable.js
index f9880b7b29b..9a5e6552c2e 100644
--- a/packages/wallet/api/src/issuerTable.js
+++ b/packages/wallet/api/src/issuerTable.js
@@ -1,6 +1,6 @@
// @ts-check
-import { assert } from '@agoric/assert';
+import { assert } from '@endo/errors';
import { E } from '@endo/eventual-send';
import { makeScalarWeakMapStore } from '@agoric/store';
diff --git a/packages/wallet/api/src/lib-dehydrate.js b/packages/wallet/api/src/lib-dehydrate.js
index b4f7defb55e..5f96148f1a2 100644
--- a/packages/wallet/api/src/lib-dehydrate.js
+++ b/packages/wallet/api/src/lib-dehydrate.js
@@ -1,8 +1,8 @@
// @ts-check
+import { assert, Fail, q } from '@endo/errors';
import { makeMarshal, mapIterable } from '@endo/marshal';
import { makeLegacyMap, makeScalarMapStore } from '@agoric/store';
-import { assert, Fail, q } from '@agoric/assert';
/**
* @typedef {string[]} Path
diff --git a/packages/wallet/api/src/lib-wallet.js b/packages/wallet/api/src/lib-wallet.js
index c91126981c4..721ebb256ae 100644
--- a/packages/wallet/api/src/lib-wallet.js
+++ b/packages/wallet/api/src/lib-wallet.js
@@ -11,7 +11,7 @@
* and dapps.
*/
-import { assert, q, Fail } from '@agoric/assert';
+import { assert, q, Fail } from '@endo/errors';
import { makeScalarStoreCoordinator } from '@agoric/cache';
import { objectMap, WalletName } from '@agoric/internal';
import { slotStringUnserialize } from '@agoric/internal/src/storage-test-utils.js';
@@ -1682,7 +1682,7 @@ export function makeWalletRoot({
(kind, lookup) =>
(...path) => {
path.length === 1 ||
- Fail`${assert.quote(
+ Fail`${q(
kind,
)} lookup must be called with a single offer ID, not ${path}`;
return lookup(path[0]);
diff --git a/packages/wallet/api/test/lib-wallet.test.js b/packages/wallet/api/test/lib-wallet.test.js
index 1d7b26a90db..99d00560268 100644
--- a/packages/wallet/api/test/lib-wallet.test.js
+++ b/packages/wallet/api/test/lib-wallet.test.js
@@ -1,16 +1,15 @@
// @ts-check
import { test as anyTest } from '@agoric/zoe/tools/prepare-test-env-ava.js';
+import { assert } from '@endo/errors';
+import { E } from '@endo/eventual-send';
import bundleSource from '@endo/bundle-source';
-import { makeCache } from '@agoric/cache';
-import { makeIssuerKit, AmountMath, AssetKind } from '@agoric/ertp';
import { M } from '@agoric/store';
-
+import { makeCache } from '@agoric/cache';
+import { makeIssuerKit, AmountMath, AssetKind } from '@agoric/ertp';
import { makeZoeForTest } from '@agoric/zoe/tools/setup-zoe.js';
-import { E } from '@endo/eventual-send';
-import { assert } from '@agoric/assert';
import { makeFakeBoard } from '@agoric/vats/tools/board-utils.js';
import {
makeNameHubKit,
diff --git a/packages/xsnap/package.json b/packages/xsnap/package.json
index fd157a7be7d..ad22a5f5f3b 100644
--- a/packages/xsnap/package.json
+++ b/packages/xsnap/package.json
@@ -28,7 +28,7 @@
"test:xs": "exit 0"
},
"dependencies": {
- "@agoric/assert": "^0.6.0",
+ "@endo/errors": "^1.2.2",
"@agoric/internal": "^0.3.2",
"@agoric/xsnap-lockdown": "^0.14.0",
"@endo/bundle-source": "^3.2.3",
diff --git a/packages/xsnap/src/avaXS.js b/packages/xsnap/src/avaXS.js
index 082bce4acda..09778dfde84 100644
--- a/packages/xsnap/src/avaXS.js
+++ b/packages/xsnap/src/avaXS.js
@@ -11,7 +11,7 @@ import '@endo/init';
import fs from 'fs';
import { tmpName } from 'tmp';
-import { assert, q, Fail } from '@agoric/assert';
+import { assert, q, Fail } from '@endo/errors';
import { getDebugLockdownBundle } from '@agoric/xsnap-lockdown';
import { xsnap } from './xsnap.js';
diff --git a/packages/xsnap/src/xsnap.js b/packages/xsnap/src/xsnap.js
index 77ab250a2c8..a0fe1baa5b2 100644
--- a/packages/xsnap/src/xsnap.js
+++ b/packages/xsnap/src/xsnap.js
@@ -1,19 +1,10 @@
/* global process */
/* eslint no-await-in-loop: ["off"] */
-/**
- * @typedef {typeof import('child_process').spawn} Spawn
- * @import {Writable} from 'stream'
- */
-
-/**
- * @template T
- * @typedef {import('./defer.js').Deferred} Deferred
- */
-
import { finished } from 'stream/promises';
import { PassThrough, Readable } from 'stream';
import { promisify } from 'util';
+import { Fail, q } from '@endo/errors';
import { makeNetstringReader, makeNetstringWriter } from '@endo/netstring';
import { makeNodeReader, makeNodeWriter } from '@endo/stream-node';
import { makePromiseKit, racePromises } from '@endo/promise-kit';
@@ -21,7 +12,15 @@ import { forever } from '@agoric/internal';
import { ErrorCode, ErrorSignal, ErrorMessage, METER_TYPE } from '../api.js';
import { defer } from './defer.js';
-const { Fail, quote: q } = assert;
+/**
+ * @typedef {typeof import('child_process').spawn} Spawn
+ * @import {Writable} from 'stream'
+ */
+
+/**
+ * @template T
+ * @typedef {import('./defer.js').Deferred} Deferred
+ */
// This will need adjustment, but seems to be fine for a start.
export const DEFAULT_CRANK_METERING_LIMIT = 1e8;
diff --git a/packages/zoe/README.md b/packages/zoe/README.md
index ba6747cbda5..934e9b5f143 100644
--- a/packages/zoe/README.md
+++ b/packages/zoe/README.md
@@ -77,11 +77,10 @@ The new bundle must export a `prepare` function in place of `start`. This is cal
For example, suppose v1 code of a simple single-increment-counter contract anticipated extension of exported functionality and decided to track it by means of "codeVersion" data in baggage. v2 code could add multi-increment behavior like so:
```js
-import { M } from '@agoric/store';
+import { q, Fail } from '@endo/errors';
+import { M } from '@endo/patterns';
import { prepareExo, prepareExoClass } from '@agoric/vat-data';
-const { quote: q, Fail } = assert;
-
export const start = async (zcf, _privateArgs, instanceBaggage) => {
const CODE_VERSION = 2;
const isFirstIncarnation = !instanceBaggage.has('codeVersion');
diff --git a/packages/zoe/package.json b/packages/zoe/package.json
index d836ed12796..91587293619 100644
--- a/packages/zoe/package.json
+++ b/packages/zoe/package.json
@@ -43,7 +43,7 @@
},
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
"dependencies": {
- "@agoric/assert": "^0.6.0",
+ "@endo/errors": "^1.2.2",
"@agoric/base-zone": "^0.1.0",
"@agoric/ertp": "^0.16.2",
"@agoric/internal": "^0.3.2",
diff --git a/packages/zoe/src/cleanProposal.js b/packages/zoe/src/cleanProposal.js
index 37fd8bef2bd..c807ee0947f 100644
--- a/packages/zoe/src/cleanProposal.js
+++ b/packages/zoe/src/cleanProposal.js
@@ -1,4 +1,4 @@
-import { assert, q, Fail } from '@agoric/assert';
+import { assert, q, Fail } from '@endo/errors';
import { AmountMath, getAssetKind } from '@agoric/ertp';
import { objectMap } from '@agoric/internal';
import { assertRecord } from '@endo/marshal';
diff --git a/packages/zoe/src/contractFacet/allocationMath.js b/packages/zoe/src/contractFacet/allocationMath.js
index 6160de05551..47a74bda32e 100644
--- a/packages/zoe/src/contractFacet/allocationMath.js
+++ b/packages/zoe/src/contractFacet/allocationMath.js
@@ -1,7 +1,6 @@
+import { Fail, q } from '@endo/errors';
import { AmountMath } from '@agoric/ertp';
-const { Fail, quote: q } = assert;
-
/**
* @callback Operation
*
diff --git a/packages/zoe/src/contractFacet/exit.js b/packages/zoe/src/contractFacet/exit.js
index ac1cd92791e..3dcb79f9936 100644
--- a/packages/zoe/src/contractFacet/exit.js
+++ b/packages/zoe/src/contractFacet/exit.js
@@ -1,3 +1,4 @@
+import { Fail, q } from '@endo/errors';
import { E } from '@endo/eventual-send';
import { prepareExoClass, provideDurableSetStore } from '@agoric/vat-data';
import { M, initEmpty } from '@agoric/store';
@@ -9,8 +10,6 @@ import {
isWaivedExitRule,
} from '../typeGuards.js';
-const { Fail, quote: q } = assert;
-
const ExitObjectI = M.interface('ExitObject', { exit: M.call().returns() });
const WakerI = M.interface('Waker', {
wake: M.call(TimestampShape).returns(),
diff --git a/packages/zoe/src/contractFacet/offerHandlerStorage.js b/packages/zoe/src/contractFacet/offerHandlerStorage.js
index 26ff65aaff1..528c089aee5 100644
--- a/packages/zoe/src/contractFacet/offerHandlerStorage.js
+++ b/packages/zoe/src/contractFacet/offerHandlerStorage.js
@@ -6,6 +6,18 @@ import { canBeDurable, provideDurableWeakMapStore } from '@agoric/vat-data';
import { defineDurableHandle } from '../makeHandle.js';
+/**
+ * The following should work. But for some reason, @endo/errors does
+ * not export the type `Details`.
+ * See https://github.com/endojs/endo/issues/2339
+ *
+ * at-import {Details} from '@endo/errors'
+ *
+ * In the meantime...
+ *
+ * @typedef {string | {}} Details
+ */
+
/**
* @import {RemotableBrand} from '@endo/eventual-send';
* @import {RemotableObject} from '@endo/pass-style';
diff --git a/packages/zoe/src/contractFacet/reallocate.js b/packages/zoe/src/contractFacet/reallocate.js
index f09b7f031c4..997a9e996e5 100644
--- a/packages/zoe/src/contractFacet/reallocate.js
+++ b/packages/zoe/src/contractFacet/reallocate.js
@@ -1,10 +1,9 @@
+import { Fail } from '@endo/errors';
import { makeScalarMapStore } from '@agoric/vat-data';
import { assertRightsConserved } from './rightsConservation.js';
import { addToAllocation, subtractFromAllocation } from './allocationMath.js';
-const { Fail } = assert;
-
/** @typedef {Array} TransactionList */
/**
diff --git a/packages/zoe/src/contractFacet/rightsConservation.js b/packages/zoe/src/contractFacet/rightsConservation.js
index 23b5a946907..8ab027b9123 100644
--- a/packages/zoe/src/contractFacet/rightsConservation.js
+++ b/packages/zoe/src/contractFacet/rightsConservation.js
@@ -1,5 +1,5 @@
+import { assert, Fail } from '@endo/errors';
import { makeScalarMapStore } from '@agoric/store';
-import { assert, Fail } from '@agoric/assert';
import { AmountMath } from '@agoric/ertp';
import '../internal-types.js';
diff --git a/packages/zoe/src/contractFacet/vatRoot.js b/packages/zoe/src/contractFacet/vatRoot.js
index befea18e9c6..00404e0c003 100644
--- a/packages/zoe/src/contractFacet/vatRoot.js
+++ b/packages/zoe/src/contractFacet/vatRoot.js
@@ -7,6 +7,7 @@
// time this file is edited, the bundle must be manually rebuilt with
// `yarn build-zcfBundle`.
+import { Fail } from '@endo/errors';
import { Far } from '@endo/marshal';
import { E } from '@endo/far';
@@ -14,8 +15,6 @@ import '../internal-types.js';
import { makeZCFZygote } from './zcfZygote.js';
-const { Fail } = assert;
-
/**
* @param {VatPowers & { testJigSetter: TestJigSetter }} powers
* @param {{contractBundleCap: BundleCap, zoeService: ZoeService, invitationIssuer: Issuer<'set'>, privateArgs?: any}} vatParameters
diff --git a/packages/zoe/src/contractFacet/zcfMint.js b/packages/zoe/src/contractFacet/zcfMint.js
index b8423125837..085747285cf 100644
--- a/packages/zoe/src/contractFacet/zcfMint.js
+++ b/packages/zoe/src/contractFacet/zcfMint.js
@@ -1,7 +1,8 @@
/* eslint @typescript-eslint/no-floating-promises: "warn" */
+import { Fail } from '@endo/errors';
+import { E } from '@endo/eventual-send';
import { AmountMath } from '@agoric/ertp';
import { prepareExoClass } from '@agoric/vat-data';
-import { E } from '@endo/eventual-send';
import { coerceAmountKeywordRecord } from '../cleanProposal.js';
import { assertFullIssuerRecord, makeIssuerRecord } from '../issuerRecord.js';
@@ -12,8 +13,6 @@ import { ZcfMintI } from './typeGuards.js';
import './internal-types.js';
import './types-ambient.js';
-const { Fail } = assert;
-
/**
* @param {AmountKeywordRecord} amr
* @param {IssuerRecord} issuerRecord
diff --git a/packages/zoe/src/contractFacet/zcfSeat.js b/packages/zoe/src/contractFacet/zcfSeat.js
index 898a635c67f..d46fb583420 100644
--- a/packages/zoe/src/contractFacet/zcfSeat.js
+++ b/packages/zoe/src/contractFacet/zcfSeat.js
@@ -1,4 +1,6 @@
/* eslint @typescript-eslint/no-floating-promises: "warn" */
+import { annotateError, Fail } from '@endo/errors';
+import { E } from '@endo/eventual-send';
import {
makeScalarBigWeakMapStore,
prepareExoClass,
@@ -7,7 +9,6 @@ import {
provideDurableMapStore,
provideDurableWeakMapStore,
} from '@agoric/vat-data';
-import { E } from '@endo/eventual-send';
import { AmountMath } from '@agoric/ertp';
import { initEmpty, M } from '@agoric/store';
@@ -23,8 +24,6 @@ import {
import { makeAllocationMap } from './reallocate.js';
import { TransferPartShape } from '../contractSupport/atomicTransfer.js';
-const { Fail } = assert;
-
/**
* The SeatManager holds the active zcfSeats and can reallocate and
* make new zcfSeats.
@@ -181,7 +180,7 @@ export const createSeatManager = (
const { self } = this;
if (typeof reason === 'string') {
reason = Error(reason);
- assert.note(
+ annotateError(
reason,
'ZCFSeat.fail was called with a string reason, but requires an Error argument.',
);
diff --git a/packages/zoe/src/contractFacet/zcfZygote.js b/packages/zoe/src/contractFacet/zcfZygote.js
index fd6c0b335fd..b044f311ee7 100644
--- a/packages/zoe/src/contractFacet/zcfZygote.js
+++ b/packages/zoe/src/contractFacet/zcfZygote.js
@@ -1,4 +1,9 @@
/* eslint @typescript-eslint/no-floating-promises: "warn" */
+import { Fail } from '@endo/errors';
+import { E } from '@endo/eventual-send';
+import { passStyleOf } from '@endo/pass-style';
+import { makePromiseKit } from '@endo/promise-kit';
+
import { AssetKind } from '@agoric/ertp';
import { assertPattern, mustMatch } from '@agoric/store';
import {
@@ -9,11 +14,8 @@ import {
prepareExoClass,
provideDurableMapStore,
} from '@agoric/vat-data';
-import { E } from '@endo/eventual-send';
-import { passStyleOf } from '@endo/pass-style';
-import { makePromiseKit } from '@endo/promise-kit';
-
import { objectMap } from '@agoric/internal';
+
import { cleanProposal } from '../cleanProposal.js';
import { handlePKitWarning } from '../handleWarning.js';
import { makeInstanceRecordStorage } from '../instanceRecordStorage.js';
@@ -33,8 +35,6 @@ import { ZcfI } from './typeGuards.js';
/** @import {IssuerOptionsRecord} from '@agoric/ertp' */
-const { Fail } = assert;
-
/**
* Make the ZCF vat in zygote-usable form. First, a generic ZCF is
* made, then the contract code is evaluated, then a particular
diff --git a/packages/zoe/src/contractSupport/bondingCurves.js b/packages/zoe/src/contractSupport/bondingCurves.js
index 347561ee43a..0f81d25ff3e 100644
--- a/packages/zoe/src/contractSupport/bondingCurves.js
+++ b/packages/zoe/src/contractSupport/bondingCurves.js
@@ -1,10 +1,10 @@
// @jessie-check
import { Nat } from '@endo/nat';
+import { Fail } from '@endo/errors';
import { natSafeMath } from './safeMath.js';
const { subtract, add, multiply, floorDivide } = natSafeMath;
-const { Fail } = assert;
const BASIS_POINTS = 10000n; // TODO change to 10_000n once tooling copes.
diff --git a/packages/zoe/src/contractSupport/priceAuthority.js b/packages/zoe/src/contractSupport/priceAuthority.js
index 75c454a55e6..ae88e854ab0 100644
--- a/packages/zoe/src/contractSupport/priceAuthority.js
+++ b/packages/zoe/src/contractSupport/priceAuthority.js
@@ -1,7 +1,9 @@
/* eslint @typescript-eslint/no-floating-promises: "warn" */
+import { q, Fail } from '@endo/errors';
import { E } from '@endo/eventual-send';
import { Far } from '@endo/marshal';
import { makePromiseKit } from '@endo/promise-kit';
+
import { AmountMath, AmountShape, BrandShape } from '@agoric/ertp';
import { makeNotifier } from '@agoric/notifier';
import { makeTracer } from '@agoric/internal';
@@ -12,8 +14,6 @@ import { M } from '@agoric/store';
* @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery, PriceQuoteCreate, PriceAuthorityKit, PriceQuoteTrigger, MutableQuote,} from '@agoric/zoe/tools/types.js';
*/
-const { quote: q, Fail } = assert;
-
const trace = makeTracer('PA', false);
/**
diff --git a/packages/zoe/src/contractSupport/priceAuthorityTransform.js b/packages/zoe/src/contractSupport/priceAuthorityTransform.js
index fbfd509c707..ce2d79217b9 100644
--- a/packages/zoe/src/contractSupport/priceAuthorityTransform.js
+++ b/packages/zoe/src/contractSupport/priceAuthorityTransform.js
@@ -1,6 +1,6 @@
+import { Fail, assert } from '@endo/errors';
import { E } from '@endo/eventual-send';
import { Far } from '@endo/marshal';
-import { Fail, assert } from '@agoric/assert';
import { AmountMath } from '@agoric/ertp';
import { makeNotifier } from '@agoric/notifier';
diff --git a/packages/zoe/src/contractSupport/priceQuote.js b/packages/zoe/src/contractSupport/priceQuote.js
index ff8b22e4c6b..33d18db434e 100644
--- a/packages/zoe/src/contractSupport/priceQuote.js
+++ b/packages/zoe/src/contractSupport/priceQuote.js
@@ -1,15 +1,14 @@
// @jessie-check
-import { AmountMath } from '@agoric/ertp';
+import { Fail } from '@endo/errors';
import { Nat } from '@endo/nat';
import { E } from '@endo/eventual-send';
+import { AmountMath } from '@agoric/ertp';
/**
* @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js';
*/
-const { Fail } = assert;
-
// PriceAuthorities return quotes as a pair of an amount and a payment, both
// with the same value. The underlying amount wraps amountIn, amountOut, timer
// and timestamp. The payment is issued by the quoteIssuer to support veracity
diff --git a/packages/zoe/src/contractSupport/ratio.js b/packages/zoe/src/contractSupport/ratio.js
index 7635ce7d7b8..9beb84852c5 100644
--- a/packages/zoe/src/contractSupport/ratio.js
+++ b/packages/zoe/src/contractSupport/ratio.js
@@ -1,5 +1,5 @@
///
-import { q, Fail } from '@agoric/assert';
+import { q, Fail } from '@endo/errors';
import { AmountMath } from '@agoric/ertp';
import { assertRecord } from '@endo/marshal';
import { isNat } from '@endo/nat';
diff --git a/packages/zoe/src/contractSupport/recorder.js b/packages/zoe/src/contractSupport/recorder.js
index 7c9e63f7536..65c0d7d324d 100644
--- a/packages/zoe/src/contractSupport/recorder.js
+++ b/packages/zoe/src/contractSupport/recorder.js
@@ -1,4 +1,4 @@
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import { StorageNodeShape } from '@agoric/internal';
import { prepareDurablePublishKit } from '@agoric/notifier';
import {
diff --git a/packages/zoe/src/contractSupport/stateMachine.js b/packages/zoe/src/contractSupport/stateMachine.js
index 2f505a370ef..eb4e3296927 100644
--- a/packages/zoe/src/contractSupport/stateMachine.js
+++ b/packages/zoe/src/contractSupport/stateMachine.js
@@ -1,4 +1,4 @@
-import { assert } from '@agoric/assert';
+import { assert } from '@endo/errors';
/* allowedTransitions is an array of arrays which gets turned into a
* map. The map maps string states to an array of potential next
diff --git a/packages/zoe/src/contractSupport/zoeHelpers.js b/packages/zoe/src/contractSupport/zoeHelpers.js
index 74c4b683a6e..b206f0b53ed 100644
--- a/packages/zoe/src/contractSupport/zoeHelpers.js
+++ b/packages/zoe/src/contractSupport/zoeHelpers.js
@@ -1,7 +1,8 @@
/* eslint @typescript-eslint/no-floating-promises: "warn" */
-import { mustMatch, keyEQ } from '@agoric/store';
+import { Fail } from '@endo/errors';
import { E } from '@endo/eventual-send';
import { makePromiseKit } from '@endo/promise-kit';
+import { mustMatch, keyEQ } from '@agoric/store';
import { AssetKind } from '@agoric/ertp';
import { fromUniqueEntries } from '@agoric/internal';
import { satisfiesWant } from '../contractFacet/offerSafety.js';
@@ -9,8 +10,6 @@ import { atomicTransfer, fromOnly, toOnly } from './atomicTransfer.js';
export const defaultAcceptanceMsg = `The offer has been accepted. Once the contract has been completed, please check your payout`;
-const { Fail } = assert;
-
const getKeysSorted = obj => harden(Reflect.ownKeys(obj || {}).sort());
export const assertIssuerKeywords = (zcf, expected) => {
diff --git a/packages/zoe/src/contracts/auction/assertBidSeat.js b/packages/zoe/src/contracts/auction/assertBidSeat.js
index 84a9626b057..be392b81187 100644
--- a/packages/zoe/src/contracts/auction/assertBidSeat.js
+++ b/packages/zoe/src/contracts/auction/assertBidSeat.js
@@ -1,4 +1,4 @@
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import { AmountMath } from '@agoric/ertp';
export const assertBidSeat = (zcf, sellSeat, bidSeat) => {
diff --git a/packages/zoe/src/contracts/auction/index.js b/packages/zoe/src/contracts/auction/index.js
index 149699f2c7c..d6b2f432960 100644
--- a/packages/zoe/src/contracts/auction/index.js
+++ b/packages/zoe/src/contracts/auction/index.js
@@ -1,4 +1,5 @@
/* eslint @typescript-eslint/no-floating-promises: "warn" */
+import { Fail } from '@endo/errors';
import { E } from '@endo/eventual-send';
import { mustMatch } from '@endo/patterns';
import { Far } from '@endo/marshal';
@@ -14,8 +15,6 @@ import * as secondPriceLogic from './secondPriceLogic.js';
import * as firstPriceLogic from './firstPriceLogic.js';
import { assertBidSeat } from './assertBidSeat.js';
-const { Fail } = assert;
-
const FIRST_PRICE = 'first-price';
const SECOND_PRICE = 'second-price';
diff --git a/packages/zoe/src/contracts/autoswap.js b/packages/zoe/src/contracts/autoswap.js
index 40939bbf65d..6b9d673253a 100644
--- a/packages/zoe/src/contracts/autoswap.js
+++ b/packages/zoe/src/contracts/autoswap.js
@@ -1,5 +1,5 @@
+import { assert } from '@endo/errors';
import { Far } from '@endo/marshal';
-import { assert } from '@agoric/assert';
import { AmountMath, isNatValue } from '@agoric/ertp';
// Eventually will be importable from '@agoric/zoe-contract-support'
diff --git a/packages/zoe/src/contracts/callSpread/calculateShares.js b/packages/zoe/src/contracts/callSpread/calculateShares.js
index 47bd8a781d9..7f1de802d54 100644
--- a/packages/zoe/src/contracts/callSpread/calculateShares.js
+++ b/packages/zoe/src/contracts/callSpread/calculateShares.js
@@ -1,7 +1,7 @@
///
+import { assert } from '@endo/errors';
import { AmountMath, isNatValue } from '@agoric/ertp';
-import { assert } from '@agoric/assert';
import { makeRatio, oneMinus } from '../../contractSupport/index.js';
import { make100Percent, make0Percent } from './percent.js';
diff --git a/packages/zoe/src/contracts/callSpread/pricedCallSpread.js b/packages/zoe/src/contracts/callSpread/pricedCallSpread.js
index 929a2c0da4f..358124b2da3 100644
--- a/packages/zoe/src/contracts/callSpread/pricedCallSpread.js
+++ b/packages/zoe/src/contracts/callSpread/pricedCallSpread.js
@@ -1,6 +1,7 @@
/* eslint @typescript-eslint/no-floating-promises: "warn" */
///
+import { Fail } from '@endo/errors';
import { makePromiseKit } from '@endo/promise-kit';
import { E } from '@endo/eventual-send';
import { Far } from '@endo/marshal';
@@ -19,8 +20,6 @@ import { Position } from './position.js';
* @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js';
*/
-const { Fail } = assert;
-
const PERCENT_BASE = 100n;
const BASIS_POINTS = 10000n;
diff --git a/packages/zoe/src/contracts/coveredCall-durable.js b/packages/zoe/src/contracts/coveredCall-durable.js
index 1b161576217..bcac0693003 100644
--- a/packages/zoe/src/contracts/coveredCall-durable.js
+++ b/packages/zoe/src/contracts/coveredCall-durable.js
@@ -1,10 +1,9 @@
+import { Fail } from '@endo/errors';
import { mustMatch, M } from '@agoric/store';
import { prepareExo, prepareExoClass } from '@agoric/vat-data';
import { swapExact } from '../contractSupport/index.js';
import { isAfterDeadlineExitRule, OfferHandlerI } from '../typeGuards.js';
-const { Fail } = assert;
-
const sellSeatExpiredMsg = 'The covered call option is expired.';
/**
diff --git a/packages/zoe/src/contracts/coveredCall.js b/packages/zoe/src/contracts/coveredCall.js
index 09228dab326..1f441aebb57 100644
--- a/packages/zoe/src/contracts/coveredCall.js
+++ b/packages/zoe/src/contracts/coveredCall.js
@@ -1,10 +1,9 @@
+import { Fail, q } from '@endo/errors';
import { M, mustMatch } from '@agoric/store';
// Eventually will be importable from '@agoric/zoe-contract-support'
import { swapExact } from '../contractSupport/index.js';
import { isAfterDeadlineExitRule } from '../typeGuards.js';
-const { Fail, quote: q } = assert;
-
/**
* A call option is the right (but not the obligation) to buy digital
* assets at a pre-determined price, called the strike price. This
diff --git a/packages/zoe/src/contracts/loan/borrow.js b/packages/zoe/src/contracts/loan/borrow.js
index af720c00e9d..aca8c6fc426 100644
--- a/packages/zoe/src/contracts/loan/borrow.js
+++ b/packages/zoe/src/contracts/loan/borrow.js
@@ -1,4 +1,4 @@
-import { assert, Fail } from '@agoric/assert';
+import { assert, Fail } from '@endo/errors';
import { E } from '@endo/eventual-send';
import { Far } from '@endo/marshal';
import { makePromiseKit } from '@endo/promise-kit';
diff --git a/packages/zoe/src/contracts/loan/close.js b/packages/zoe/src/contracts/loan/close.js
index 5a83051bd01..38db51aa9e0 100644
--- a/packages/zoe/src/contracts/loan/close.js
+++ b/packages/zoe/src/contracts/loan/close.js
@@ -1,6 +1,6 @@
///
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import { AmountMath } from '@agoric/ertp';
import { assertProposalShape } from '../../contractSupport/index.js';
diff --git a/packages/zoe/src/contracts/loan/updateDebt.js b/packages/zoe/src/contracts/loan/updateDebt.js
index 94c4678e405..8930d806492 100644
--- a/packages/zoe/src/contracts/loan/updateDebt.js
+++ b/packages/zoe/src/contracts/loan/updateDebt.js
@@ -1,6 +1,6 @@
+import { annotateError, X } from '@endo/errors';
import { Far } from '@endo/marshal';
import { makeNotifierKit, observeNotifier } from '@agoric/notifier';
-import { assert, details as X } from '@agoric/assert';
import { AmountMath } from '@agoric/ertp';
import { TimeMath } from '@agoric/time';
@@ -70,7 +70,7 @@ export const makeDebtCalculator = debtCalculatorConfig => {
}
},
fail: reason => {
- assert.note(
+ annotateError(
reason,
X`Period problem: ${originalDebt}, started: ${basetime}, debt: ${debt}`,
);
@@ -79,7 +79,7 @@ export const makeDebtCalculator = debtCalculatorConfig => {
});
observeNotifier(periodNotifier, periodObserver).catch(reason => {
- assert.note(
+ annotateError(
reason,
X`Unable to updateDebt originally: ${originalDebt}, started: ${basetime}, debt: ${debt}`,
);
diff --git a/packages/zoe/src/contracts/mintAndSellNFT.js b/packages/zoe/src/contracts/mintAndSellNFT.js
index ae8f7863239..f1531a70130 100644
--- a/packages/zoe/src/contracts/mintAndSellNFT.js
+++ b/packages/zoe/src/contracts/mintAndSellNFT.js
@@ -1,8 +1,8 @@
+import { assert } from '@endo/errors';
import { makeIssuerKit, AssetKind, AmountMath } from '@agoric/ertp';
import { E } from '@endo/eventual-send';
import { Far } from '@endo/marshal';
-import { assert } from '@agoric/assert';
import { notForProductionUse } from '@agoric/internal/src/magic-cookie-test-only.js';
/**
diff --git a/packages/zoe/src/contracts/oracle.js b/packages/zoe/src/contracts/oracle.js
index a15bcc11184..f9338017418 100644
--- a/packages/zoe/src/contracts/oracle.js
+++ b/packages/zoe/src/contracts/oracle.js
@@ -1,5 +1,5 @@
/* eslint @typescript-eslint/no-floating-promises: "warn" */
-import { assert, Fail } from '@agoric/assert';
+import { assert, Fail } from '@endo/errors';
import { Far } from '@endo/marshal';
import { AmountMath } from '@agoric/ertp';
diff --git a/packages/zoe/src/contracts/otcDesk.js b/packages/zoe/src/contracts/otcDesk.js
index 6259dfa1791..483f4e842f7 100644
--- a/packages/zoe/src/contracts/otcDesk.js
+++ b/packages/zoe/src/contracts/otcDesk.js
@@ -1,5 +1,5 @@
+import { assert } from '@endo/errors';
import { E } from '@endo/eventual-send';
-import { assert } from '@agoric/assert';
import { Far } from '@endo/marshal';
import {
offerTo,
diff --git a/packages/zoe/src/contracts/priceAggregator.js b/packages/zoe/src/contracts/priceAggregator.js
index 81be2fb4ecf..768a20c3b81 100644
--- a/packages/zoe/src/contracts/priceAggregator.js
+++ b/packages/zoe/src/contracts/priceAggregator.js
@@ -1,5 +1,5 @@
/* eslint @typescript-eslint/no-floating-promises: "warn" */
-import { Fail, q } from '@agoric/assert';
+import { Fail, q } from '@endo/errors';
import { AmountMath, AssetKind, makeIssuerKit } from '@agoric/ertp';
import { assertAllDefined } from '@agoric/internal';
import {
diff --git a/packages/zoe/src/contracts/sellItems.js b/packages/zoe/src/contracts/sellItems.js
index c4dd855922c..4a53a8536c1 100644
--- a/packages/zoe/src/contracts/sellItems.js
+++ b/packages/zoe/src/contracts/sellItems.js
@@ -1,4 +1,5 @@
/* eslint @typescript-eslint/no-floating-promises: "warn" */
+import { Fail } from '@endo/errors';
import { Far } from '@endo/marshal';
import { Nat } from '@endo/nat';
import { AmountMath } from '@agoric/ertp';
@@ -14,8 +15,6 @@ import {
assertNatAssetKind,
} from '../contractSupport/index.js';
-const { Fail } = assert;
-
/**
* Sell items in exchange for money. Items may be fungible or
* non-fungible and multiple items may be bought at once. Money must
diff --git a/packages/zoe/src/instanceRecordStorage.js b/packages/zoe/src/instanceRecordStorage.js
index caa99f02c76..34faf24500f 100644
--- a/packages/zoe/src/instanceRecordStorage.js
+++ b/packages/zoe/src/instanceRecordStorage.js
@@ -1,3 +1,4 @@
+import { q, Fail } from '@endo/errors';
import { provide, prepareExoClass, M } from '@agoric/vat-data';
import { assertKeywordName } from './cleanProposal.js';
import {
@@ -12,8 +13,6 @@ import {
const { ownKeys } = Reflect;
-const { quote: q, Fail } = assert;
-
/**
* The InstanceRecord stores the installation, customTerms, issuers,
* and brands for a particular Zoe contract instance. The installation
diff --git a/packages/zoe/src/issuerRecord.js b/packages/zoe/src/issuerRecord.js
index 60c1da35ffa..4c2071a192b 100644
--- a/packages/zoe/src/issuerRecord.js
+++ b/packages/zoe/src/issuerRecord.js
@@ -1,5 +1,5 @@
// @jessie-check
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
/**
* Put together information about the issuer in a standard format that
diff --git a/packages/zoe/src/issuerStorage.js b/packages/zoe/src/issuerStorage.js
index 55f776d35e5..74cecc7565c 100644
--- a/packages/zoe/src/issuerStorage.js
+++ b/packages/zoe/src/issuerStorage.js
@@ -1,12 +1,11 @@
+import { Fail } from '@endo/errors';
+import { E } from '@endo/eventual-send';
import { deeplyFulfilledObject, objectMap } from '@agoric/internal';
import { provideDurableWeakMapStore } from '@agoric/vat-data';
-import { E } from '@endo/eventual-send';
import { cleanKeywords } from './cleanProposal.js';
import { makeIssuerRecord } from './issuerRecord.js';
-const { Fail } = assert;
-
const STORAGE_INSTANTIATED_KEY = 'IssuerStorageInstantiated';
/**
diff --git a/packages/zoe/src/makeHandle.js b/packages/zoe/src/makeHandle.js
index f01c046c532..8801e011fd7 100644
--- a/packages/zoe/src/makeHandle.js
+++ b/packages/zoe/src/makeHandle.js
@@ -1,13 +1,11 @@
// @jessie-check
-import { assert } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import { initEmpty, makeExo } from '@agoric/store';
import { prepareExoClass } from '@agoric/vat-data';
import { HandleI } from './typeGuards.js';
-const { Fail } = assert;
-
/** @import {Baggage} from '@agoric/vat-data' */
/**
diff --git a/packages/zoe/src/zoeService/createZCFVat.js b/packages/zoe/src/zoeService/createZCFVat.js
index e1437e7b7e6..003f8989bf2 100644
--- a/packages/zoe/src/zoeService/createZCFVat.js
+++ b/packages/zoe/src/zoeService/createZCFVat.js
@@ -2,7 +2,7 @@
import { E } from '@endo/eventual-send';
-const { Fail, quote: q } = assert;
+import { Fail, q } from '@endo/errors';
export const getZcfBundleCap = (zcfSpec, vatAdminSvc) => {
let zcfBundleCapP;
diff --git a/packages/zoe/src/zoeService/escrowStorage.js b/packages/zoe/src/zoeService/escrowStorage.js
index 6c20944d02b..e256014b242 100644
--- a/packages/zoe/src/zoeService/escrowStorage.js
+++ b/packages/zoe/src/zoeService/escrowStorage.js
@@ -1,6 +1,6 @@
import { AmountMath } from '@agoric/ertp';
import { E } from '@endo/eventual-send';
-import { q, Fail } from '@agoric/assert';
+import { q, Fail } from '@endo/errors';
import { deeplyFulfilledObject, objectMap } from '@agoric/internal';
import { provideDurableWeakMapStore } from '@agoric/vat-data';
diff --git a/packages/zoe/src/zoeService/feeMint.js b/packages/zoe/src/zoeService/feeMint.js
index b56089f8bae..a8f9771707b 100644
--- a/packages/zoe/src/zoeService/feeMint.js
+++ b/packages/zoe/src/zoeService/feeMint.js
@@ -11,10 +11,9 @@ import {
provide,
prepareExoClassKit,
} from '@agoric/vat-data';
+import { Fail, q } from '@endo/errors';
import { FeeMintAccessShape } from '../typeGuards.js';
-const { Fail, quote: q } = assert;
-
/** @deprecated Redundant. Just omit it. */
const FEE_MINT_KIT = 'FeeMintKit';
diff --git a/packages/zoe/src/zoeService/installationStorage.js b/packages/zoe/src/zoeService/installationStorage.js
index 787474dc406..f931c68838a 100644
--- a/packages/zoe/src/zoeService/installationStorage.js
+++ b/packages/zoe/src/zoeService/installationStorage.js
@@ -1,4 +1,4 @@
-import { assert } from '@agoric/assert';
+import { Fail, q } from '@endo/errors';
import {
M,
prepareExo,
@@ -11,8 +11,6 @@ import {
UnwrappedInstallationShape,
} from '../typeGuards.js';
-const { Fail, quote: q } = assert;
-
/** @typedef { import('@agoric/swingset-vat').BundleCap} BundleCap */
/** @typedef { import('@agoric/swingset-vat').BundleID} BundleID */
/** @import {Baggage} from '@agoric/vat-data' */
diff --git a/packages/zoe/src/zoeService/instanceAdminStorage.js b/packages/zoe/src/zoeService/instanceAdminStorage.js
index 75061fc4aeb..084be650a14 100644
--- a/packages/zoe/src/zoeService/instanceAdminStorage.js
+++ b/packages/zoe/src/zoeService/instanceAdminStorage.js
@@ -9,6 +9,7 @@ import {
provide,
} from '@agoric/vat-data';
import { E } from '@endo/eventual-send';
+import { q, Fail } from '@endo/errors';
import { defineDurableHandle } from '../makeHandle.js';
import {
BrandKeywordRecordShape,
@@ -18,8 +19,6 @@ import {
} from '../typeGuards.js';
import { makeZoeSeatAdminFactory } from './zoeSeat.js';
-const { quote: q, Fail } = assert;
-
/**
* @file Two objects are defined here, both called InstanceAdminSomething.
* InstanceAdminStorage is a container for individual InstanceAdmins. Each
diff --git a/packages/zoe/src/zoeService/invitationQueries.js b/packages/zoe/src/zoeService/invitationQueries.js
index 6ba3dfad8aa..df5d670012a 100644
--- a/packages/zoe/src/zoeService/invitationQueries.js
+++ b/packages/zoe/src/zoeService/invitationQueries.js
@@ -1,16 +1,16 @@
// @jessie-check
-import { assert, details as X, Fail, quote as q } from '@agoric/assert';
+import { X, Fail, q, makeError, annotateError } from '@endo/errors';
import { E } from '@endo/eventual-send';
export const makeInvitationQueryFns = invitationIssuer => {
/** @type {GetInvitationDetails} */
const getInvitationDetails = async invitationP => {
const onRejected = reason => {
- const err = assert.error(
+ const err = makeError(
X`A Zoe invitation is required, not ${invitationP}`,
);
- assert.note(err, X`Due to ${reason}`);
+ annotateError(err, X`Due to ${reason}`);
throw err;
};
const invAmount = await E(invitationIssuer)
diff --git a/packages/zoe/src/zoeService/makeInvitation.js b/packages/zoe/src/zoeService/makeInvitation.js
index 5a755ed0d7a..b6e5c20242f 100644
--- a/packages/zoe/src/zoeService/makeInvitation.js
+++ b/packages/zoe/src/zoeService/makeInvitation.js
@@ -1,6 +1,6 @@
// @jessie-check
-import { Fail, q } from '@agoric/assert';
+import { Fail, q } from '@endo/errors';
import { provideDurableMapStore } from '@agoric/vat-data';
import { AssetKind, hasIssuer, prepareIssuerKit } from '@agoric/ertp';
import { InvitationElementShape } from '../typeGuards.js';
diff --git a/packages/zoe/src/zoeService/offer/burnInvitation.js b/packages/zoe/src/zoeService/offer/burnInvitation.js
index eb5b36e90c5..42b8c9dea05 100644
--- a/packages/zoe/src/zoeService/offer/burnInvitation.js
+++ b/packages/zoe/src/zoeService/offer/burnInvitation.js
@@ -1,6 +1,6 @@
// @jessie-check
-import { Fail, assert, details as X } from '@agoric/assert';
+import { Fail, assert, X, makeError, annotateError } from '@endo/errors';
import { E } from '@endo/eventual-send';
/**
@@ -16,10 +16,8 @@ import { E } from '@endo/eventual-send';
*/
export const burnInvitation = (invitationIssuer, invitation) => {
const handleRejected = reason => {
- const err = assert.error(
- X`A Zoe invitation is required, not ${invitation}`,
- );
- assert.note(err, X`Due to ${reason}`);
+ const err = makeError(X`A Zoe invitation is required, not ${invitation}`);
+ annotateError(err, X`Due to ${reason}`);
throw err;
};
const handleFulfilled = invitationAmount => {
diff --git a/packages/zoe/src/zoeService/offer/offer.js b/packages/zoe/src/zoeService/offer/offer.js
index 3e91ff977a9..092e3d9f223 100644
--- a/packages/zoe/src/zoeService/offer/offer.js
+++ b/packages/zoe/src/zoeService/offer/offer.js
@@ -1,5 +1,6 @@
// @jessie-check
+import { q, Fail } from '@endo/errors';
import { passStyleOf } from '@endo/marshal';
import { mustMatch } from '@agoric/store';
import { E } from '@endo/eventual-send';
@@ -10,8 +11,6 @@ import { makeInvitationQueryFns } from '../invitationQueries.js';
import '../internal-types.js';
-const { quote: q, Fail } = assert;
-
export const makeOfferMethod = offerDataAccess => {
/** @type {Offer} */
const offer = async (
diff --git a/packages/zoe/src/zoeService/originalZoeSeat.js b/packages/zoe/src/zoeService/originalZoeSeat.js
index 7970d07ec5b..cee45bd20dc 100644
--- a/packages/zoe/src/zoeService/originalZoeSeat.js
+++ b/packages/zoe/src/zoeService/originalZoeSeat.js
@@ -1,4 +1,5 @@
/* eslint @typescript-eslint/no-floating-promises: "warn" */
+import { Fail } from '@endo/errors';
import { SubscriberShape } from '@agoric/notifier';
import { E } from '@endo/eventual-send';
import { M, prepareExoClassKit } from '@agoric/vat-data';
@@ -15,8 +16,6 @@ import {
PaymentPKeywordRecordShape,
} from '../typeGuards.js';
-const { Fail } = assert;
-
export const coreUserSeatMethods = harden({
getProposal: M.call().returns(M.promise()),
getPayouts: M.call().returns(M.promise()),
diff --git a/packages/zoe/src/zoeService/startInstance.js b/packages/zoe/src/zoeService/startInstance.js
index 3219963f3c3..e729c1d9ce2 100644
--- a/packages/zoe/src/zoeService/startInstance.js
+++ b/packages/zoe/src/zoeService/startInstance.js
@@ -12,6 +12,7 @@ import {
import { initEmpty } from '@agoric/store';
import { isUpgradeDisconnection } from '@agoric/internal/src/upgrade-api.js';
+import { Fail, q } from '@endo/errors';
import { defineDurableHandle } from '../makeHandle.js';
import { makeInstanceAdminMaker } from './instanceAdminStorage.js';
import {
@@ -25,8 +26,6 @@ import {
/** @import {Baggage} from '@agoric/vat-data' */
/** @typedef { import('@agoric/swingset-vat').BundleCap} BundleCap */
-const { Fail, quote: q } = assert;
-
/**
* @param {Pick} startInstanceAccess
* @param {() => ERef} getZcfBundleCapP
diff --git a/packages/zoe/src/zoeService/zoe.js b/packages/zoe/src/zoeService/zoe.js
index 71abd32ce46..eb7d76a50ab 100644
--- a/packages/zoe/src/zoeService/zoe.js
+++ b/packages/zoe/src/zoeService/zoe.js
@@ -20,6 +20,7 @@ import { Far } from '@endo/marshal';
import { makeScalarBigMapStore, prepareExo } from '@agoric/vat-data';
import { M } from '@agoric/store';
+import { Fail } from '@endo/errors';
import { makeZoeStorageManager } from './zoeStorageManager.js';
import { makeStartInstance } from './startInstance.js';
import { makeOfferMethod } from './offer/offer.js';
@@ -30,8 +31,6 @@ import { ZoeServiceI } from '../typeGuards.js';
/** @import {Baggage} from '@agoric/vat-data' */
-const { Fail } = assert;
-
/**
* Create a durable instance of Zoe.
*
diff --git a/packages/zoe/src/zoeService/zoeSeat.js b/packages/zoe/src/zoeService/zoeSeat.js
index 926537792df..c6d58c6d29d 100644
--- a/packages/zoe/src/zoeService/zoeSeat.js
+++ b/packages/zoe/src/zoeService/zoeSeat.js
@@ -1,4 +1,5 @@
/* eslint @typescript-eslint/no-floating-promises: "warn" */
+import { Fail } from '@endo/errors';
import { prepareDurablePublishKit } from '@agoric/notifier';
import { E } from '@endo/eventual-send';
import { M, prepareExoClassKit } from '@agoric/vat-data';
@@ -15,8 +16,6 @@ import {
coreUserSeatMethods,
} from './originalZoeSeat.js';
-const { Fail } = assert;
-
// ZoeSeatAdmin has the implementation of coreUserSeatMethods, but ZoeUserSeat
// is the facet shared with users. The latter transparently forwards to the
// former.
diff --git a/packages/zoe/test/swingsetTests/brokenContracts/vat-alice.js b/packages/zoe/test/swingsetTests/brokenContracts/vat-alice.js
index 8d8cc167304..13f5921b9e1 100644
--- a/packages/zoe/test/swingsetTests/brokenContracts/vat-alice.js
+++ b/packages/zoe/test/swingsetTests/brokenContracts/vat-alice.js
@@ -1,8 +1,8 @@
// @ts-nocheck
+import { assert, X } from '@endo/errors';
import { E } from '@endo/eventual-send';
import { Far } from '@endo/marshal';
-import { assert, details as X } from '@agoric/assert';
import { showPurseBalance, setupIssuers } from '../helpers.js';
async function logCounter(log, publicAPI) {
diff --git a/packages/zoe/test/swingsetTests/upgradeCoveredCall/bootstrap-coveredCall-service-upgrade.js b/packages/zoe/test/swingsetTests/upgradeCoveredCall/bootstrap-coveredCall-service-upgrade.js
index 3a40423e9ad..90c0faeb701 100644
--- a/packages/zoe/test/swingsetTests/upgradeCoveredCall/bootstrap-coveredCall-service-upgrade.js
+++ b/packages/zoe/test/swingsetTests/upgradeCoveredCall/bootstrap-coveredCall-service-upgrade.js
@@ -1,10 +1,9 @@
+import { q, X } from '@endo/errors';
import { E } from '@endo/eventual-send';
import { Far } from '@endo/marshal';
import { AmountMath } from '@agoric/ertp';
import buildManualTimer from '../../../tools/manualTimer.js';
-const { quote: q, details: X } = assert;
-
const mintInto = (kit, purse, value) =>
E(kit.mint)
.mintPayment(AmountMath.make(kit.brand, value))
diff --git a/packages/zoe/test/swingsetTests/upgradeCoveredCall/coveredCall-durable-V3.js b/packages/zoe/test/swingsetTests/upgradeCoveredCall/coveredCall-durable-V3.js
index b44f6dc3d37..5391381995c 100644
--- a/packages/zoe/test/swingsetTests/upgradeCoveredCall/coveredCall-durable-V3.js
+++ b/packages/zoe/test/swingsetTests/upgradeCoveredCall/coveredCall-durable-V3.js
@@ -1,5 +1,5 @@
+import { X } from '@endo/errors';
import { M, mustMatch } from '@agoric/store';
-
import { prepareExoClass, prepareExo } from '@agoric/vat-data';
import { swapExact } from '../../../src/contractSupport/index.js';
import {
@@ -8,8 +8,6 @@ import {
OfferHandlerI,
} from '../../../src/typeGuards.js';
-const { details: X } = assert;
-
const sellSeatExpiredMsg = 'The covered call option is expired.';
/** @type {ContractMeta} */
diff --git a/packages/zoe/test/swingsetTests/upgradeCoveredCall/coveredCall-service-upgrade.test.js b/packages/zoe/test/swingsetTests/upgradeCoveredCall/coveredCall-service-upgrade.test.js
index dcc10a1543b..0b78463dc3d 100644
--- a/packages/zoe/test/swingsetTests/upgradeCoveredCall/coveredCall-service-upgrade.test.js
+++ b/packages/zoe/test/swingsetTests/upgradeCoveredCall/coveredCall-service-upgrade.test.js
@@ -1,6 +1,6 @@
import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava.js';
-import { assert } from '@agoric/assert';
+import { assert } from '@endo/errors';
import { buildVatController } from '@agoric/swingset-vat';
const bfile = name => new URL(name, import.meta.url).pathname;
diff --git a/packages/zoe/test/swingsetTests/zoe/vat-alice.js b/packages/zoe/test/swingsetTests/zoe/vat-alice.js
index 7e6d66c74dc..774c6aa5960 100644
--- a/packages/zoe/test/swingsetTests/zoe/vat-alice.js
+++ b/packages/zoe/test/swingsetTests/zoe/vat-alice.js
@@ -1,6 +1,6 @@
+import { assert, X } from '@endo/errors';
import { E } from '@endo/eventual-send';
import { Far } from '@endo/marshal';
-import { assert, details as X } from '@agoric/assert';
import { AmountMath } from '@agoric/ertp';
import { showPurseBalance, setupIssuers } from '../helpers.js';
diff --git a/packages/zoe/test/swingsetTests/zoe/vat-bob.js b/packages/zoe/test/swingsetTests/zoe/vat-bob.js
index c236266ae13..55eacaa551d 100644
--- a/packages/zoe/test/swingsetTests/zoe/vat-bob.js
+++ b/packages/zoe/test/swingsetTests/zoe/vat-bob.js
@@ -1,6 +1,6 @@
+import { assert, X } from '@endo/errors';
import { E } from '@endo/eventual-send';
import { Far } from '@endo/marshal';
-import { assert, details as X } from '@agoric/assert';
import { keyEQ } from '@agoric/store';
import { AmountMath, isSetValue } from '@agoric/ertp';
import { claim } from '@agoric/ertp/src/legacy-payment-helpers.js';
diff --git a/packages/zoe/test/swingsetTests/zoe/vat-carol.js b/packages/zoe/test/swingsetTests/zoe/vat-carol.js
index 717ae70ca7e..eba052ca353 100644
--- a/packages/zoe/test/swingsetTests/zoe/vat-carol.js
+++ b/packages/zoe/test/swingsetTests/zoe/vat-carol.js
@@ -1,6 +1,6 @@
+import { assert, X } from '@endo/errors';
import { E } from '@endo/eventual-send';
import { Far } from '@endo/marshal';
-import { assert, details as X } from '@agoric/assert';
import { keyEQ } from '@agoric/store';
import { claim } from '@agoric/ertp/src/legacy-payment-helpers.js';
import { showPurseBalance, setupIssuers } from '../helpers.js';
diff --git a/packages/zoe/test/swingsetTests/zoe/vat-dave.js b/packages/zoe/test/swingsetTests/zoe/vat-dave.js
index f6eba02fe3c..38a56fc53e9 100644
--- a/packages/zoe/test/swingsetTests/zoe/vat-dave.js
+++ b/packages/zoe/test/swingsetTests/zoe/vat-dave.js
@@ -1,6 +1,6 @@
+import { assert, X, Fail } from '@endo/errors';
import { E } from '@endo/eventual-send';
import { Far } from '@endo/marshal';
-import { assert, details as X, Fail } from '@agoric/assert';
import { keyEQ } from '@agoric/store';
import { AmountMath } from '@agoric/ertp';
import { claim } from '@agoric/ertp/src/legacy-payment-helpers.js';
diff --git a/packages/zoe/test/unitTests/bounty.js b/packages/zoe/test/unitTests/bounty.js
index 0882826b1ee..bfec6ca4185 100644
--- a/packages/zoe/test/unitTests/bounty.js
+++ b/packages/zoe/test/unitTests/bounty.js
@@ -1,6 +1,6 @@
+import { assert, X } from '@endo/errors';
import { E } from '@endo/eventual-send';
import { Far } from '@endo/marshal';
-import { assert, details as X } from '@agoric/assert';
import { AmountMath } from '@agoric/ertp';
/**
diff --git a/packages/zoe/test/unitTests/contracts/escrowToVote.js b/packages/zoe/test/unitTests/contracts/escrowToVote.js
index eb342e1275f..9d3f83ee612 100644
--- a/packages/zoe/test/unitTests/contracts/escrowToVote.js
+++ b/packages/zoe/test/unitTests/contracts/escrowToVote.js
@@ -1,5 +1,6 @@
// @ts-nocheck
+import { X, q } from '@endo/errors';
import { Far } from '@endo/marshal';
import { makeScalarMapStore } from '@agoric/store';
import { AmountMath } from '@agoric/ertp';
@@ -10,8 +11,6 @@ import {
assertNatAssetKind,
} from '../../../src/contractSupport/index.js';
-const { details: X, quote: q } = assert;
-
/**
* This contract implements coin voting. There are two roles: the
* Secretary, who can determine the question (a string), make voting
diff --git a/packages/zoe/test/unitTests/contracts/oracle.test.js b/packages/zoe/test/unitTests/contracts/oracle.test.js
index 2f3b36e463a..4680c10fd64 100644
--- a/packages/zoe/test/unitTests/contracts/oracle.test.js
+++ b/packages/zoe/test/unitTests/contracts/oracle.test.js
@@ -2,13 +2,13 @@ import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava.js';
import path from 'path';
+import { assert, X } from '@endo/errors';
import bundleSource from '@endo/bundle-source';
-
-import { makeIssuerKit, AssetKind, AmountMath } from '@agoric/ertp';
import { Far } from '@endo/marshal';
-import { assert, details as X } from '@agoric/assert';
import { E } from '@endo/eventual-send';
+import { makeIssuerKit, AssetKind, AmountMath } from '@agoric/ertp';
+
import { makeFakeVatAdmin } from '../../../tools/fakeVatAdmin.js';
import { makeZoeForTest } from '../../../tools/setup-zoe.js';
diff --git a/packages/zoe/test/unitTests/contracts/sellTickets.test.js b/packages/zoe/test/unitTests/contracts/sellTickets.test.js
index 931fc4b83a5..92e86ea357a 100644
--- a/packages/zoe/test/unitTests/contracts/sellTickets.test.js
+++ b/packages/zoe/test/unitTests/contracts/sellTickets.test.js
@@ -2,7 +2,7 @@ import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava.js';
import path from 'path';
-import { assert } from '@agoric/assert';
+import { assert } from '@endo/errors';
import bundleSource from '@endo/bundle-source';
import { makeIssuerKit, AmountMath, isSetValue } from '@agoric/ertp';
import { claim } from '@agoric/ertp/src/legacy-payment-helpers.js';
diff --git a/packages/zoe/test/unitTests/contracts/useObjExample.js b/packages/zoe/test/unitTests/contracts/useObjExample.js
index 599971e7e5e..f627d91516f 100644
--- a/packages/zoe/test/unitTests/contracts/useObjExample.js
+++ b/packages/zoe/test/unitTests/contracts/useObjExample.js
@@ -1,3 +1,4 @@
+import { X } from '@endo/errors';
import { Far } from '@endo/marshal';
import { AmountMath } from '@agoric/ertp';
@@ -7,8 +8,6 @@ import {
assertProposalShape,
} from '../../../src/contractSupport/index.js';
-const { details: X } = assert;
-
/**
* Give a use object when a payment is escrowed
*
diff --git a/packages/zoe/test/unitTests/fakePriceAuthority.test.js b/packages/zoe/test/unitTests/fakePriceAuthority.test.js
index 12150ed6620..6ebef43ddf7 100644
--- a/packages/zoe/test/unitTests/fakePriceAuthority.test.js
+++ b/packages/zoe/test/unitTests/fakePriceAuthority.test.js
@@ -1,7 +1,7 @@
import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava.js';
+import { assert } from '@endo/errors';
import { E } from '@endo/eventual-send';
-import { assert } from '@agoric/assert';
import { TimeMath } from '@agoric/time';
import { eventLoopIteration } from '@agoric/internal/src/testing-utils.js';
import buildManualTimer from '../../tools/manualTimer.js';
diff --git a/packages/zoe/test/unitTests/makeOffer.js b/packages/zoe/test/unitTests/makeOffer.js
index 7469daf71cb..ece49066122 100644
--- a/packages/zoe/test/unitTests/makeOffer.js
+++ b/packages/zoe/test/unitTests/makeOffer.js
@@ -1,5 +1,5 @@
+import { assert } from '@endo/errors';
import { E } from '@endo/eventual-send';
-import { assert } from '@agoric/assert';
/**
* @param {ERef} zoe
diff --git a/packages/zoe/test/unitTests/scriptedOracle.test.js b/packages/zoe/test/unitTests/scriptedOracle.test.js
index bb955b1ba75..adea4c055ad 100644
--- a/packages/zoe/test/unitTests/scriptedOracle.test.js
+++ b/packages/zoe/test/unitTests/scriptedOracle.test.js
@@ -3,12 +3,12 @@ import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava.js';
import path from 'path';
+import { assert } from '@endo/errors';
import bundleSource from '@endo/bundle-source';
import { E } from '@endo/eventual-send';
import { eventLoopIteration } from '@agoric/internal/src/testing-utils.js';
import { TimeMath } from '@agoric/time';
-import { assert } from '@agoric/assert';
import { makeFakeVatAdmin } from '../../tools/fakeVatAdmin.js';
import { makeZoeForTest } from '../../tools/setup-zoe.js';
diff --git a/packages/zoe/test/unitTests/zcf/setupZcfTest.js b/packages/zoe/test/unitTests/zcf/setupZcfTest.js
index 413a0dd72c7..350dd664e35 100644
--- a/packages/zoe/test/unitTests/zcf/setupZcfTest.js
+++ b/packages/zoe/test/unitTests/zcf/setupZcfTest.js
@@ -1,6 +1,6 @@
+import { assert } from '@endo/errors';
import { E } from '@endo/eventual-send';
import bundleSource from '@endo/bundle-source';
-import { assert } from '@agoric/assert';
import path from 'path';
diff --git a/packages/zoe/test/zoeTestHelpers.js b/packages/zoe/test/zoeTestHelpers.js
index 170e78236de..e857d1fecd0 100644
--- a/packages/zoe/test/zoeTestHelpers.js
+++ b/packages/zoe/test/zoeTestHelpers.js
@@ -1,9 +1,8 @@
+import { q } from '@endo/errors';
import { E } from '@endo/eventual-send';
import { AmountMath, assertValueGetHelpers } from '@agoric/ertp';
-import { q } from '@agoric/assert';
-
export const assertAmountsEqual = (t, amount, expected, label = '') => {
harden(amount);
harden(expected);
diff --git a/packages/zoe/tools/fakePriceAuthority.js b/packages/zoe/tools/fakePriceAuthority.js
index 3abdbca3ccb..f7b24db3ec6 100644
--- a/packages/zoe/tools/fakePriceAuthority.js
+++ b/packages/zoe/tools/fakePriceAuthority.js
@@ -1,11 +1,13 @@
-import { makeIssuerKit, AssetKind, AmountMath } from '@agoric/ertp';
+import { Fail } from '@endo/errors';
import { makePromiseKit } from '@endo/promise-kit';
+import { E } from '@endo/eventual-send';
+import { Far } from '@endo/marshal';
+
+import { makeIssuerKit, AssetKind, AmountMath } from '@agoric/ertp';
import {
makeNotifierKit,
makeNotifierFromAsyncIterable,
} from '@agoric/notifier';
-import { E } from '@endo/eventual-send';
-import { Far } from '@endo/marshal';
import { TimeMath } from '@agoric/time';
import { natSafeMath } from '../src/contractSupport/index.js';
@@ -14,7 +16,6 @@ import { natSafeMath } from '../src/contractSupport/index.js';
* @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js';
*/
-const { Fail } = assert;
const { coerceRelativeTimeRecord } = TimeMath;
// 'if (a >= b)' becomes 'if (timestampGTE(a,b))'
diff --git a/packages/zoe/tools/fakeVatAdmin.js b/packages/zoe/tools/fakeVatAdmin.js
index 8587db4e19a..d56565079b5 100644
--- a/packages/zoe/tools/fakeVatAdmin.js
+++ b/packages/zoe/tools/fakeVatAdmin.js
@@ -1,6 +1,6 @@
// @jessie-check
-import { Fail } from '@agoric/assert';
+import { Fail } from '@endo/errors';
import { E } from '@endo/eventual-send';
import { makePromiseKit } from '@endo/promise-kit';
import { Far } from '@endo/marshal';
diff --git a/packages/zoe/tools/manualTimer.js b/packages/zoe/tools/manualTimer.js
index 50e07512734..f833e2e2e83 100644
--- a/packages/zoe/tools/manualTimer.js
+++ b/packages/zoe/tools/manualTimer.js
@@ -1,3 +1,4 @@
+import { Fail } from '@endo/errors';
import { Far } from '@endo/marshal';
import { bindAllMethods } from '@agoric/internal';
import { buildManualTimer } from '@agoric/swingset-vat/tools/manual-timer.js';
@@ -9,8 +10,6 @@ import { TimeMath } from '@agoric/time';
* @import {RemotableBrand} from '@endo/eventual-send';
*/
-const { Fail } = assert;
-
// we wrap SwingSet's buildManualTimer to accomodate the needs of
// zoe's tests
diff --git a/packages/zone/package.json b/packages/zone/package.json
index d496c7b32e6..32851e8aa00 100644
--- a/packages/zone/package.json
+++ b/packages/zone/package.json
@@ -29,6 +29,7 @@
"dependencies": {
"@agoric/base-zone": "^0.1.0",
"@agoric/vat-data": "^0.5.2",
+ "@endo/errors": "^1.2.2",
"@endo/far": "^1.1.2",
"@endo/pass-style": "^1.4.0"
},
diff --git a/packages/zone/src/durable.js b/packages/zone/src/durable.js
index 34bcb69cd51..24f8093a088 100644
--- a/packages/zone/src/durable.js
+++ b/packages/zone/src/durable.js
@@ -1,7 +1,9 @@
// @ts-check
// @jessie-check
+import { Fail } from '@endo/errors';
import { Far, isPassable } from '@endo/pass-style';
+
import {
canBeDurable,
makeScalarMapStore,
@@ -17,8 +19,6 @@ import {
import { agoricVatDataKeys as keys, makeOnceKit } from '@agoric/base-zone';
-const { Fail } = assert;
-
/**
* A variant of `canBeDurable` that returns `false` instead of ever throwing.
*