@agoric/governance 0.10.4-upgrade-14-dev-0169c7e.0 → 0.10.4-upgrade-16-dev-8879538.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/exported.d.ts +32 -0
- package/exported.js +1 -1
- package/package.json +35 -29
- package/src/binaryVoteCounter.d.ts +6 -3
- package/src/binaryVoteCounter.d.ts.map +1 -1
- package/src/binaryVoteCounter.js +6 -2
- package/src/breakTie.d.ts +1 -0
- package/src/breakTie.d.ts.map +1 -1
- package/src/breakTie.js +4 -0
- package/src/closingRule.d.ts +4 -0
- package/src/closingRule.d.ts.map +1 -1
- package/src/closingRule.js +4 -0
- package/src/committee.d.ts +12 -8
- package/src/committee.d.ts.map +1 -1
- package/src/committee.js +24 -11
- package/src/constants.d.ts +12 -12
- package/src/constants.d.ts.map +1 -1
- package/src/contractGovernance/governApi.d.ts +11 -8
- package/src/contractGovernance/governApi.d.ts.map +1 -1
- package/src/contractGovernance/governApi.js +8 -3
- package/src/contractGovernance/governFilter.d.ts +8 -2
- package/src/contractGovernance/governFilter.d.ts.map +1 -1
- package/src/contractGovernance/governFilter.js +5 -1
- package/src/contractGovernance/governParam.d.ts +9 -2
- package/src/contractGovernance/governParam.d.ts.map +1 -1
- package/src/contractGovernance/governParam.js +6 -1
- package/src/contractGovernance/paramManager.d.ts +13 -9
- package/src/contractGovernance/paramManager.d.ts.map +1 -1
- package/src/contractGovernance/paramManager.js +18 -14
- package/src/contractGovernance/typedParamManager.d.ts +19 -10
- package/src/contractGovernance/typedParamManager.d.ts.map +1 -1
- package/src/contractGovernance/typedParamManager.js +5 -0
- package/src/contractGovernor.d.ts +11 -5
- package/src/contractGovernor.d.ts.map +1 -1
- package/src/contractGovernor.js +19 -9
- package/src/contractGovernorKit.d.ts +14 -48
- package/src/contractGovernorKit.d.ts.map +1 -1
- package/src/contractGovernorKit.js +56 -10
- package/src/contractHelper.d.ts +68 -78
- package/src/contractHelper.d.ts.map +1 -1
- package/src/contractHelper.js +21 -21
- package/src/electorateTools.d.ts +21 -17
- package/src/electorateTools.d.ts.map +1 -1
- package/src/electorateTools.js +20 -12
- package/src/index.js +3 -6
- package/src/multiCandidateVoteCounter.d.ts +6 -3
- package/src/multiCandidateVoteCounter.d.ts.map +1 -1
- package/src/multiCandidateVoteCounter.js +8 -4
- package/src/noActionElectorate.d.ts +6 -1
- package/src/noActionElectorate.d.ts.map +1 -1
- package/src/noActionElectorate.js +11 -2
- package/src/question.d.ts +15 -11
- package/src/question.d.ts.map +1 -1
- package/src/question.js +5 -0
- package/src/quorumCounter.d.ts +1 -1
- package/src/quorumCounter.d.ts.map +1 -1
- package/src/quorumCounter.js +4 -0
- package/src/typeGuards.d.ts +91 -54
- package/src/typeGuards.d.ts.map +1 -1
- package/src/types.d.ts +59 -62
- package/src/types.d.ts.map +1 -1
- package/src/types.js +35 -27
- package/src/validators.d.ts +5 -0
- package/src/validators.d.ts.map +1 -1
- package/src/validators.js +6 -3
- package/src/voterKit.d.ts +6 -11
- package/src/voterKit.d.ts.map +1 -1
- package/src/voterKit.js +4 -0
- package/tools/puppetContractGovernor.d.ts +15 -11
- package/tools/puppetContractGovernor.d.ts.map +1 -1
- package/tools/puppetContractGovernor.js +7 -5
- package/tools/puppetGovernance.d.ts +31 -30
- package/tools/puppetGovernance.d.ts.map +1 -1
- package/tools/puppetGovernance.js +6 -4
- package/tools/storageDoc.d.ts +3 -3
- package/tools/storageDoc.d.ts.map +1 -1
- package/CHANGELOG.md +0 -456
- package/src/types-ambient.d.ts +0 -1047
- package/src/types-ambient.d.ts.map +0 -1
- package/src/types-ambient.js +0 -731
package/exported.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** @file Ambient exports until https://github.com/Agoric/agoric-sdk/issues/6512 */
|
|
2
|
+
/** @see {@link /docs/typescript.md} */
|
|
3
|
+
/* eslint-disable -- doesn't understand .d.ts */
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
GovernanceFacetKit as _GovernanceFacetKit,
|
|
7
|
+
GovernanceTerms as _GovernanceTerms,
|
|
8
|
+
GovernorCreatorFacet as _GovernorCreatorFacet,
|
|
9
|
+
GovernanceSubscriptionState as _GovernanceSubscriptionState,
|
|
10
|
+
GovernorStartedInstallationKit as _GovernorStartedInstallationKit,
|
|
11
|
+
GovernedCreatorFacet as _GovernedCreatorFacet,
|
|
12
|
+
ParamStateRecord as _ParamStateRecord,
|
|
13
|
+
GovernedPublicFacet as _GovernedPublicFacet,
|
|
14
|
+
CommitteeElectoratePublic as _CommitteeElectoratePublic,
|
|
15
|
+
GovernedApis as _GovernedApis,
|
|
16
|
+
GovernableStartFn as _GovernableStartFn,
|
|
17
|
+
} from './src/types.js';
|
|
18
|
+
declare global {
|
|
19
|
+
export {
|
|
20
|
+
_CommitteeElectoratePublic as CommitteeElectoratePublic,
|
|
21
|
+
_GovernableStartFn as GovernableStartFn,
|
|
22
|
+
_GovernanceFacetKit as GovernanceFacetKit,
|
|
23
|
+
_GovernanceSubscriptionState as GovernanceSubscriptionState,
|
|
24
|
+
_GovernanceTerms as GovernanceTerms,
|
|
25
|
+
_GovernedApis as GovernedApis,
|
|
26
|
+
_GovernedCreatorFacet as GovernedCreatorFacet,
|
|
27
|
+
_GovernedPublicFacet as GovernedPublicFacet,
|
|
28
|
+
_GovernorCreatorFacet as GovernorCreatorFacet,
|
|
29
|
+
_GovernorStartedInstallationKit as GovernorStartedInstallationKit,
|
|
30
|
+
_ParamStateRecord as ParamStateRecord,
|
|
31
|
+
};
|
|
32
|
+
}
|
package/exported.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
// Dummy file for .d.ts twin to declare ambients
|
package/package.json
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/governance",
|
|
3
|
-
"version": "0.10.4-upgrade-
|
|
3
|
+
"version": "0.10.4-upgrade-16-dev-8879538.0+8879538",
|
|
4
4
|
"description": "Core governance support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"engines": {
|
|
8
|
-
"node": "
|
|
8
|
+
"node": "^18.12 || ^20.9"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"build": "yarn build:bundles",
|
|
12
12
|
"build:bundles": "node ./scripts/build-bundles.js",
|
|
13
|
-
"prepack": "
|
|
14
|
-
"postpack": "git clean -f '*.d.ts*'
|
|
13
|
+
"prepack": "tsc --build tsconfig.build.json",
|
|
14
|
+
"postpack": "git clean -f '*.d.ts*'",
|
|
15
15
|
"test": "ava",
|
|
16
16
|
"test:c8": "c8 $C8_OPTIONS ava --config=ava-nesm.config.js",
|
|
17
17
|
"test:xs": "exit 0",
|
|
18
18
|
"lint-fix": "yarn lint:eslint --fix",
|
|
19
19
|
"lint": "run-s --continue-on-error lint:*",
|
|
20
20
|
"lint:eslint": "eslint .",
|
|
21
|
-
"lint:types": "tsc
|
|
21
|
+
"lint:types": "tsc"
|
|
22
22
|
},
|
|
23
23
|
"repository": {
|
|
24
24
|
"type": "git",
|
|
@@ -31,46 +31,52 @@
|
|
|
31
31
|
},
|
|
32
32
|
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@agoric/assert": "0.6.1-upgrade-
|
|
35
|
-
"@agoric/ertp": "0.16.3-upgrade-
|
|
36
|
-
"@agoric/internal": "0.
|
|
37
|
-
"@agoric/notifier": "0.6.3-upgrade-
|
|
38
|
-
"@agoric/store": "0.9.3-upgrade-
|
|
39
|
-
"@agoric/
|
|
40
|
-
"@agoric/
|
|
41
|
-
"@agoric/
|
|
42
|
-
"@
|
|
43
|
-
"@
|
|
44
|
-
"@endo/
|
|
45
|
-
"@endo/
|
|
46
|
-
"@endo/
|
|
47
|
-
"@endo/
|
|
48
|
-
"@endo/
|
|
49
|
-
"
|
|
34
|
+
"@agoric/assert": "0.6.1-upgrade-16-dev-8879538.0+8879538",
|
|
35
|
+
"@agoric/ertp": "0.16.3-upgrade-16-dev-8879538.0+8879538",
|
|
36
|
+
"@agoric/internal": "0.3.3-upgrade-16-dev-8879538.0+8879538",
|
|
37
|
+
"@agoric/notifier": "0.6.3-upgrade-16-dev-8879538.0+8879538",
|
|
38
|
+
"@agoric/store": "0.9.3-upgrade-16-dev-8879538.0+8879538",
|
|
39
|
+
"@agoric/time": "0.3.3-upgrade-16-dev-8879538.0+8879538",
|
|
40
|
+
"@agoric/vat-data": "0.5.3-upgrade-16-dev-8879538.0+8879538",
|
|
41
|
+
"@agoric/zoe": "0.26.3-upgrade-16-dev-8879538.0+8879538",
|
|
42
|
+
"@endo/bundle-source": "^3.2.3",
|
|
43
|
+
"@endo/captp": "^4.2.0",
|
|
44
|
+
"@endo/eventual-send": "^1.2.2",
|
|
45
|
+
"@endo/far": "^1.1.2",
|
|
46
|
+
"@endo/marshal": "^1.5.0",
|
|
47
|
+
"@endo/nat": "^5.0.7",
|
|
48
|
+
"@endo/promise-kit": "^1.1.2",
|
|
49
|
+
"import-meta-resolve": "^2.2.1"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@agoric/
|
|
53
|
-
"@endo/bundle-source": "2.
|
|
54
|
-
"@endo/init": "
|
|
55
|
-
"ava": "^5.
|
|
56
|
-
"c8": "^
|
|
57
|
-
"import-meta-resolve": "^2.2.1"
|
|
52
|
+
"@agoric/swingset-vat": "0.32.3-upgrade-16-dev-8879538.0+8879538",
|
|
53
|
+
"@endo/bundle-source": "^3.2.3",
|
|
54
|
+
"@endo/init": "^1.1.2",
|
|
55
|
+
"ava": "^5.3.0",
|
|
56
|
+
"c8": "^9.1.0"
|
|
58
57
|
},
|
|
59
58
|
"files": [
|
|
60
59
|
"README.md",
|
|
61
60
|
"src/",
|
|
62
61
|
"tools/",
|
|
63
62
|
"exported.js",
|
|
63
|
+
"exported.d.ts",
|
|
64
64
|
"NEWS.md"
|
|
65
65
|
],
|
|
66
66
|
"ava": {
|
|
67
67
|
"files": [
|
|
68
|
-
"test
|
|
68
|
+
"test/**/*.test.*"
|
|
69
|
+
],
|
|
70
|
+
"require": [
|
|
71
|
+
"@endo/init/debug.js"
|
|
69
72
|
],
|
|
70
73
|
"timeout": "10m"
|
|
71
74
|
},
|
|
72
75
|
"publishConfig": {
|
|
73
76
|
"access": "public"
|
|
74
77
|
},
|
|
75
|
-
"
|
|
78
|
+
"typeCoverage": {
|
|
79
|
+
"atLeast": 89.31
|
|
80
|
+
},
|
|
81
|
+
"gitHead": "8879538cd1d125a08346f02dd5701d0d70c90bb8"
|
|
76
82
|
}
|
|
@@ -8,9 +8,12 @@ export function start(zcf: ZCF<{
|
|
|
8
8
|
questionSpec: QuestionSpec;
|
|
9
9
|
quorumThreshold: bigint;
|
|
10
10
|
}>, { outcomePublisher }: {
|
|
11
|
-
outcomePublisher: Publisher<OutcomeRecord>;
|
|
11
|
+
outcomePublisher: globalThis.Publisher<OutcomeRecord>;
|
|
12
12
|
}): {
|
|
13
|
-
publicFacet: VoteCounterPublicFacet;
|
|
14
|
-
creatorFacet: VoteCounterCreatorFacet;
|
|
13
|
+
publicFacet: import("./types.js").VoteCounterPublicFacet;
|
|
14
|
+
creatorFacet: import("./types.js").VoteCounterCreatorFacet;
|
|
15
15
|
};
|
|
16
|
+
import type { BuildVoteCounter } from './types.js';
|
|
17
|
+
import type { QuestionSpec } from './types.js';
|
|
18
|
+
import type { OutcomeRecord } from './types.js';
|
|
16
19
|
//# sourceMappingURL=binaryVoteCounter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binaryVoteCounter.d.ts","sourceRoot":"","sources":["binaryVoteCounter.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"binaryVoteCounter.d.ts","sourceRoot":"","sources":["binaryVoteCounter.js"],"names":[],"mappings":"AA2CA,+BAA+B;AAC/B,qDA6JE;AAMF;;;GAGG;AACH;;qBAH6D,MAAM;;;;;;EAqBlE;sCAlNyF,YAAY;kCAAZ,YAAY;mCAAZ,YAAY"}
|
package/src/binaryVoteCounter.js
CHANGED
|
@@ -16,6 +16,10 @@ import {
|
|
|
16
16
|
} from './typeGuards.js';
|
|
17
17
|
import { makeQuorumCounter } from './quorumCounter.js';
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* @import {BuildVoteCounter, OutcomeRecord, Position, QuestionSpec, VoteStatistics} from './types.js';
|
|
21
|
+
*/
|
|
22
|
+
|
|
19
23
|
const { Fail } = assert;
|
|
20
24
|
|
|
21
25
|
const validateBinaryQuestionSpec = questionSpec => {
|
|
@@ -109,7 +113,7 @@ const makeBinaryVoteCounter = (
|
|
|
109
113
|
outcome: 'fail',
|
|
110
114
|
reason: 'No quorum',
|
|
111
115
|
};
|
|
112
|
-
E(publisher).publish(voteOutcome);
|
|
116
|
+
void E(publisher).publish(voteOutcome);
|
|
113
117
|
return;
|
|
114
118
|
}
|
|
115
119
|
|
|
@@ -122,7 +126,7 @@ const makeBinaryVoteCounter = (
|
|
|
122
126
|
}
|
|
123
127
|
|
|
124
128
|
// XXX if we should distinguish ties, publish should be called in if above
|
|
125
|
-
E.when(outcomePromise.promise, position => {
|
|
129
|
+
void E.when(outcomePromise.promise, position => {
|
|
126
130
|
/** @type {OutcomeRecord} */
|
|
127
131
|
const voteOutcome = {
|
|
128
132
|
question: details.questionHandle,
|
package/src/breakTie.d.ts
CHANGED
package/src/breakTie.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breakTie.d.ts","sourceRoot":"","sources":["breakTie.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"breakTie.d.ts","sourceRoot":"","sources":["breakTie.js"],"names":[],"mappings":"AA4BO,mDAHI,MAAM,cAKhB;8BA7B0B,YAAY"}
|
package/src/breakTie.js
CHANGED
package/src/closingRule.d.ts
CHANGED
package/src/closingRule.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"closingRule.d.ts","sourceRoot":"","sources":["closingRule.js"],"names":[],"mappings":"AAOA,0BAA0B;AAC1B,
|
|
1
|
+
{"version":3,"file":"closingRule.d.ts","sourceRoot":"","sources":["closingRule.js"],"names":[],"mappings":"AAOA;;GAEG;AAEH,0BAA0B;AAC1B,wCAQE;iCAZ4B,YAAY"}
|
package/src/closingRule.js
CHANGED
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
import { E } from '@endo/eventual-send';
|
|
6
6
|
import { Far } from '@endo/marshal';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* @import {CloseVoting} from './types.js';
|
|
10
|
+
*/
|
|
11
|
+
|
|
8
12
|
/** @type {CloseVoting} */
|
|
9
13
|
export const scheduleClose = (closingRule, closeVoting) => {
|
|
10
14
|
const { timer, deadline } = closingRule;
|
package/src/committee.d.ts
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @typedef { ElectorateCreatorFacet & {
|
|
3
|
+
* getVoterInvitations: () => Promise<Invitation<{ voter: { castBallotFor(handle: any, choice?: any, ): void}}>>[]
|
|
4
|
+
* }} CommitteeElectorateCreatorFacet
|
|
5
|
+
*/
|
|
6
|
+
/** @type {ContractMeta} */
|
|
7
|
+
export const meta: ContractMeta;
|
|
8
|
+
export function start(zcf: ZCF<{
|
|
6
9
|
committeeName: string;
|
|
7
10
|
committeeSize: number;
|
|
8
11
|
}>, privateArgs: {
|
|
9
12
|
storageNode: ERef<StorageNode>;
|
|
10
13
|
marshaller: ERef<Marshaller>;
|
|
11
|
-
}, baggage:
|
|
14
|
+
}, baggage: import("@agoric/vat-data").Baggage): {
|
|
12
15
|
creatorFacet: CommitteeElectorateCreatorFacet;
|
|
13
16
|
publicFacet: CommitteeElectoratePublic;
|
|
14
17
|
};
|
|
@@ -17,7 +20,8 @@ export type CommitteeElectorateCreatorFacet = ElectorateCreatorFacet & {
|
|
|
17
20
|
voter: {
|
|
18
21
|
castBallotFor(handle: any, choice?: any): void;
|
|
19
22
|
};
|
|
20
|
-
}
|
|
23
|
+
}>>[];
|
|
21
24
|
};
|
|
22
|
-
import {
|
|
25
|
+
import type { CommitteeElectoratePublic } from './types.js';
|
|
26
|
+
import type { ElectorateCreatorFacet } from './types.js';
|
|
23
27
|
//# sourceMappingURL=committee.d.ts.map
|
package/src/committee.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"committee.d.ts","sourceRoot":"","sources":["committee.js"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"committee.d.ts","sourceRoot":"","sources":["committee.js"],"names":[],"mappings":"AAwBA;;;;GAIG;AAEH,2BAA2B;AAC3B,mBADW,YAAY,CAOrB;AAoBK,2BARI,GAAG,CAAC;IACd,aAAiB,EAAE,MAAM,CAAC;IAC1B,aAAiB,EAAE,MAAM,CAAC;CACvB,CAAC,eACM;IAAE,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAAC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,CAAA;CAAC,WAC/D,OAAO,kBAAkB,EAAE,OAAO;kBACjB,+BAA+B;;EAkI1D;;yBA/JyB,MAAM,OAAO,CAAC,UAAU,CAAC;QAAE,KAAK,EAAE;YAAE,aAAa,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,GAAG,GAAK,IAAI,CAAA;SAAC,CAAA;KAAC,CAAC,CAAC,EAAE;;+CAPH,YAAY;4CAAZ,YAAY"}
|
package/src/committee.js
CHANGED
|
@@ -5,6 +5,7 @@ import { E } from '@endo/eventual-send';
|
|
|
5
5
|
|
|
6
6
|
import { StorageNodeShape } from '@agoric/internal';
|
|
7
7
|
import { prepareExo, provideDurableMapStore } from '@agoric/vat-data';
|
|
8
|
+
import { EmptyProposalShape } from '@agoric/zoe/src/typeGuards.js';
|
|
8
9
|
import {
|
|
9
10
|
getOpenQuestions,
|
|
10
11
|
getPoserInvitation,
|
|
@@ -15,6 +16,10 @@ import { QuorumRule } from './question.js';
|
|
|
15
16
|
import { ElectorateCreatorI, ElectoratePublicI } from './typeGuards.js';
|
|
16
17
|
import { prepareVoterKit } from './voterKit.js';
|
|
17
18
|
|
|
19
|
+
/**
|
|
20
|
+
* @import {ElectorateCreatorFacet, CommitteeElectoratePublic, QuestionDetails, OutcomeRecord, AddQuestion} from './types.js';
|
|
21
|
+
*/
|
|
22
|
+
|
|
18
23
|
const { ceilDivide } = natSafeMath;
|
|
19
24
|
|
|
20
25
|
/**
|
|
@@ -23,11 +28,15 @@ const { ceilDivide } = natSafeMath;
|
|
|
23
28
|
* }} CommitteeElectorateCreatorFacet
|
|
24
29
|
*/
|
|
25
30
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
31
|
+
/** @type {ContractMeta} */
|
|
32
|
+
export const meta = {
|
|
33
|
+
privateArgsShape: {
|
|
34
|
+
storageNode: StorageNodeShape,
|
|
35
|
+
marshaller: M.remotable('Marshaller'),
|
|
36
|
+
},
|
|
37
|
+
upgradability: 'canUpgrade',
|
|
29
38
|
};
|
|
30
|
-
harden(
|
|
39
|
+
harden(meta);
|
|
31
40
|
|
|
32
41
|
/**
|
|
33
42
|
* Each Committee (an Electorate) represents a particular set of voters. The
|
|
@@ -46,7 +55,7 @@ harden(privateArgsShape);
|
|
|
46
55
|
* @param {import('@agoric/vat-data').Baggage} baggage
|
|
47
56
|
* @returns {{creatorFacet: CommitteeElectorateCreatorFacet, publicFacet: CommitteeElectoratePublic}}
|
|
48
57
|
*/
|
|
49
|
-
export const
|
|
58
|
+
export const start = (zcf, privateArgs, baggage) => {
|
|
50
59
|
/** @type {MapStore<Handle<'Question'>, import('./electorateTools.js').QuestionRecord>} */
|
|
51
60
|
const allQuestions = provideDurableMapStore(baggage, 'Question');
|
|
52
61
|
|
|
@@ -75,10 +84,15 @@ export const prepare = (zcf, privateArgs, baggage) => {
|
|
|
75
84
|
// This will produce unique descriptions because
|
|
76
85
|
// makeCommitteeVoterInvitation() is only called within the following loop,
|
|
77
86
|
// which is only called once per Electorate.
|
|
78
|
-
return zcf.makeInvitation(
|
|
79
|
-
seat
|
|
80
|
-
|
|
81
|
-
|
|
87
|
+
return zcf.makeInvitation(
|
|
88
|
+
seat => {
|
|
89
|
+
seat.exit();
|
|
90
|
+
return makeVoterKit(index);
|
|
91
|
+
},
|
|
92
|
+
`Voter${index}`,
|
|
93
|
+
undefined,
|
|
94
|
+
EmptyProposalShape,
|
|
95
|
+
);
|
|
82
96
|
};
|
|
83
97
|
|
|
84
98
|
const { committeeName, committeeSize } = zcf.getTerms();
|
|
@@ -170,5 +184,4 @@ export const prepare = (zcf, privateArgs, baggage) => {
|
|
|
170
184
|
|
|
171
185
|
return { publicFacet, creatorFacet };
|
|
172
186
|
};
|
|
173
|
-
|
|
174
|
-
harden(prepare);
|
|
187
|
+
harden(start);
|
package/src/constants.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
export namespace ParamTypes {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
let AMOUNT: "amount";
|
|
3
|
+
let BRAND: "brand";
|
|
4
|
+
let INSTALLATION: "installation";
|
|
5
|
+
let INSTANCE: "instance";
|
|
6
|
+
let INVITATION: "invitation";
|
|
7
|
+
let NAT: "nat";
|
|
8
|
+
let RATIO: "ratio";
|
|
9
|
+
let STRING: "string";
|
|
10
|
+
let PASSABLE_RECORD: "record";
|
|
11
|
+
let TIMESTAMP: "timestamp";
|
|
12
|
+
let RELATIVE_TIME: "relativeTime";
|
|
13
|
+
let UNKNOWN: "unknown";
|
|
14
14
|
}
|
|
15
15
|
export type ParamType = (typeof ParamTypes)[keyof typeof ParamTypes];
|
|
16
16
|
//# sourceMappingURL=constants.d.ts.map
|
package/src/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["constants.js"],"names":[],"mappings":";;;;;;;;;;;;;;wBAuBc,CAAA,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["constants.js"],"names":[],"mappings":";;;;;;;;;;;;;;wBAuBc,CAAA,OAAO,UAAU,EAAC,MAAM,OAAO,UAAU,CAAC"}
|
|
@@ -1,30 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* manage contracts that allow governance to invoke functions.
|
|
3
3
|
*
|
|
4
|
-
* @param {ERef<{ [methodName: string]: (...args: any) =>
|
|
4
|
+
* @param {ERef<{ [methodName: string]: (...args: any) => Passable }>} governedApis
|
|
5
5
|
* @param {Array<string | symbol>} governedNames names of the governed API methods
|
|
6
|
-
* @param {ERef<import('@agoric/time
|
|
6
|
+
* @param {ERef<import('@agoric/time').TimerService>} timer
|
|
7
7
|
* @param {() => Promise<PoserFacet>} getUpdatedPoserFacet
|
|
8
8
|
* @returns {ApiGovernor}
|
|
9
9
|
*/
|
|
10
|
-
export function setupApiGovernance(governedApis: ERef<{
|
|
11
|
-
[methodName: string]: (...args: any) =>
|
|
12
|
-
}>, governedNames: Array<string | symbol>, timer: ERef<import(
|
|
10
|
+
export function setupApiGovernance(governedApis: globalThis.ERef<{
|
|
11
|
+
[methodName: string]: (...args: any) => Passable;
|
|
12
|
+
}>, governedNames: Array<string | symbol>, timer: ERef<import("@agoric/time").TimerService>, getUpdatedPoserFacet: () => Promise<PoserFacet>): ApiGovernor;
|
|
13
13
|
/**
|
|
14
14
|
* Make a pair of positions for a question about whether to invoke an API. If
|
|
15
15
|
* the vote passes, the method will be called on the governedApis facet with the
|
|
16
16
|
* arguments that were provided.
|
|
17
17
|
*
|
|
18
18
|
* @param {string} apiMethodName
|
|
19
|
-
* @param {
|
|
19
|
+
* @param {Passable[]} methodArgs
|
|
20
20
|
*/
|
|
21
|
-
export function makeApiInvocationPositions(apiMethodName: string, methodArgs:
|
|
21
|
+
export function makeApiInvocationPositions(apiMethodName: string, methodArgs: Passable[]): {
|
|
22
22
|
positive: {
|
|
23
23
|
apiMethodName: string;
|
|
24
|
-
methodArgs:
|
|
24
|
+
methodArgs: Passable[];
|
|
25
25
|
};
|
|
26
26
|
negative: {
|
|
27
27
|
dontInvoke: string;
|
|
28
28
|
};
|
|
29
29
|
};
|
|
30
|
+
import type { Passable } from '@endo/pass-style';
|
|
31
|
+
import type { PoserFacet } from '../types.js';
|
|
32
|
+
import type { ApiGovernor } from '../types.js';
|
|
30
33
|
//# sourceMappingURL=governApi.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"governApi.d.ts","sourceRoot":"","sources":["governApi.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"governApi.d.ts","sourceRoot":"","sources":["governApi.js"],"names":[],"mappings":"AAgCA;;;;;;;;GAQG;AACH;oCANkD,GAAG;mBAC1C,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,SACtB,IAAI,CAAC,OAAO,cAAc,EAAE,YAAY,CAAC,gEA0FnD;AA7GD;;;;;;;GAOG;AACH,0DAHW,MAAM;;;;;;;;EAOhB;8BAlB2C,kBAAkB;gCAC+B,aAAa;iCAAb,aAAa"}
|
|
@@ -9,6 +9,11 @@ import {
|
|
|
9
9
|
coerceQuestionSpec,
|
|
10
10
|
} from '../question.js';
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* @import {Passable, RemotableObject} from '@endo/pass-style';
|
|
14
|
+
* @import {Position, ApiGovernor, ApiInvocationIssue, PoserFacet, VoteOnApiInvocation} from '../types.js';
|
|
15
|
+
*/
|
|
16
|
+
|
|
12
17
|
const { Fail, quote: q } = assert;
|
|
13
18
|
|
|
14
19
|
/**
|
|
@@ -17,7 +22,7 @@ const { Fail, quote: q } = assert;
|
|
|
17
22
|
* arguments that were provided.
|
|
18
23
|
*
|
|
19
24
|
* @param {string} apiMethodName
|
|
20
|
-
* @param {
|
|
25
|
+
* @param {Passable[]} methodArgs
|
|
21
26
|
*/
|
|
22
27
|
const makeApiInvocationPositions = (apiMethodName, methodArgs) => {
|
|
23
28
|
const positive = harden({ apiMethodName, methodArgs });
|
|
@@ -28,9 +33,9 @@ const makeApiInvocationPositions = (apiMethodName, methodArgs) => {
|
|
|
28
33
|
/**
|
|
29
34
|
* manage contracts that allow governance to invoke functions.
|
|
30
35
|
*
|
|
31
|
-
* @param {ERef<{ [methodName: string]: (...args: any) =>
|
|
36
|
+
* @param {ERef<{ [methodName: string]: (...args: any) => Passable }>} governedApis
|
|
32
37
|
* @param {Array<string | symbol>} governedNames names of the governed API methods
|
|
33
|
-
* @param {ERef<import('@agoric/time
|
|
38
|
+
* @param {ERef<import('@agoric/time').TimerService>} timer
|
|
34
39
|
* @param {() => Promise<PoserFacet>} getUpdatedPoserFacet
|
|
35
40
|
* @returns {ApiGovernor}
|
|
36
41
|
*/
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Setup to allow governance to block some invitations.
|
|
3
3
|
*
|
|
4
|
-
* @param {ERef<import('@agoric/time
|
|
4
|
+
* @param {ERef<import('@agoric/time').TimerService>} timer
|
|
5
5
|
* @param {() => Promise<PoserFacet>} getUpdatedPoserFacet
|
|
6
6
|
* @param {GovernedCreatorFacet<{}>} governedCF
|
|
7
7
|
* @returns {FilterGovernor}
|
|
8
8
|
*/
|
|
9
|
-
export function setupFilterGovernance(timer: ERef<import(
|
|
9
|
+
export function setupFilterGovernance(timer: ERef<import("@agoric/time").TimerService>, getUpdatedPoserFacet: () => Promise<PoserFacet>, governedCF: GovernedCreatorFacet<{}>): FilterGovernor;
|
|
10
|
+
/**
|
|
11
|
+
* @import {Position, ApiGovernor, ApiInvocationIssue, PoserFacet, VoteOnApiInvocation, FilterGovernor, GovernedCreatorFacet, OfferFilterIssue, VoteOnOfferFilter} from '../types.js';
|
|
12
|
+
*/
|
|
10
13
|
/**
|
|
11
14
|
* Make a pair of positions for a question about whether to update the offer
|
|
12
15
|
* filter. If the vote passes, the list of blocked invitation strings will be
|
|
@@ -22,4 +25,7 @@ export function makeOfferFilterPositions(strings: string[]): {
|
|
|
22
25
|
dontUpdate: string[];
|
|
23
26
|
};
|
|
24
27
|
};
|
|
28
|
+
import type { PoserFacet } from '../types.js';
|
|
29
|
+
import type { GovernedCreatorFacet } from '../types.js';
|
|
30
|
+
import type { FilterGovernor } from '../types.js';
|
|
25
31
|
//# sourceMappingURL=governFilter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"governFilter.d.ts","sourceRoot":"","sources":["governFilter.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"governFilter.d.ts","sourceRoot":"","sources":["governFilter.js"],"names":[],"mappings":"AA6BA;;;;;;;GAOG;AACH,6CALW,IAAI,CAAC,OAAO,cAAc,EAAE,YAAY,CAAC,yGAwEnD;AA5FD;;GAEG;AAEH;;;;;;GAMG;AACH,kDAFW,MAAM,EAAE;;;;;;;EAMlB;gCAduK,aAAa;0CAAb,aAAa;oCAAb,aAAa"}
|
|
@@ -10,6 +10,10 @@ import {
|
|
|
10
10
|
coerceQuestionSpec,
|
|
11
11
|
} from '../question.js';
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* @import {Position, ApiGovernor, ApiInvocationIssue, PoserFacet, VoteOnApiInvocation, FilterGovernor, GovernedCreatorFacet, OfferFilterIssue, VoteOnOfferFilter} from '../types.js';
|
|
15
|
+
*/
|
|
16
|
+
|
|
13
17
|
/**
|
|
14
18
|
* Make a pair of positions for a question about whether to update the offer
|
|
15
19
|
* filter. If the vote passes, the list of blocked invitation strings will be
|
|
@@ -26,7 +30,7 @@ const makeOfferFilterPositions = strings => {
|
|
|
26
30
|
/**
|
|
27
31
|
* Setup to allow governance to block some invitations.
|
|
28
32
|
*
|
|
29
|
-
* @param {ERef<import('@agoric/time
|
|
33
|
+
* @param {ERef<import('@agoric/time').TimerService>} timer
|
|
30
34
|
* @param {() => Promise<PoserFacet>} getUpdatedPoserFacet
|
|
31
35
|
* @param {GovernedCreatorFacet<{}>} governedCF
|
|
32
36
|
* @returns {FilterGovernor}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @param {ERef<ParamManagerRetriever>} paramManagerRetriever
|
|
3
3
|
* @param {Instance} contractInstance
|
|
4
|
-
* @param {import('@agoric/time
|
|
4
|
+
* @param {import('@agoric/time').TimerService} timer
|
|
5
5
|
* @param {() => Promise<PoserFacet>} getUpdatedPoserFacet
|
|
6
6
|
* @returns {ParamGovernor}
|
|
7
7
|
*/
|
|
8
|
-
export function setupParamGovernance(paramManagerRetriever: ERef<ParamManagerRetriever>, contractInstance: Instance, timer: import(
|
|
8
|
+
export function setupParamGovernance(paramManagerRetriever: globalThis.ERef<ParamManagerRetriever>, contractInstance: Instance, timer: import("@agoric/time").TimerService, getUpdatedPoserFacet: () => Promise<PoserFacet>): ParamGovernor;
|
|
9
9
|
/**
|
|
10
10
|
* Return a record containing the positive and negative positions for a
|
|
11
11
|
* question on changing the param to the proposedValue.
|
|
@@ -30,4 +30,11 @@ export function assertBallotConcernsParam(paramSpec: {
|
|
|
30
30
|
* declared in the governed contract.
|
|
31
31
|
*/
|
|
32
32
|
export const CONTRACT_ELECTORATE: "Electorate";
|
|
33
|
+
import type { ParamManagerRetriever } from '../types.js';
|
|
34
|
+
import type { PoserFacet } from '../types.js';
|
|
35
|
+
import type { ParamGovernor } from '../types.js';
|
|
36
|
+
import type { ParamValue } from '../types.js';
|
|
37
|
+
import type { ParamChangePositions } from '../types.js';
|
|
38
|
+
import type { ParamChangeIssue } from '../types.js';
|
|
39
|
+
import type { QuestionSpec } from '../types.js';
|
|
33
40
|
//# sourceMappingURL=governParam.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"governParam.d.ts","sourceRoot":"","sources":["governParam.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"governParam.d.ts","sourceRoot":"","sources":["governParam.js"],"names":[],"mappings":"AAyDA;;;;;;GAMG;AACH,sHALW,QAAQ,SACR,OAAO,cAAc,EAAE,YAAY,kEA2F7C;AA/HD;;;;;;GAMG;AACH,oGAMC;AAED;;;;;;GAMG;AACH,qDAHW;IAAE,aAAa,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAC,+DAYtD;AArCD;;;GAGG;AACH,+CAAyC;2CATsI,aAAa;gCAAb,aAAa;mCAAb,aAAa;gCAAb,aAAa;0CAAb,aAAa;sCAAb,aAAa;kCAAb,aAAa"}
|
|
@@ -10,6 +10,10 @@ import {
|
|
|
10
10
|
} from '../question.js';
|
|
11
11
|
import { ParamChangesQuestionDetailsShape } from '../typeGuards.js';
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* @import {ParamValue, ParamChangePositions, QuestionSpec, ChangeParamsPosition, ParamChangeIssue, ParamGovernor, ParamManagerRetriever, PoserFacet, VoteOnParamChanges} from '../types.js';
|
|
15
|
+
*/
|
|
16
|
+
|
|
13
17
|
const { Fail } = assert;
|
|
14
18
|
|
|
15
19
|
/**
|
|
@@ -54,7 +58,7 @@ const assertBallotConcernsParam = (paramSpec, questionSpec) => {
|
|
|
54
58
|
/**
|
|
55
59
|
* @param {ERef<ParamManagerRetriever>} paramManagerRetriever
|
|
56
60
|
* @param {Instance} contractInstance
|
|
57
|
-
* @param {import('@agoric/time
|
|
61
|
+
* @param {import('@agoric/time').TimerService} timer
|
|
58
62
|
* @param {() => Promise<PoserFacet>} getUpdatedPoserFacet
|
|
59
63
|
* @returns {ParamGovernor}
|
|
60
64
|
*/
|
|
@@ -74,6 +78,7 @@ const setupParamGovernance = (
|
|
|
74
78
|
paramSpec,
|
|
75
79
|
) => {
|
|
76
80
|
const paramMgr = await E(paramManagerRetriever).get(paramSpec.paramPath);
|
|
81
|
+
/** @type {import('@endo/marshal').Passable} */
|
|
77
82
|
const changePs = {};
|
|
78
83
|
for (const name of Object.keys(paramSpec.changes)) {
|
|
79
84
|
const proposedValue = E(paramMgr).getVisibleValue(
|