Skip to content

Commit

Permalink
refactor(store): Use @endo/(pass-style,patterns,exo) and drop our sta…
Browse files Browse the repository at this point in the history
…le copies
  • Loading branch information
erights committed Apr 15, 2023
1 parent 795c564 commit 3742272
Show file tree
Hide file tree
Showing 44 changed files with 150 additions and 5,818 deletions.
2 changes: 1 addition & 1 deletion packages/ERTP/src/paymentLedger.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const { details: X, quote: q, Fail } = assert;
/**
* @param {Brand} brand
* @param {AssetKind} assetKind
* @param {Matcher} elementShape
* @param {Pattern} elementShape
*/
const amountShapeFromElementShape = (brand, assetKind, elementShape) => {
let valueShape;
Expand Down
3 changes: 1 addition & 2 deletions packages/agoric-cli/src/follow.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// @ts-check
import process from 'process';
import { Far, getInterfaceOf } from '@endo/marshal';
import { decodeToJustin } from '@endo/marshal/src/marshal-justin.js';
import { Far, getInterfaceOf, decodeToJustin } from '@endo/marshal';

import {
iterateLatest,
Expand Down
5 changes: 1 addition & 4 deletions packages/deploy-script-support/src/code-gen.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// @ts-check
import { makeMarshal } from '@endo/marshal';
import { decodeToJustin } from '@endo/marshal/src/marshal-justin.js';

export { deeplyFulfilled } from '@endo/marshal';
import { makeMarshal, decodeToJustin } from '@endo/marshal';

const { keys, values, fromEntries } = Object;

Expand Down
2 changes: 1 addition & 1 deletion packages/deploy-script-support/src/depositInvitation.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const makeDepositInvitation = zoeInvitationPurse => {
/**
* @param {ERef<Invitation>} invitationP
* @returns {Promise<InvitationDetails>}
* */
*/
const depositInvitation = async invitationP => {
const invitation = await invitationP;
// Deposit returns the amount deposited
Expand Down
3 changes: 2 additions & 1 deletion packages/deploy-script-support/src/extract-proposal.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// @ts-check
import { deeplyFulfilled } from '@endo/marshal';
import fs from 'fs';
import { createRequire } from 'module';
import path from 'path';

import { deeplyFulfilled, defangAndTrim, stringify } from './code-gen.js';
import { defangAndTrim, stringify } from './code-gen.js';
import {
makeCoreProposalBehavior,
makeEnactCoreProposalsFromBundleRef,
Expand Down
8 changes: 2 additions & 6 deletions packages/deploy-script-support/src/writeCoreProposal.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
// @ts-check
import fs from 'fs';
import { E } from '@endo/far';
import { deeplyFulfilled } from '@endo/marshal';

import { createBundles } from '@agoric/internal/src/node/createBundles.js';
import {
deeplyFulfilled,
defangAndTrim,
mergePermits,
stringify,
} from './code-gen.js';
import { defangAndTrim, mergePermits, stringify } from './code-gen.js';
import { makeCoreProposalBehavior, permits } from './coreProposalBehavior.js';

export const makeWriteCoreProposal = (
Expand Down
5 changes: 1 addition & 4 deletions packages/inter-protocol/src/vaultFactory/storeUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@

// XXX importing these that are declared to be used only for testing
// until @agoric/store supports composite keys
import {
makeDecodePassable,
makeEncodePassable,
} from '@endo/marshal/src/encodePassable.js';
import { makeDecodePassable, makeEncodePassable } from '@endo/marshal';
import {
getAmountIn,
getAmountOut,
Expand Down
55 changes: 0 additions & 55 deletions packages/store/docs/exo-taxonomy.md

This file was deleted.

14 changes: 0 additions & 14 deletions packages/store/exported.js
Original file line number Diff line number Diff line change
@@ -1,15 +1 @@
import './src/types.js';

// TODO The following line should be deleted. It exports the type
// `MatchHelper` which is not used outside this store package. Without this
// line, this store package lints fine. But linting the governance
// package complains that it cannot find the type `MatchHelper`.
// I don't know why. I even tried adding
// import '@agoric/store/exported.js';
// to the modules in governance that import from '@agoric/store',
// but it did not help.
//
// Even with this line, the solo package still has the same complaint.
// So instead I moved the MatchHelper type, which should be internal,
// to types.js. See the comment there.
import './src/patterns/internal-types.js';
3 changes: 3 additions & 0 deletions packages/store/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@
"dependencies": {
"@agoric/assert": "^0.5.1",
"@agoric/internal": "^0.2.1",
"@endo/exo": "^0.2.1",
"@endo/far": "^0.2.17",
"@endo/eventual-send": "^0.17.1",
"@endo/marshal": "^0.8.4",
"@endo/pass-style": "^0.1.2",
"@endo/patterns": "^0.2.1",
"@endo/promise-kit": "^0.2.55",
"@fast-check/ava": "^1.1.3"
},
Expand Down
18 changes: 4 additions & 14 deletions packages/store/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,14 @@ export {
getCopyBagEntries,
makeCopyMap,
getCopyMapEntries,
} from './keys/checkKey.js';
export { coerceToElements } from './keys/copySet.js';
export { coerceToBagEntries } from './keys/copyBag.js';
export {
coerceToElements,
coerceToBagEntries,
compareKeys,
keyLT,
keyLTE,
keyEQ,
keyGTE,
keyGT,
} from './keys/compareKeys.js';
export {
elementsIsSuperset,
elementsIsDisjoint,
elementsCompare,
Expand All @@ -35,31 +31,25 @@ export {
setDisjointUnion,
setIntersection,
setDisjointSubtract,
} from './keys/merge-set-operators.js';

export {
bagIsSuperbag,
bagCompare,
bagUnion,
bagIntersection,
bagDisjointSubtract,
} from './keys/merge-bag-operators.js';

export {
M,
getRankCover,
isPattern,
assertPattern,
matches,
mustMatch,
} from './patterns/patternMatchers.js';
} from '@endo/patterns';

export {
initEmpty,
defineExoClass,
defineExoClassKit,
makeExo,
} from './patterns/exo-makers.js';
} from '@endo/exo';

export { makeScalarWeakSetStore } from './stores/scalarWeakSetStore.js';
export { makeScalarSetStore } from './stores/scalarSetStore.js';
Expand Down
Loading

0 comments on commit 3742272

Please sign in to comment.