@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
|
@@ -6,10 +6,10 @@ export type ParamManagerBuilder = {
|
|
|
6
6
|
addInvitation: (name: string, value: Invitation) => ParamManagerBuilder;
|
|
7
7
|
addNat: (name: string, value: bigint) => ParamManagerBuilder;
|
|
8
8
|
addRatio: (name: string, value: Ratio) => ParamManagerBuilder;
|
|
9
|
-
addRecord: (name: string, value: import(
|
|
9
|
+
addRecord: (name: string, value: import("@endo/marshal").CopyRecord<any>) => ParamManagerBuilder;
|
|
10
10
|
addString: (name: string, value: string) => ParamManagerBuilder;
|
|
11
|
-
addTimestamp: (name: string, value: import(
|
|
12
|
-
addRelativeTime: (name: string, value: import(
|
|
11
|
+
addTimestamp: (name: string, value: import("@agoric/time").Timestamp) => ParamManagerBuilder;
|
|
12
|
+
addRelativeTime: (name: string, value: import("@agoric/time").RelativeTime) => ParamManagerBuilder;
|
|
13
13
|
addUnknown: (name: string, value: any) => ParamManagerBuilder;
|
|
14
14
|
build: () => AnyParamManager;
|
|
15
15
|
};
|
|
@@ -18,7 +18,7 @@ export type ParamManagerBuilder = {
|
|
|
18
18
|
* @param {{[CONTRACT_ELECTORATE]: ParamValueTyped<'invitation'>}} governedParams
|
|
19
19
|
*/
|
|
20
20
|
export function assertElectorateMatches(paramManager: ParamManagerBase, governedParams: {
|
|
21
|
-
|
|
21
|
+
Electorate: ParamValueTyped<"invitation">;
|
|
22
22
|
}): void;
|
|
23
23
|
/**
|
|
24
24
|
* @typedef {object} ParamManagerBuilder
|
|
@@ -29,10 +29,10 @@ export function assertElectorateMatches(paramManager: ParamManagerBase, governed
|
|
|
29
29
|
* @property {(name: string, value: Invitation) => ParamManagerBuilder} addInvitation
|
|
30
30
|
* @property {(name: string, value: bigint) => ParamManagerBuilder} addNat
|
|
31
31
|
* @property {(name: string, value: Ratio) => ParamManagerBuilder} addRatio
|
|
32
|
-
* @property {(name: string, value: import('@endo/marshal').CopyRecord<
|
|
32
|
+
* @property {(name: string, value: import('@endo/marshal').CopyRecord<any>) => ParamManagerBuilder} addRecord
|
|
33
33
|
* @property {(name: string, value: string) => ParamManagerBuilder} addString
|
|
34
|
-
* @property {(name: string, value: import('@agoric/time
|
|
35
|
-
* @property {(name: string, value: import('@agoric/time
|
|
34
|
+
* @property {(name: string, value: import('@agoric/time').Timestamp) => ParamManagerBuilder} addTimestamp
|
|
35
|
+
* @property {(name: string, value: import('@agoric/time').RelativeTime) => ParamManagerBuilder} addRelativeTime
|
|
36
36
|
* @property {(name: string, value: any) => ParamManagerBuilder} addUnknown
|
|
37
37
|
* @property {() => AnyParamManager} build
|
|
38
38
|
*/
|
|
@@ -40,6 +40,10 @@ export function assertElectorateMatches(paramManager: ParamManagerBase, governed
|
|
|
40
40
|
* @param {import('@agoric/notifier').StoredPublisherKit<GovernanceSubscriptionState>} publisherKit
|
|
41
41
|
* @param {ERef<ZoeService>} [zoe]
|
|
42
42
|
*/
|
|
43
|
-
export function makeParamManagerBuilder(publisherKit: import(
|
|
44
|
-
import {
|
|
43
|
+
export function makeParamManagerBuilder(publisherKit: import("@agoric/notifier").StoredPublisherKit<GovernanceSubscriptionState>, zoe?: globalThis.ERef<ZoeService> | undefined): ParamManagerBuilder;
|
|
44
|
+
import type { AnyParamManager } from '../types.js';
|
|
45
|
+
import type { ParamManagerBase } from '../types.js';
|
|
46
|
+
import { CONTRACT_ELECTORATE } from './governParam.js';
|
|
47
|
+
import type { ParamValueTyped } from '../types.js';
|
|
48
|
+
import type { GovernanceSubscriptionState } from '../types.js';
|
|
45
49
|
//# sourceMappingURL=paramManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paramManager.d.ts","sourceRoot":"","sources":["paramManager.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"paramManager.d.ts","sourceRoot":"","sources":["paramManager.js"],"names":[],"mappings":";eA2Cc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,mBAAmB;cACpD,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,KAAK,mBAAmB;qBACnD,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,KAAK,mBAAmB;iBAC1D,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,KAAK,mBAAmB;mBACtD,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,KAAK,mBAAmB;YACxD,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,mBAAmB;cACpD,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,KAAK,mBAAmB;eACnD,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,eAAe,EAAE,UAAU,CAAC,GAAG,CAAC,KAAK,mBAAmB;eACrF,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,mBAAmB;kBACpD,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,cAAc,EAAE,SAAS,KAAK,mBAAmB;qBAC9E,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,cAAc,EAAE,YAAY,KAAK,mBAAmB;gBACjF,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,mBAAmB;;;AA7B/D;;;GAGG;AACH;;SAUC;AAED;;;;;;;;;;;;;;;GAeG;AAEH;;;GAGG;AACH,sMAgXC;qCA1ZiI,aAAa;sCAAb,aAAa;oCAH3G,kBAAkB;qCAG4E,aAAa;iDAAb,aAAa"}
|
|
@@ -17,6 +17,10 @@ import {
|
|
|
17
17
|
} from './assertions.js';
|
|
18
18
|
import { CONTRACT_ELECTORATE } from './governParam.js';
|
|
19
19
|
|
|
20
|
+
/**
|
|
21
|
+
* @import {AnyParamManager, GovernanceSubscriptionState, ParamManagerBase, ParamStateRecord, ParamValueTyped, UpdateParams} from '../types.js';
|
|
22
|
+
*/
|
|
23
|
+
|
|
20
24
|
const { Fail, quote: q } = assert;
|
|
21
25
|
|
|
22
26
|
/**
|
|
@@ -44,10 +48,10 @@ const assertElectorateMatches = (paramManager, governedParams) => {
|
|
|
44
48
|
* @property {(name: string, value: Invitation) => ParamManagerBuilder} addInvitation
|
|
45
49
|
* @property {(name: string, value: bigint) => ParamManagerBuilder} addNat
|
|
46
50
|
* @property {(name: string, value: Ratio) => ParamManagerBuilder} addRatio
|
|
47
|
-
* @property {(name: string, value: import('@endo/marshal').CopyRecord<
|
|
51
|
+
* @property {(name: string, value: import('@endo/marshal').CopyRecord<any>) => ParamManagerBuilder} addRecord
|
|
48
52
|
* @property {(name: string, value: string) => ParamManagerBuilder} addString
|
|
49
|
-
* @property {(name: string, value: import('@agoric/time
|
|
50
|
-
* @property {(name: string, value: import('@agoric/time
|
|
53
|
+
* @property {(name: string, value: import('@agoric/time').Timestamp) => ParamManagerBuilder} addTimestamp
|
|
54
|
+
* @property {(name: string, value: import('@agoric/time').RelativeTime) => ParamManagerBuilder} addRelativeTime
|
|
51
55
|
* @property {(name: string, value: any) => ParamManagerBuilder} addUnknown
|
|
52
56
|
* @property {() => AnyParamManager} build
|
|
53
57
|
*/
|
|
@@ -89,7 +93,7 @@ const makeParamManagerBuilder = (publisherKit, zoe) => {
|
|
|
89
93
|
* @param {Keyword} name
|
|
90
94
|
* @param {unknown} value
|
|
91
95
|
* @param {(val) => void} assertion
|
|
92
|
-
* @param {ParamType} type
|
|
96
|
+
* @param {import('../constants.js').ParamType} type
|
|
93
97
|
*/
|
|
94
98
|
const buildCopyParam = (name, value, assertion, type) => {
|
|
95
99
|
let current;
|
|
@@ -179,7 +183,7 @@ const makeParamManagerBuilder = (publisherKit, zoe) => {
|
|
|
179
183
|
return builder;
|
|
180
184
|
};
|
|
181
185
|
|
|
182
|
-
/** @type {(name: string, value: import('@endo/marshal').CopyRecord
|
|
186
|
+
/** @type {(name: string, value: import('@endo/marshal').CopyRecord, builder: ParamManagerBuilder) => ParamManagerBuilder} */
|
|
183
187
|
const addRecord = (name, value, builder) => {
|
|
184
188
|
const assertRecord = v => {
|
|
185
189
|
passStyleOf(v);
|
|
@@ -196,13 +200,13 @@ const makeParamManagerBuilder = (publisherKit, zoe) => {
|
|
|
196
200
|
return builder;
|
|
197
201
|
};
|
|
198
202
|
|
|
199
|
-
/** @type {(name: string, value: import('@agoric/time
|
|
203
|
+
/** @type {(name: string, value: import('@agoric/time').Timestamp, builder: ParamManagerBuilder) => ParamManagerBuilder} */
|
|
200
204
|
const addTimestamp = (name, value, builder) => {
|
|
201
205
|
buildCopyParam(name, value, assertTimestamp, ParamTypes.TIMESTAMP);
|
|
202
206
|
return builder;
|
|
203
207
|
};
|
|
204
208
|
|
|
205
|
-
/** @type {(name: string, value: import('@agoric/time
|
|
209
|
+
/** @type {(name: string, value: import('@agoric/time').RelativeTime, builder: ParamManagerBuilder) => ParamManagerBuilder} */
|
|
206
210
|
const addRelativeTime = (name, value, builder) => {
|
|
207
211
|
buildCopyParam(name, value, assertRelativeTime, ParamTypes.RELATIVE_TIME);
|
|
208
212
|
return builder;
|
|
@@ -219,10 +223,10 @@ const makeParamManagerBuilder = (publisherKit, zoe) => {
|
|
|
219
223
|
if (!zoe) {
|
|
220
224
|
throw Fail`zoe must be provided for governed Invitations ${zoe}`;
|
|
221
225
|
}
|
|
222
|
-
|
|
223
|
-
//
|
|
224
|
-
|
|
225
|
-
|
|
226
|
+
|
|
227
|
+
// local check on isLive() gives better report than .getInvitationDetails()
|
|
228
|
+
const isLive = await E(E(zoe).getInvitationIssuer()).isLive(i);
|
|
229
|
+
isLive || Fail`Invitation passed to paramManager is not live ${i}`;
|
|
226
230
|
};
|
|
227
231
|
|
|
228
232
|
/**
|
|
@@ -366,10 +370,10 @@ const makeParamManagerBuilder = (publisherKit, zoe) => {
|
|
|
366
370
|
const prepared = await Promise.all(asyncResults);
|
|
367
371
|
|
|
368
372
|
// actually update
|
|
369
|
-
paramNames.
|
|
373
|
+
for (const [i, name] of paramNames.entries()) {
|
|
370
374
|
const setFn = setters[`update${name}`];
|
|
371
375
|
setFn(prepared[i]);
|
|
372
|
-
}
|
|
376
|
+
}
|
|
373
377
|
publish();
|
|
374
378
|
};
|
|
375
379
|
|
|
@@ -377,7 +381,7 @@ const makeParamManagerBuilder = (publisherKit, zoe) => {
|
|
|
377
381
|
const build = () => {
|
|
378
382
|
// XXX let params be finished async. A concession to upgradability
|
|
379
383
|
// UNTIL https://github.com/Agoric/agoric-sdk/issues/4343
|
|
380
|
-
E.when(finishBuilding(), () => publish());
|
|
384
|
+
void E.when(finishBuilding(), () => publish());
|
|
381
385
|
|
|
382
386
|
// CRUCIAL: Contracts that call buildParamManager should only export the
|
|
383
387
|
// resulting paramManager to their creatorFacet, where it will be picked up by
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
export function makeParamManager<T extends Record<string, SyncSpecTuple | AsyncSpecTuple>>(publisherKit: import(
|
|
2
|
-
export function makeParamManagerSync<T extends Record<string, SyncSpecTuple>>(publisherKit: import(
|
|
3
|
-
export function makeParamManagerFromTerms<I extends Record<string, Invitation<unknown,
|
|
1
|
+
export function makeParamManager<T extends Record<string, SyncSpecTuple | AsyncSpecTuple>>(publisherKit: import("@agoric/notifier").StoredPublisherKit<GovernanceSubscriptionState>, spec: T, zcf: ZCF): TypedParamManager<{ [K in keyof T]: T[K][0]; }>;
|
|
2
|
+
export function makeParamManagerSync<T extends Record<string, SyncSpecTuple>>(publisherKit: import("@agoric/notifier").StoredPublisherKit<GovernanceSubscriptionState>, spec: T): TypedParamManager<{ [K in keyof T]: T[K][0]; }>;
|
|
3
|
+
export function makeParamManagerFromTerms<I extends Record<string, Invitation<unknown, undefined>> & {
|
|
4
4
|
Electorate: Invitation;
|
|
5
|
-
}, M extends ParamTypesMap>(publisherKit: import(
|
|
6
|
-
export type ParamTypesMap =
|
|
5
|
+
}, M extends ParamTypesMap>(publisherKit: import("@agoric/notifier").StoredPublisherKit<GovernanceSubscriptionState>, zcf: ZCF<GovernanceTerms<M>>, invitations: I, paramTypesMap: M): TypedParamManager<M & { [K in keyof I]: "invitation"; }>;
|
|
6
|
+
export type ParamTypesMap = {
|
|
7
|
+
[x: string]: ParamType;
|
|
8
|
+
};
|
|
7
9
|
export type ParamTypesMapFromRecord<M extends ParamStateRecord> = { [R in keyof M]: M[R]["type"]; };
|
|
8
10
|
export type ParamRecordsFromTypes<M extends ParamTypesMap> = { [T in keyof M]: {
|
|
9
11
|
type: M[T];
|
|
@@ -19,11 +21,18 @@ export type TypedParamManager<M extends ParamTypesMap> = ParamManagerBase & Gett
|
|
|
19
21
|
/**
|
|
20
22
|
* param spec tuple
|
|
21
23
|
*/
|
|
22
|
-
export type ST<T extends
|
|
24
|
+
export type ST<T extends ParamType> = [type: T, value: ParamValueForType<T>];
|
|
23
25
|
export type InvitationParam = {
|
|
24
|
-
type:
|
|
25
|
-
value: Amount<
|
|
26
|
+
type: "invitation";
|
|
27
|
+
value: Amount<"set">;
|
|
26
28
|
};
|
|
27
|
-
export type SyncSpecTuple =
|
|
28
|
-
export type AsyncSpecTuple = [
|
|
29
|
+
export type SyncSpecTuple = ST<"amount"> | ST<"brand"> | ST<"installation"> | ST<"instance"> | ST<"nat"> | ST<"ratio"> | ST<"string"> | ST<"timestamp"> | ST<"relativeTime"> | ST<"unknown">;
|
|
30
|
+
export type AsyncSpecTuple = ["invitation", Invitation];
|
|
31
|
+
import type { GovernanceSubscriptionState } from '../types.js';
|
|
32
|
+
import type { GovernanceTerms } from '../types.js';
|
|
33
|
+
import type { ParamType } from '../constants.js';
|
|
34
|
+
import type { ParamStateRecord } from '../types.js';
|
|
35
|
+
import type { ParamValueForType } from '../types.js';
|
|
36
|
+
import type { ParamManagerBase } from '../types.js';
|
|
37
|
+
import type { UpdateParams } from '../types.js';
|
|
29
38
|
//# sourceMappingURL=typedParamManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typedParamManager.d.ts","sourceRoot":"","sources":["typedParamManager.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"typedParamManager.d.ts","sourceRoot":"","sources":["typedParamManager.js"],"names":[],"mappings":"AAyFO,iCAFyC,CAAC,yJAAD,CAAC,AAFrC,OACD,GAAG,GACD,iBAAiB,CAAC,GAAE,CAAC,IAAI,MAAU,CAAC,AAAJ,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAC,CAAC,CAuBxD;AAaM,qCAFyC,CAAC,wIAAD,CAAC,AADrC,GACC,iBAAiB,CAAC,GAAE,CAAC,IAAI,MAAU,CAAC,AAAJ,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAC,CAAC,CAaxD;AAYM,0CAFyC,CAAC;gBANO,UAAU;GAMnC,CAAC,6JAAgB,CAAC,AAFrC,iBAEmB,CAAC,AADpB,GACC,iBAAiB,CAAC,CAAC,GAAG,GAAE,CAAC,IAAI,MAAM,CAAC,GAAG,YAAY,GAAC,CAAC,CA6BjE;;;;oCA5J8B,CAAC,6BAAnB,GAAG,CAAC,IAAI,MAAU,CAAC,AAAJ,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAC;kCAI0B,CAAC,6BAAC,CAAC;UAAH,CAAC,AAA/B,CAAgC,CAAC,AAA/B,CAAC;;;oBAMwB,CAAC,6BAAC,CAAC;qBAOE,CAAC,6BAAC,CAAC,2EAAO,IAAI;8BAMF,CAAC;cAAf,MAAM,OAAO,CAAC,CAAC,CAAC;;;;;;;eAgBtC,CAAC;8BAIpC;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAA;CAAE;4BAO5C,EAAE,CAAC,QAAQ,CAAC,GACpB,EAAE,CAAC,OAAO,CAAC,GACX,EAAE,CAAC,cAAc,CAAC,GAClB,EAAE,CAAC,UAAU,CAAC,GACd,EAAE,CAAC,KAAK,CAAC,GACT,EAAE,CAAC,OAAO,CAAC,GACX,EAAE,CAAC,QAAQ,CAAC,GACZ,EAAE,CAAC,WAAW,CAAC,GACf,EAAE,CAAC,cAAc,CAAC,GAClB,EAAE,CAAC,SAAS,CAAC;6BAEL,CAAC,YAAY,EAAE,UAAU,CAAC;iDAtE2M,aAAa;qCAAb,aAAa;+BACnO,iBAAiB;sCADqM,aAAa;uCAAb,aAAa;sCAAb,aAAa;kCAAb,aAAa"}
|
|
@@ -5,6 +5,11 @@ import { makeParamManagerBuilder } from './paramManager.js';
|
|
|
5
5
|
|
|
6
6
|
const { Fail, quote: q } = assert;
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* @import {VoteCounterCreatorFacet, VoteCounterPublicFacet, QuestionSpec, OutcomeRecord, AddQuestion, AddQuestionReturn, GovernanceSubscriptionState, GovernanceTerms, ParamManagerBase, ParamStateRecord, ParamValueForType, UpdateParams} from '../types.js';
|
|
10
|
+
* @import {ParamType} from '../constants.js';
|
|
11
|
+
*/
|
|
12
|
+
|
|
8
13
|
/**
|
|
9
14
|
* @typedef {Record<Keyword, ParamType>} ParamTypesMap
|
|
10
15
|
*/
|
|
@@ -1,23 +1,29 @@
|
|
|
1
|
+
/** @type {ContractMeta} */
|
|
2
|
+
export const meta: ContractMeta;
|
|
1
3
|
export function validateQuestionDetails(zoe: ERef<ZoeService>, electorate: Instance, details: ParamChangeIssueDetails): Promise<[void, void, void]>;
|
|
2
4
|
export function validateQuestionFromCounter(zoe: ERef<ZoeService>, electorate: Instance, voteCounter: Instance): Promise<[void, void, void]>;
|
|
3
|
-
export function
|
|
4
|
-
timer: import(
|
|
5
|
+
export function start<SF extends GovernableStartFn>(zcf: ZCF<{
|
|
6
|
+
timer: import("@agoric/time").TimerService;
|
|
5
7
|
governedContractInstallation: Installation<SF>;
|
|
6
8
|
governed: {
|
|
7
9
|
issuerKeywordRecord: IssuerKeywordRecord;
|
|
8
10
|
terms: {
|
|
9
11
|
governedParams: {
|
|
10
|
-
[CONTRACT_ELECTORATE]: import(
|
|
12
|
+
[CONTRACT_ELECTORATE]: import("./contractGovernance/typedParamManager.js").InvitationParam;
|
|
11
13
|
};
|
|
12
14
|
};
|
|
13
15
|
label?: string;
|
|
14
16
|
};
|
|
15
17
|
}>, privateArgs: {
|
|
16
18
|
governed: Record<string, unknown>;
|
|
17
|
-
}, baggage:
|
|
19
|
+
}, baggage: import("@agoric/vat-data").Baggage): Promise<{
|
|
18
20
|
creatorFacet: GovernorCreatorFacet<SF>;
|
|
19
21
|
publicFacet: GovernorPublic;
|
|
20
22
|
}>;
|
|
21
23
|
export type ContractGovernorTerms = StandardTerms;
|
|
22
|
-
import {
|
|
24
|
+
import type { ParamChangeIssueDetails } from './types.js';
|
|
25
|
+
import type { GovernableStartFn } from './types.js';
|
|
26
|
+
import { CONTRACT_ELECTORATE } from './contractGovernance/governParam.js';
|
|
27
|
+
import type { GovernorCreatorFacet } from './types.js';
|
|
28
|
+
import type { GovernorPublic } from './types.js';
|
|
23
29
|
//# sourceMappingURL=contractGovernor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contractGovernor.d.ts","sourceRoot":"","sources":["contractGovernor.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"contractGovernor.d.ts","sourceRoot":"","sources":["contractGovernor.js"],"names":[],"mappings":"AAiBA,2BAA2B;AAC3B,mBADW,YAAY,CAGrB;AAYK,6CAJI,IAAI,CAAC,UAAU,CAAC,cAChB,QAAQ,iEAmBlB;AAYM,iDAJI,IAAI,CAAC,UAAU,CAAC,cAChB,QAAQ,eACR,QAAQ,+BAWlB;AA0FM,sBALiC,EAAE,iCAb/B,GAAG,CAAC;IACd,KAAS,EAAE,OAAO,cAAc,EAAE,YAAY,CAAC;IAC/C,4BAAgC,EAAE,YAAY,CAWP,EAAE,AAXQ,CAAC,CAAC;IACnD,QAAY,EAAE;QACd,mBAAyB,EAAE,mBAAmB,CAAC;QAC/C,KAAW,EAAE;YAAC,cAAc,EAAE;gBAAC,CAAC,mBAAmB,CAAC,EAAE,OAAO,2CAA2C,EAAE,eAAe,CAAA;aAAC,CAAA;SAAC,CAAC;QAC5H,KAAW,CAAC,EAAE,MAAM,CAAC;KAChB,CAAA;CACF,CAAC,eACM;IACV,QAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAClC,WAKO,OAAO,kBAAkB,EAAE,OAAO;;;GA6D5C;oCAjJY,aAAa;6CA/DyE,YAAY;uCAAZ,YAAY;oCAL3E,qCAAqC;0CAK0B,YAAY;oCAAZ,YAAY"}
|
package/src/contractGovernor.js
CHANGED
|
@@ -7,10 +7,20 @@ import { CONTRACT_ELECTORATE } from './contractGovernance/governParam.js';
|
|
|
7
7
|
import { prepareContractGovernorKit } from './contractGovernorKit.js';
|
|
8
8
|
import { ParamChangesQuestionDetailsShape } from './typeGuards.js';
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* @import {GovernableStartFn, GovernorCreatorFacet, GovernorPublic, ParamChangeIssueDetails} from './types.js';
|
|
12
|
+
*/
|
|
13
|
+
|
|
10
14
|
const { Fail } = assert;
|
|
11
15
|
|
|
12
16
|
const trace = makeTracer('CGov', false);
|
|
13
17
|
|
|
18
|
+
/** @type {ContractMeta} */
|
|
19
|
+
export const meta = {
|
|
20
|
+
upgradability: 'canUpgrade',
|
|
21
|
+
};
|
|
22
|
+
harden(meta);
|
|
23
|
+
|
|
14
24
|
/**
|
|
15
25
|
* Validate that the question details correspond to a parameter change question
|
|
16
26
|
* that the electorate hosts, and that the voteCounter and other details are
|
|
@@ -62,7 +72,7 @@ harden(validateQuestionFromCounter);
|
|
|
62
72
|
|
|
63
73
|
/**
|
|
64
74
|
* @typedef {StandardTerms} ContractGovernorTerms
|
|
65
|
-
* @property {import('@agoric/time
|
|
75
|
+
* @property {import('@agoric/time').TimerService} timer
|
|
66
76
|
* @property {Installation} governedContractInstallation
|
|
67
77
|
*/
|
|
68
78
|
|
|
@@ -116,7 +126,7 @@ harden(validateQuestionFromCounter);
|
|
|
116
126
|
* GovernorPublic,
|
|
117
127
|
* GovernorCreatorFacet<PF,CF>,
|
|
118
128
|
* {
|
|
119
|
-
* timer: import('@agoric/time
|
|
129
|
+
* timer: import('@agoric/time').TimerService,
|
|
120
130
|
* governedContractInstallation: Installation<CF>,
|
|
121
131
|
* governed: {
|
|
122
132
|
* issuerKeywordRecord: IssuerKeywordRecord,
|
|
@@ -130,7 +140,7 @@ harden(validateQuestionFromCounter);
|
|
|
130
140
|
*
|
|
131
141
|
* @template {GovernableStartFn} SF Start function of governed contract
|
|
132
142
|
* @param {ZCF<{
|
|
133
|
-
* timer: import('@agoric/time
|
|
143
|
+
* timer: import('@agoric/time').TimerService,
|
|
134
144
|
* governedContractInstallation: Installation<SF>,
|
|
135
145
|
* governed: {
|
|
136
146
|
* issuerKeywordRecord: IssuerKeywordRecord,
|
|
@@ -147,8 +157,8 @@ harden(validateQuestionFromCounter);
|
|
|
147
157
|
* }>}
|
|
148
158
|
* @param {import('@agoric/vat-data').Baggage} baggage
|
|
149
159
|
*/
|
|
150
|
-
export const
|
|
151
|
-
trace('
|
|
160
|
+
export const start = async (zcf, privateArgs, baggage) => {
|
|
161
|
+
trace('start');
|
|
152
162
|
const zoe = zcf.getZoeService();
|
|
153
163
|
trace('getTerms', zcf.getTerms());
|
|
154
164
|
const {
|
|
@@ -183,8 +193,8 @@ export const prepare = async (zcf, privateArgs, baggage) => {
|
|
|
183
193
|
const startedInstanceKit = await E(zoe).startInstance(
|
|
184
194
|
governedContractInstallation,
|
|
185
195
|
governedIssuerKeywordRecord,
|
|
186
|
-
|
|
187
|
-
// @ts-
|
|
196
|
+
|
|
197
|
+
// @ts-expect-error XXX governance types https://github.com/Agoric/agoric-sdk/issues/7178
|
|
188
198
|
augmentedTerms,
|
|
189
199
|
privateArgs.governed,
|
|
190
200
|
governedContractLabel,
|
|
@@ -202,9 +212,9 @@ export const prepare = async (zcf, privateArgs, baggage) => {
|
|
|
202
212
|
// Specifically, to the vat of the governed contract for its API names. The exo
|
|
203
213
|
// defers that until API governance is requested to be invoked or validated.
|
|
204
214
|
|
|
205
|
-
trace('
|
|
215
|
+
trace('start complete');
|
|
206
216
|
|
|
207
217
|
// CRUCIAL: only contractGovernor should get the ability to update params
|
|
208
218
|
return { creatorFacet: governorKit.creator, publicFacet: governorKit.public };
|
|
209
219
|
};
|
|
210
|
-
harden(
|
|
220
|
+
harden(start);
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export function prepareContractGovernorKit(baggage:
|
|
2
|
-
timer: import(
|
|
1
|
+
export function prepareContractGovernorKit(baggage: import("@agoric/vat-data").Baggage, powers: {
|
|
2
|
+
timer: import("@agoric/time").TimerService;
|
|
3
3
|
zoe: ERef<ZoeService>;
|
|
4
|
-
}): (startedInstanceKit: import("@agoric/zoe/src/zoeService/utils.js").StartedInstanceKit<GovernableStartFn>, limitedCreatorFacet: any) => {
|
|
4
|
+
}): (startedInstanceKit: import("@agoric/zoe/src/zoeService/utils.js").StartedInstanceKit<GovernableStartFn>, limitedCreatorFacet: any) => import("@endo/exo").GuardedKit<{
|
|
5
5
|
helper: {
|
|
6
6
|
/** @type {() => Promise<Instance>} */
|
|
7
7
|
getElectorateInstance(): Promise<Instance>;
|
|
8
8
|
/** @type {() => Promise<PoserFacet>} */
|
|
9
9
|
getUpdatedPoserFacet(): Promise<PoserFacet>;
|
|
10
|
-
provideApiGovernance(): Promise<ApiGovernor>;
|
|
11
|
-
provideFilterGovernance(): FilterGovernor;
|
|
12
|
-
provideParamGovernance(): ParamGovernor;
|
|
10
|
+
provideApiGovernance(): Promise<import("./types.js").ApiGovernor>;
|
|
11
|
+
provideFilterGovernance(): import("./types.js").FilterGovernor;
|
|
12
|
+
provideParamGovernance(): import("./types.js").ParamGovernor;
|
|
13
13
|
};
|
|
14
14
|
creator: {
|
|
15
15
|
/**
|
|
@@ -18,52 +18,15 @@ export function prepareContractGovernorKit(baggage: MapStore<string, unknown>, p
|
|
|
18
18
|
*/
|
|
19
19
|
replaceElectorate(poserInvitation: Invitation): Promise<void>;
|
|
20
20
|
/** @type {VoteOnParamChanges} */
|
|
21
|
-
voteOnParamChanges(voteCounterInstallation: Installation<any>, deadline: import("@agoric/time
|
|
21
|
+
voteOnParamChanges(voteCounterInstallation: Installation<any>, deadline: import("@agoric/time").Timestamp, paramSpec: import("./types.js").ParamChangesSpec<import("./types.js").StandardParamPath>): Promise<import("./types.js").ContractGovernanceVoteResult>;
|
|
22
22
|
/** @type {VoteOnApiInvocation} */
|
|
23
|
-
voteOnApiInvocation(apiMethodName: string, methodArgs:
|
|
23
|
+
voteOnApiInvocation(apiMethodName: string, methodArgs: import("@endo/pass-style").Passable[], voteCounterInstallation: Installation, deadline: import("@agoric/time").Timestamp): Promise<import("./types.js").ContractGovernanceVoteResult>;
|
|
24
24
|
/** @type {VoteOnOfferFilter} */
|
|
25
|
-
voteOnOfferFilter(voteCounterInstallation: Installation
|
|
25
|
+
voteOnOfferFilter(voteCounterInstallation: Installation, deadline: import("@agoric/time").Timestamp, strings: string[]): Promise<import("./types.js").ContractGovernanceVoteResult>;
|
|
26
26
|
getCreatorFacet(): any;
|
|
27
|
-
getAdminFacet(): import("@agoric/zoe/src/zoeService/utils.js").AdminFacet
|
|
27
|
+
getAdminFacet(): import("@agoric/zoe/src/zoeService/utils.js").AdminFacet<GovernableStartFn>;
|
|
28
28
|
getInstance(): import("@agoric/zoe/src/zoeService/utils.js").Instance<GovernableStartFn>;
|
|
29
|
-
getPublicFacet(): GovernedPublicFacetMethods;
|
|
30
|
-
};
|
|
31
|
-
public: {
|
|
32
|
-
getElectorate(): Promise<Instance>;
|
|
33
|
-
getGovernedContract(): import("@agoric/zoe/src/zoeService/utils.js").Instance<GovernableStartFn>;
|
|
34
|
-
/** @param {Instance} counter */
|
|
35
|
-
validateVoteCounter(counter: Instance): Promise<void>;
|
|
36
|
-
/** @param {Instance} regP */
|
|
37
|
-
validateElectorate(regP: Instance): Promise<void>;
|
|
38
|
-
/** @param {ClosingRule} closingRule */
|
|
39
|
-
validateTimer(closingRule: ClosingRule): void;
|
|
40
|
-
};
|
|
41
|
-
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
42
|
-
helper: {
|
|
43
|
-
/** @type {() => Promise<Instance>} */
|
|
44
|
-
getElectorateInstance(): Promise<Instance>;
|
|
45
|
-
/** @type {() => Promise<PoserFacet>} */
|
|
46
|
-
getUpdatedPoserFacet(): Promise<PoserFacet>;
|
|
47
|
-
provideApiGovernance(): Promise<ApiGovernor>;
|
|
48
|
-
provideFilterGovernance(): FilterGovernor;
|
|
49
|
-
provideParamGovernance(): ParamGovernor;
|
|
50
|
-
};
|
|
51
|
-
creator: {
|
|
52
|
-
/**
|
|
53
|
-
* @param {Invitation} poserInvitation
|
|
54
|
-
* @returns {Promise<void>}
|
|
55
|
-
*/
|
|
56
|
-
replaceElectorate(poserInvitation: Invitation): Promise<void>;
|
|
57
|
-
/** @type {VoteOnParamChanges} */
|
|
58
|
-
voteOnParamChanges(voteCounterInstallation: Installation<any>, deadline: import("@agoric/time/src/types").Timestamp, paramSpec: ParamChangesSpec<StandardParamPath>): ContractGovernanceVoteResult;
|
|
59
|
-
/** @type {VoteOnApiInvocation} */
|
|
60
|
-
voteOnApiInvocation(apiMethodName: string, methodArgs: unknown[], voteCounterInstallation: Installation<any>, deadline: import("@agoric/time/src/types").Timestamp): Promise<ContractGovernanceVoteResult>;
|
|
61
|
-
/** @type {VoteOnOfferFilter} */
|
|
62
|
-
voteOnOfferFilter(voteCounterInstallation: Installation<any>, deadline: import("@agoric/time/src/types").Timestamp, strings: string[]): ContractGovernanceVoteResult;
|
|
63
|
-
getCreatorFacet(): any;
|
|
64
|
-
getAdminFacet(): import("@agoric/zoe/src/zoeService/utils.js").AdminFacet;
|
|
65
|
-
getInstance(): import("@agoric/zoe/src/zoeService/utils.js").Instance<GovernableStartFn>;
|
|
66
|
-
getPublicFacet(): GovernedPublicFacetMethods;
|
|
29
|
+
getPublicFacet(): import("./types.js").GovernedPublicFacetMethods;
|
|
67
30
|
};
|
|
68
31
|
public: {
|
|
69
32
|
getElectorate(): Promise<Instance>;
|
|
@@ -77,4 +40,7 @@ export function prepareContractGovernorKit(baggage: MapStore<string, unknown>, p
|
|
|
77
40
|
};
|
|
78
41
|
}>;
|
|
79
42
|
export type ContractGovernorKit = ReturnType<ReturnType<typeof prepareContractGovernorKit>>;
|
|
43
|
+
import type { GovernableStartFn } from './types.js';
|
|
44
|
+
import type { PoserFacet } from './types.js';
|
|
45
|
+
import type { ClosingRule } from './types.js';
|
|
80
46
|
//# sourceMappingURL=contractGovernorKit.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contractGovernorKit.d.ts","sourceRoot":"","sources":["contractGovernorKit.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"contractGovernorKit.d.ts","sourceRoot":"","sources":["contractGovernorKit.js"],"names":[],"mappings":"AAkEO,oDANI,OAAO,kBAAkB,EAAE,OAAO,UAClC;IACV,KAAS,EAAE,OAAO,cAAc,EAAE,YAAY,CAAC;IAC/C,GAAO,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;CACvB;;QAiCI,sCAAsC;iCAArB,OAAO,CAAC,QAAQ,CAAC;QAOlC,wCAAwC;;;;;;;QAoExC;;;WAGG;2CAFQ,UAAU,GACR,OAAO,CAAC,IAAI,CAAC;QAgB1B,iCAAiC;;QAOjC,kCAAkC;+HAoF8mU,YAAY,YAAqC,OAAO,cAAc,EAAE,SAAS;QArEjuU,gCAAgC;mDAqEmzU,YAAY,YAAqC,OAAO,cAAc,EAAE,SAAS,WAAsB,QAAQ;;;;;;;;;QAzCl8U,gCAAgC;qCAApB,QAAQ;QAepB,6BAA6B;iCAAjB,QAAQ;QAWpB,uCAAuC;;;GAY9C;kCAEa,UAAU,CAAC,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAC;uCArQ2K,YAAY;gCAAZ,YAAY;iCAAZ,YAAY"}
|
|
@@ -1,21 +1,66 @@
|
|
|
1
1
|
import { Fail } from '@agoric/assert';
|
|
2
|
-
import { makeTracer } from '@agoric/internal';
|
|
3
|
-
import { prepareExoClassKit } from '@agoric/vat-data';
|
|
2
|
+
import { UnguardedHelperI, makeTracer } from '@agoric/internal';
|
|
3
|
+
import { M, prepareExoClassKit } from '@agoric/vat-data';
|
|
4
4
|
import { E } from '@endo/eventual-send';
|
|
5
|
+
import {
|
|
6
|
+
InvitationShape,
|
|
7
|
+
InstanceHandleShape,
|
|
8
|
+
InstallationShape,
|
|
9
|
+
} from '@agoric/zoe/src/typeGuards.js';
|
|
10
|
+
import { TimestampShape } from '@agoric/time';
|
|
5
11
|
import { setupApiGovernance } from './contractGovernance/governApi.js';
|
|
6
12
|
import { setupFilterGovernance } from './contractGovernance/governFilter.js';
|
|
7
13
|
import {
|
|
8
14
|
CONTRACT_ELECTORATE,
|
|
9
15
|
setupParamGovernance,
|
|
10
16
|
} from './contractGovernance/governParam.js';
|
|
17
|
+
import { ClosingRuleShape, ParamChangesSpecShape } from './typeGuards.js';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @import {VoteCounterCreatorFacet, VoteCounterPublicFacet, QuestionSpec, OutcomeRecord, AddQuestion, AddQuestionReturn, ClosingRule, GovernableStartFn, LimitedCF, PoserFacet, VoteOnApiInvocation, VoteOnOfferFilter, VoteOnParamChanges} from './types.js';
|
|
21
|
+
*/
|
|
11
22
|
|
|
12
23
|
const trace = makeTracer('CGK', false);
|
|
13
24
|
|
|
25
|
+
const ContractGovernorKitI = {
|
|
26
|
+
helper: UnguardedHelperI,
|
|
27
|
+
creator: M.interface('Contract Governor Kit creator', {
|
|
28
|
+
replaceElectorate: M.call(InvitationShape).returns(M.promise()),
|
|
29
|
+
voteOnParamChanges: M.call(
|
|
30
|
+
InstallationShape,
|
|
31
|
+
TimestampShape,
|
|
32
|
+
ParamChangesSpecShape,
|
|
33
|
+
).returns(M.promise()),
|
|
34
|
+
voteOnApiInvocation: M.call(
|
|
35
|
+
M.string(),
|
|
36
|
+
M.arrayOf(M.any()),
|
|
37
|
+
InstallationShape,
|
|
38
|
+
TimestampShape,
|
|
39
|
+
).returns(M.promise()),
|
|
40
|
+
voteOnOfferFilter: M.call(
|
|
41
|
+
InstallationShape,
|
|
42
|
+
TimestampShape,
|
|
43
|
+
M.arrayOf(M.string()),
|
|
44
|
+
).returns(M.promise()),
|
|
45
|
+
getCreatorFacet: M.call().returns(M.remotable('ElectorateCreator')),
|
|
46
|
+
getAdminFacet: M.call().returns(M.remotable('ElectorateAdmin')),
|
|
47
|
+
getInstance: M.call().returns(InstanceHandleShape),
|
|
48
|
+
getPublicFacet: M.call().returns(M.remotable('ElectoratePublic')),
|
|
49
|
+
}),
|
|
50
|
+
public: M.interface('Contract Governor Kit public', {
|
|
51
|
+
getElectorate: M.call().returns(M.promise(/* Instance */)),
|
|
52
|
+
getGovernedContract: M.call().returns(InstanceHandleShape),
|
|
53
|
+
validateVoteCounter: M.call(InstanceHandleShape).returns(M.promise()),
|
|
54
|
+
validateElectorate: M.call(InstanceHandleShape).returns(M.promise()),
|
|
55
|
+
validateTimer: M.call(ClosingRuleShape).returns(),
|
|
56
|
+
}),
|
|
57
|
+
};
|
|
58
|
+
|
|
14
59
|
/**
|
|
15
60
|
*
|
|
16
61
|
* @param {import('@agoric/vat-data').Baggage} baggage
|
|
17
62
|
* @param {{
|
|
18
|
-
* timer: import('@agoric/time
|
|
63
|
+
* timer: import('@agoric/time').TimerService,
|
|
19
64
|
* zoe: ERef<ZoeService>,
|
|
20
65
|
* }} powers
|
|
21
66
|
*/
|
|
@@ -36,7 +81,7 @@ export const prepareContractGovernorKit = (baggage, powers) => {
|
|
|
36
81
|
const makeContractGovernorKit = prepareExoClassKit(
|
|
37
82
|
baggage,
|
|
38
83
|
'ContractGovernorKit',
|
|
39
|
-
|
|
84
|
+
ContractGovernorKitI,
|
|
40
85
|
/**
|
|
41
86
|
* @param {import('@agoric/zoe/src/zoeService/utils.js').StartedInstanceKit<GovernableStartFn>} startedInstanceKit
|
|
42
87
|
* @param {LimitedCF<unknown>} limitedCreatorFacet
|
|
@@ -53,9 +98,8 @@ export const prepareContractGovernorKit = (baggage, powers) => {
|
|
|
53
98
|
/** @type {() => Promise<Instance>} */
|
|
54
99
|
async getElectorateInstance() {
|
|
55
100
|
const { publicFacet } = this.state;
|
|
56
|
-
const invitationAmount =
|
|
57
|
-
CONTRACT_ELECTORATE
|
|
58
|
-
);
|
|
101
|
+
const invitationAmount =
|
|
102
|
+
await E(publicFacet).getInvitationAmount(CONTRACT_ELECTORATE);
|
|
59
103
|
return invitationAmount.value[0].instance;
|
|
60
104
|
},
|
|
61
105
|
/** @type {() => Promise<PoserFacet>} */
|
|
@@ -76,6 +120,7 @@ export const prepareContractGovernorKit = (baggage, powers) => {
|
|
|
76
120
|
async provideApiGovernance() {
|
|
77
121
|
const { timer } = powers;
|
|
78
122
|
const { creatorFacet } = this.state;
|
|
123
|
+
await null;
|
|
79
124
|
if (!apiGovernance) {
|
|
80
125
|
trace('awaiting governed API dependencies');
|
|
81
126
|
const [governedApis, governedNames] = await Promise.all([
|
|
@@ -84,7 +129,8 @@ export const prepareContractGovernorKit = (baggage, powers) => {
|
|
|
84
129
|
]);
|
|
85
130
|
trace('setupApiGovernance');
|
|
86
131
|
apiGovernance = governedNames.length
|
|
87
|
-
?
|
|
132
|
+
? // @ts-expect-error FIXME
|
|
133
|
+
setupApiGovernance(governedApis, governedNames, timer, () =>
|
|
88
134
|
this.facets.helper.getUpdatedPoserFacet(),
|
|
89
135
|
)
|
|
90
136
|
: {
|
|
@@ -131,8 +177,8 @@ export const prepareContractGovernorKit = (baggage, powers) => {
|
|
|
131
177
|
replaceElectorate(poserInvitation) {
|
|
132
178
|
const { creatorFacet } = this.state;
|
|
133
179
|
/** @type {Promise<import('./contractGovernance/typedParamManager.js').TypedParamManager<{'Electorate': 'invitation'}>>} */
|
|
134
|
-
|
|
135
|
-
// @ts-
|
|
180
|
+
|
|
181
|
+
// @ts-expect-error cast
|
|
136
182
|
const paramMgr = E(E(creatorFacet).getParamMgrRetriever()).get({
|
|
137
183
|
key: 'governedParams',
|
|
138
184
|
});
|