Skip to content

Commit 6a69b0e

Browse files
committed
build: drop vats dependency
1 parent feefe9b commit 6a69b0e

File tree

6 files changed

+40
-29
lines changed

6 files changed

+40
-29
lines changed

packages/governance/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
"import-meta-resolve": "^2.2.1"
5252
},
5353
"devDependencies": {
54-
"@agoric/vats": "^0.15.1",
5554
"@endo/bundle-source": "^2.5.2",
5655
"@endo/init": "^0.5.57",
5756
"ava": "^5.3.0",

packages/governance/test/swingsetTests/committeeBinary/bootstrap.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import { E } from '@endo/eventual-send';
2-
import { Far } from '@endo/marshal';
3-
import { makeFakeBoard } from '@agoric/vats/tools/board-utils.js';
41
import { makeMockChainStorageRoot } from '@agoric/internal/src/storage-test-utils.js';
52
import buildManualTimer from '@agoric/zoe/tools/manualTimer.js';
3+
import { E } from '@endo/eventual-send';
4+
import { Far } from '@endo/marshal';
65

76
import {
87
ChoiceMethod,
9-
QuorumRule,
108
ElectionType,
9+
QuorumRule,
1110
coerceQuestionSpec,
1211
} from '../../../src/index.js';
12+
import { remoteNullMarshaller } from '../utils.js';
1313

1414
const { quote: q } = assert;
1515

@@ -65,7 +65,7 @@ const committeeBinaryStart = async (
6565
const { creatorFacet: electorateFacet, instance: electorateInstance } =
6666
await E(zoe).startInstance(installations.committee, {}, electorateTerms, {
6767
storageNode: makeMockChainStorageRoot().makeChildNode('thisElectorate'),
68-
marshaller: makeFakeBoard().getReadonlyMarshaller(),
68+
marshaller: remoteNullMarshaller,
6969
});
7070

7171
const choose = { text: 'Choose' };
@@ -128,7 +128,7 @@ const committeeBinaryTwoQuestions = async (
128128
const { creatorFacet: electorateFacet, instance: electorateInstance } =
129129
await E(zoe).startInstance(installations.committee, {}, electorateTerms, {
130130
storageNode: makeMockChainStorageRoot().makeChildNode('thisElectorate'),
131-
marshaller: makeFakeBoard().getReadonlyMarshaller(),
131+
marshaller: remoteNullMarshaller,
132132
});
133133

134134
const invitations = await E(electorateFacet).getVoterInvitations();

packages/governance/test/swingsetTests/contractGovernor/bootstrap.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1+
import { makeMockChainStorageRoot } from '@agoric/internal/src/storage-test-utils.js';
2+
import { observeIteration, subscribeEach } from '@agoric/notifier';
3+
import buildManualTimer from '@agoric/zoe/tools/manualTimer.js';
14
import { E } from '@endo/eventual-send';
25
import { Far } from '@endo/marshal';
3-
import buildManualTimer from '@agoric/zoe/tools/manualTimer.js';
4-
import { observeIteration, subscribeEach } from '@agoric/notifier';
5-
import { makeFakeBoard } from '@agoric/vats/tools/board-utils.js';
6-
import { makeMockChainStorageRoot } from '@agoric/internal/src/storage-test-utils.js';
76

8-
import { makeTerms, MALLEABLE_NUMBER } from './governedContract.js';
97
import {
10-
CONTRACT_ELECTORATE,
118
assertContractElectorate,
9+
CONTRACT_ELECTORATE,
1210
} from '../../../src/index.js';
11+
import { remoteNullMarshaller } from '../utils.js';
12+
import { makeTerms, MALLEABLE_NUMBER } from './governedContract.js';
1313

1414
const { quote: q } = assert;
1515

@@ -79,7 +79,7 @@ const startElectorate = async (zoe, installations, electorateTerms) => {
7979
const { creatorFacet: electorateCreatorFacet, instance: electorateInstance } =
8080
await E(zoe).startInstance(installations.committee, {}, electorateTerms, {
8181
storageNode: makeMockChainStorageRoot().makeChildNode('thisElectorate'),
82-
marshaller: makeFakeBoard().getReadonlyMarshaller(),
82+
marshaller: remoteNullMarshaller,
8383
});
8484
return { electorateCreatorFacet, electorateInstance };
8585
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { Far, makeMarshal } from '@endo/marshal';
2+
import { makeExo } from '@agoric/store';
3+
4+
const nullMarshaller = makeMarshal(
5+
_ => null,
6+
_ => Far('dummy'),
7+
);
8+
9+
export const remoteNullMarshaller = makeExo('nullMarshaller', undefined, {
10+
toCapData: val => nullMarshaller.toCapData(val),
11+
fromCapData: slot => nullMarshaller.fromCapData(slot),
12+
});

packages/governance/test/unitTests/test-committee.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@ import { test } from '@agoric/zoe/tools/prepare-test-env-ava.js';
22

33
import '@agoric/zoe/exported.js';
44

5-
import path from 'path';
6-
import { E } from '@endo/eventual-send';
7-
import { Far } from '@endo/far';
8-
import { makeZoeForTest } from '@agoric/zoe/tools/setup-zoe.js';
9-
import bundleSource from '@endo/bundle-source';
10-
import { makeFakeBoard } from '@agoric/vats/tools/board-utils.js';
115
import { makeMockChainStorageRoot } from '@agoric/internal/src/storage-test-utils.js';
12-
import buildManualTimer from '@agoric/zoe/tools/manualTimer.js';
136
import { eventLoopIteration } from '@agoric/internal/src/testing-utils.js';
7+
import buildManualTimer from '@agoric/zoe/tools/manualTimer.js';
8+
import { makeZoeForTest } from '@agoric/zoe/tools/setup-zoe.js';
9+
import bundleSource from '@endo/bundle-source';
10+
import { E } from '@endo/eventual-send';
11+
import { Far } from '@endo/far';
12+
import path from 'path';
1413

1514
import {
1615
ChoiceMethod,
@@ -19,6 +18,7 @@ import {
1918
coerceQuestionSpec,
2019
} from '../../src/index.js';
2120
import { documentStorageSchema } from '../../tools/storageDoc.js';
21+
import { remoteNullMarshaller } from '../swingsetTests/utils.js';
2222

2323
const filename = new URL(import.meta.url).pathname;
2424
const dirname = path.dirname(filename);
@@ -51,7 +51,7 @@ const setupContract = async () => {
5151
terms,
5252
{
5353
storageNode: mockChainStorageRoot.makeChildNode('thisElectorate'),
54-
marshaller: makeFakeBoard().getReadonlyMarshaller(),
54+
marshaller: remoteNullMarshaller,
5555
},
5656
);
5757

packages/governance/test/unitTests/test-paramGovernance.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
import { test } from '@agoric/zoe/tools/prepare-test-env-ava.js';
21
import '@agoric/zoe/exported.js';
2+
import { test } from '@agoric/zoe/tools/prepare-test-env-ava.js';
33

4+
import { makeMockChainStorageRoot } from '@agoric/internal/src/storage-test-utils.js';
45
import { makeNotifierFromAsyncIterable } from '@agoric/notifier';
6+
import buildManualTimer from '@agoric/zoe/tools/manualTimer.js';
57
import { makeZoeForTest } from '@agoric/zoe/tools/setup-zoe.js';
68
import bundleSource from '@endo/bundle-source';
7-
import buildManualTimer from '@agoric/zoe/tools/manualTimer.js';
89
import { E } from '@endo/eventual-send';
9-
import { makeFakeBoard } from '@agoric/vats/tools/board-utils.js';
10-
import { makeMockChainStorageRoot } from '@agoric/internal/src/storage-test-utils.js';
1110

12-
import { resolve as importMetaResolve } from 'import-meta-resolve';
1311
import { eventLoopIteration } from '@agoric/internal/src/testing-utils.js';
14-
import { MALLEABLE_NUMBER } from '../swingsetTests/contractGovernor/governedContract.js';
12+
import { resolve as importMetaResolve } from 'import-meta-resolve';
1513
import { CONTRACT_ELECTORATE, ParamTypes } from '../../src/index.js';
14+
import { MALLEABLE_NUMBER } from '../swingsetTests/contractGovernor/governedContract.js';
15+
import { remoteNullMarshaller } from '../swingsetTests/utils.js';
1616

1717
const voteCounterRoot = '../../src/binaryVoteCounter.js';
1818
const governedRoot = '../swingsetTests/contractGovernor/governedContract.js';
@@ -61,7 +61,7 @@ const setUpGovernedContract = async (zoe, electorateTerms, timer) => {
6161
electorateTerms,
6262
{
6363
storageNode: makeMockChainStorageRoot().makeChildNode('thisElectorate'),
64-
marshaller: makeFakeBoard().getReadonlyMarshaller(),
64+
marshaller: remoteNullMarshaller,
6565
},
6666
);
6767

0 commit comments

Comments
 (0)