@agoric/governance 0.10.4-dev-5dc325b.0 → 0.10.4-getting-started-dev-d127d1d.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/CHANGELOG.md +448 -0
- package/package.json +26 -32
- package/src/binaryVoteCounter.d.ts +16 -0
- package/src/binaryVoteCounter.d.ts.map +1 -0
- package/src/binaryVoteCounter.js +0 -1
- package/src/breakTie.d.ts +2 -0
- package/src/breakTie.d.ts.map +1 -0
- package/src/closingRule.d.ts +3 -0
- package/src/closingRule.d.ts.map +1 -0
- package/src/committee.d.ts +23 -0
- package/src/committee.d.ts.map +1 -0
- package/src/committee.js +11 -20
- package/src/constants.d.ts +16 -0
- package/src/constants.d.ts.map +1 -0
- package/src/contractGovernance/assertions.d.ts +7 -0
- package/src/contractGovernance/assertions.d.ts.map +1 -0
- package/src/contractGovernance/governApi.d.ts +30 -0
- package/src/contractGovernance/governApi.d.ts.map +1 -0
- package/src/contractGovernance/governFilter.d.ts +25 -0
- package/src/contractGovernance/governFilter.d.ts.map +1 -0
- package/src/contractGovernance/governParam.d.ts +33 -0
- package/src/contractGovernance/governParam.d.ts.map +1 -0
- package/src/contractGovernance/paramManager.d.ts +45 -0
- package/src/contractGovernance/paramManager.d.ts.map +1 -0
- package/src/contractGovernance/paramManager.js +2 -3
- package/src/contractGovernance/typedParamManager.d.ts +29 -0
- package/src/contractGovernance/typedParamManager.d.ts.map +1 -0
- package/src/contractGovernor.d.ts +23 -0
- package/src/contractGovernor.d.ts.map +1 -0
- package/src/contractGovernor.js +4 -10
- package/src/contractGovernorKit.d.ts +80 -0
- package/src/contractGovernorKit.d.ts.map +1 -0
- package/src/contractGovernorKit.js +3 -3
- package/src/contractHelper.d.ts +136 -0
- package/src/contractHelper.d.ts.map +1 -0
- package/src/contractHelper.js +3 -3
- package/src/electorateTools.d.ts +46 -0
- package/src/electorateTools.d.ts.map +1 -0
- package/src/electorateTools.js +11 -15
- package/src/index.d.ts +9 -0
- package/src/index.d.ts.map +1 -0
- package/src/index.js +5 -4
- package/src/multiCandidateVoteCounter.d.ts +16 -0
- package/src/multiCandidateVoteCounter.d.ts.map +1 -0
- package/src/multiCandidateVoteCounter.js +2 -3
- package/src/noActionElectorate.d.ts +8 -0
- package/src/noActionElectorate.d.ts.map +1 -0
- package/src/noActionElectorate.js +2 -7
- package/src/question.d.ts +27 -0
- package/src/question.d.ts.map +1 -0
- package/src/quorumCounter.d.ts +6 -0
- package/src/quorumCounter.d.ts.map +1 -0
- package/src/typeGuards.d.ts +173 -0
- package/src/typeGuards.d.ts.map +1 -0
- package/src/types-ambient.d.ts +1047 -0
- package/src/types-ambient.d.ts.map +1 -0
- package/src/types-ambient.js +5 -5
- package/src/types.d.ts +561 -0
- package/src/types.d.ts.map +1 -0
- package/src/types.js +5 -5
- package/src/validators.d.ts +16 -0
- package/src/validators.d.ts.map +1 -0
- package/src/validators.js +3 -2
- package/src/voterKit.d.ts +19 -0
- package/src/voterKit.d.ts.map +1 -0
- package/tools/puppetContractGovernor.d.ts +51 -0
- package/tools/puppetContractGovernor.d.ts.map +1 -0
- package/tools/puppetGovernance.d.ts +101 -0
- package/tools/puppetGovernance.d.ts.map +1 -0
- package/tools/puppetGovernance.js +2 -0
- package/tools/storageDoc.d.ts +10 -0
- package/tools/storageDoc.d.ts.map +1 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Assert that the governed contract was started by the governor. Throws if
|
|
3
|
+
* either direction can't be established. If the call succeeds, then the
|
|
4
|
+
* governor got exclusive access to the governed contract's creatorFacet, and
|
|
5
|
+
* can be trusted to manage its parameters.
|
|
6
|
+
*
|
|
7
|
+
* @type {AssertContractGovernance}
|
|
8
|
+
*/
|
|
9
|
+
export const assertContractGovernance: AssertContractGovernance;
|
|
10
|
+
/**
|
|
11
|
+
* Assert that the governor refers to the indicated electorate.
|
|
12
|
+
*
|
|
13
|
+
* @type {AssertContractElectorate}
|
|
14
|
+
*/
|
|
15
|
+
export const assertContractElectorate: AssertContractElectorate;
|
|
16
|
+
//# sourceMappingURL=validators.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["validators.js"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,uCAFU,wBAAwB,CAmChC;AAEF;;;;GAIG;AACH,uCAFU,wBAAwB,CAahC"}
|
package/src/validators.js
CHANGED
|
@@ -33,8 +33,9 @@ const assertContractGovernance = async (
|
|
|
33
33
|
'The alleged governed did not match the governed contract retrieved from the governor',
|
|
34
34
|
);
|
|
35
35
|
|
|
36
|
-
const governorInstallationFromGoverned =
|
|
37
|
-
|
|
36
|
+
const governorInstallationFromGoverned = await E(
|
|
37
|
+
zoe,
|
|
38
|
+
).getInstallationForInstance(realGovernorInstance);
|
|
38
39
|
|
|
39
40
|
assert(
|
|
40
41
|
governorInstallationFromGoverned === contractGovernorInstallation,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export function prepareVoterKit(baggage: MapStore<string, unknown>, { submitVote, zcf }: {
|
|
2
|
+
zcf: ZCF;
|
|
3
|
+
submitVote: (questionHandle: Handle<'Question'>, voterHandle: Handle<'Voter'>, chosenPositions: Position[], weight: bigint) => ERef<CompletedBallet>;
|
|
4
|
+
}): (id?: any) => {
|
|
5
|
+
voter: {
|
|
6
|
+
castBallotFor(questionHandle: any, positions: any, weight?: bigint): Promise<CompletedBallet>;
|
|
7
|
+
};
|
|
8
|
+
invitationMakers: {
|
|
9
|
+
makeVoteInvitation(positions: any, questionHandle: any): Promise<Invitation<CompletedBallet, never>>;
|
|
10
|
+
};
|
|
11
|
+
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
12
|
+
voter: {
|
|
13
|
+
castBallotFor(questionHandle: any, positions: any, weight?: bigint): Promise<CompletedBallet>;
|
|
14
|
+
};
|
|
15
|
+
invitationMakers: {
|
|
16
|
+
makeVoteInvitation(positions: any, questionHandle: any): Promise<Invitation<CompletedBallet, never>>;
|
|
17
|
+
};
|
|
18
|
+
}>;
|
|
19
|
+
//# sourceMappingURL=voterKit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"voterKit.d.ts","sourceRoot":"","sources":["voterKit.js"],"names":[],"mappings":"AA0BO;SAHI,GAAG;iCACc,OAAO,UAAU,CAAC,eAAe,OAAO,OAAO,CAAC,mBAAmB,QAAQ,EAAE,UAAU,MAAM,KAAK,KAAK,eAAe,CAAC;;;;;;;;;;;;;;;GAiClJ"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export function start<SF extends GovernableStartFn>(zcf: ZCF<{
|
|
2
|
+
timer: import('@agoric/time/src/types').TimerService;
|
|
3
|
+
governedContractInstallation: Installation<SF>;
|
|
4
|
+
governed: {
|
|
5
|
+
issuerKeywordRecord?: IssuerKeywordRecord;
|
|
6
|
+
terms: {
|
|
7
|
+
governedParams: {
|
|
8
|
+
[CONTRACT_ELECTORATE]: import('../src/contractGovernance/typedParamManager.js').InvitationParam;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
}>, privateArgs: {
|
|
13
|
+
governed: Record<string, unknown>;
|
|
14
|
+
}): Promise<{
|
|
15
|
+
creatorFacet: {
|
|
16
|
+
changeParams: (paramSpec: ParamChangesSpec<any>) => Promise<void>;
|
|
17
|
+
invokeAPI: (apiMethodName: string, methodArgs: unknown[]) => Promise<{
|
|
18
|
+
apiMethodName: string;
|
|
19
|
+
methodArgs: unknown[];
|
|
20
|
+
}>;
|
|
21
|
+
setFilters: (strings: Array<string>) => Promise<void>;
|
|
22
|
+
getCreatorFacet: () => Promise<{}>;
|
|
23
|
+
getAdminFacet: () => import("@agoric/zoe/src/zoeService/utils.js").AdminFacet;
|
|
24
|
+
getInstance: () => import("@agoric/zoe/src/zoeService/utils.js").Instance<SF>;
|
|
25
|
+
/** @returns {Awaited<ReturnType<SF>>['publicFacet']} */
|
|
26
|
+
getPublicFacet: () => Awaited<ReturnType<SF>>["publicFacet"];
|
|
27
|
+
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
28
|
+
changeParams: (paramSpec: ParamChangesSpec<any>) => Promise<void>;
|
|
29
|
+
invokeAPI: (apiMethodName: string, methodArgs: unknown[]) => Promise<{
|
|
30
|
+
apiMethodName: string;
|
|
31
|
+
methodArgs: unknown[];
|
|
32
|
+
}>;
|
|
33
|
+
setFilters: (strings: Array<string>) => Promise<void>;
|
|
34
|
+
getCreatorFacet: () => Promise<{}>;
|
|
35
|
+
getAdminFacet: () => import("@agoric/zoe/src/zoeService/utils.js").AdminFacet;
|
|
36
|
+
getInstance: () => import("@agoric/zoe/src/zoeService/utils.js").Instance<SF>;
|
|
37
|
+
/** @returns {Awaited<ReturnType<SF>>['publicFacet']} */
|
|
38
|
+
getPublicFacet: () => Awaited<ReturnType<SF>>["publicFacet"];
|
|
39
|
+
}>;
|
|
40
|
+
publicFacet: {
|
|
41
|
+
getGovernedContract: () => import("@agoric/zoe/src/zoeService/utils.js").Instance<SF>;
|
|
42
|
+
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
43
|
+
getGovernedContract: () => import("@agoric/zoe/src/zoeService/utils.js").Instance<SF>;
|
|
44
|
+
}>;
|
|
45
|
+
}>;
|
|
46
|
+
/**
|
|
47
|
+
* <SF>
|
|
48
|
+
*/
|
|
49
|
+
export type PuppetContractGovernorKit<SF extends GovernableStartFn> = Awaited<ReturnType<typeof start<SF>>>;
|
|
50
|
+
import { CONTRACT_ELECTORATE } from "../src/contractGovernance/governParam.js";
|
|
51
|
+
//# sourceMappingURL=puppetContractGovernor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"puppetContractGovernor.d.ts","sourceRoot":"","sources":["puppetContractGovernor.js"],"names":[],"mappings":"AA8BO;WAXK,OAAO,wBAAwB,EAAE,YAAY;;cAE1C;QACd,mBAAyB,CAAC,EAAE,mBAAmB,CAAC;QAChD,KAAW,EAAE;YAAC,cAAc,EAAE;gBAAC,qBAAqB,EAAE,OAAO,gDAAgD,EAAE,eAAe,CAAA;aAAE,CAAA;SAAC,CAAC;KAC7H;iBAEK;IACV,QAAY,EAAE,OAAO,MAAM,EAAE,OAAO,CAAC,CAAA;CAClC;;kCAkCU,iBAAiB,GAAG,CAAC;mCAUtB,MAAM,cACN,OAAO,EAAE;;;;8BALR,MAAM,MAAM,CAAC;;;;QA2BvB,wDAAwD;;;kCAjC9C,iBAAiB,GAAG,CAAC;mCAUtB,MAAM,cACN,OAAO,EAAE;;;;8BALR,MAAM,MAAM,CAAC;;;;QA2BvB,wDAAwD;;;;;;;;GAS3D;;;;sEAIY,QAAQ,WAAW,aAAa,EAAE,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
export function setUpGovernedContract<T extends GovernableStartFn>(zoe: ERef<ZoeService>, governedP: ERef<Installation<T>>, timer: import('@agoric/swingset-vat/src/vats/timer/vat-timer.js').TimerService, termsOfGoverned?: {
|
|
2
|
+
[k: string]: any;
|
|
3
|
+
governedParams?: Record<string, unknown> | undefined;
|
|
4
|
+
governedApis?: string[] | undefined;
|
|
5
|
+
}, privateArgsOfGoverned?: {}, issuerKeywordRecord?: IssuerKeywordRecord | undefined): Promise<{
|
|
6
|
+
getFakeInvitation: () => Promise<{
|
|
7
|
+
fakeInvitationPayment: any;
|
|
8
|
+
fakeInvitationAmount: Amount<"set">;
|
|
9
|
+
}>;
|
|
10
|
+
governorFacets: import("@agoric/zoe/src/zoeService/utils.js").StartedInstanceKit<(<SF extends GovernableStartFn>(zcf: ZCF<{
|
|
11
|
+
timer: import("@agoric/time/src/types.js").TimerService;
|
|
12
|
+
governedContractInstallation: Installation<SF>;
|
|
13
|
+
governed: {
|
|
14
|
+
issuerKeywordRecord?: IssuerKeywordRecord | undefined;
|
|
15
|
+
terms: {
|
|
16
|
+
governedParams: {
|
|
17
|
+
Electorate: import("../src/contractGovernance/typedParamManager.js").InvitationParam;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
}>, privateArgs: {
|
|
22
|
+
governed: Record<string, unknown>;
|
|
23
|
+
}) => Promise<{
|
|
24
|
+
creatorFacet: {
|
|
25
|
+
changeParams: (paramSpec: ParamChangesSpec<any>) => Promise<void>;
|
|
26
|
+
invokeAPI: (apiMethodName: string, methodArgs: unknown[]) => Promise<{
|
|
27
|
+
apiMethodName: string;
|
|
28
|
+
methodArgs: unknown[];
|
|
29
|
+
}>;
|
|
30
|
+
setFilters: (strings: string[]) => Promise<void>;
|
|
31
|
+
getCreatorFacet: () => Promise<{}>;
|
|
32
|
+
getAdminFacet: () => import("@agoric/zoe/src/zoeService/utils.js").AdminFacet;
|
|
33
|
+
getInstance: () => import("@agoric/zoe/src/zoeService/utils.js").Instance<SF>;
|
|
34
|
+
getPublicFacet: () => Awaited<ReturnType<SF>>["publicFacet"];
|
|
35
|
+
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
36
|
+
changeParams: (paramSpec: ParamChangesSpec<any>) => Promise<void>;
|
|
37
|
+
invokeAPI: (apiMethodName: string, methodArgs: unknown[]) => Promise<{
|
|
38
|
+
apiMethodName: string;
|
|
39
|
+
methodArgs: unknown[];
|
|
40
|
+
}>;
|
|
41
|
+
setFilters: (strings: string[]) => Promise<void>;
|
|
42
|
+
getCreatorFacet: () => Promise<{}>;
|
|
43
|
+
getAdminFacet: () => import("@agoric/zoe/src/zoeService/utils.js").AdminFacet;
|
|
44
|
+
getInstance: () => import("@agoric/zoe/src/zoeService/utils.js").Instance<SF>;
|
|
45
|
+
getPublicFacet: () => Awaited<ReturnType<SF>>["publicFacet"];
|
|
46
|
+
}>;
|
|
47
|
+
publicFacet: {
|
|
48
|
+
getGovernedContract: () => import("@agoric/zoe/src/zoeService/utils.js").Instance<SF>;
|
|
49
|
+
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
50
|
+
getGovernedContract: () => import("@agoric/zoe/src/zoeService/utils.js").Instance<SF>;
|
|
51
|
+
}>;
|
|
52
|
+
}>)>;
|
|
53
|
+
installs: {
|
|
54
|
+
governor: Installation<(<SF extends GovernableStartFn>(zcf: ZCF<{
|
|
55
|
+
timer: import("@agoric/time/src/types.js").TimerService;
|
|
56
|
+
governedContractInstallation: Installation<SF>;
|
|
57
|
+
governed: {
|
|
58
|
+
issuerKeywordRecord?: IssuerKeywordRecord | undefined;
|
|
59
|
+
terms: {
|
|
60
|
+
governedParams: {
|
|
61
|
+
Electorate: import("../src/contractGovernance/typedParamManager.js").InvitationParam;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
}>, privateArgs: {
|
|
66
|
+
governed: Record<string, unknown>;
|
|
67
|
+
}) => Promise<{
|
|
68
|
+
creatorFacet: {
|
|
69
|
+
changeParams: (paramSpec: ParamChangesSpec<any>) => Promise<void>;
|
|
70
|
+
invokeAPI: (apiMethodName: string, methodArgs: unknown[]) => Promise<{
|
|
71
|
+
apiMethodName: string;
|
|
72
|
+
methodArgs: unknown[];
|
|
73
|
+
}>;
|
|
74
|
+
setFilters: (strings: string[]) => Promise<void>;
|
|
75
|
+
getCreatorFacet: () => Promise<{}>;
|
|
76
|
+
getAdminFacet: () => import("@agoric/zoe/src/zoeService/utils.js").AdminFacet;
|
|
77
|
+
getInstance: () => import("@agoric/zoe/src/zoeService/utils.js").Instance<SF>;
|
|
78
|
+
getPublicFacet: () => Awaited<ReturnType<SF>>["publicFacet"];
|
|
79
|
+
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
80
|
+
changeParams: (paramSpec: ParamChangesSpec<any>) => Promise<void>;
|
|
81
|
+
invokeAPI: (apiMethodName: string, methodArgs: unknown[]) => Promise<{
|
|
82
|
+
apiMethodName: string;
|
|
83
|
+
methodArgs: unknown[];
|
|
84
|
+
}>;
|
|
85
|
+
setFilters: (strings: string[]) => Promise<void>;
|
|
86
|
+
getCreatorFacet: () => Promise<{}>;
|
|
87
|
+
getAdminFacet: () => import("@agoric/zoe/src/zoeService/utils.js").AdminFacet;
|
|
88
|
+
getInstance: () => import("@agoric/zoe/src/zoeService/utils.js").Instance<SF>;
|
|
89
|
+
getPublicFacet: () => Awaited<ReturnType<SF>>["publicFacet"];
|
|
90
|
+
}>;
|
|
91
|
+
publicFacet: {
|
|
92
|
+
getGovernedContract: () => import("@agoric/zoe/src/zoeService/utils.js").Instance<SF>;
|
|
93
|
+
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
94
|
+
getGovernedContract: () => import("@agoric/zoe/src/zoeService/utils.js").Instance<SF>;
|
|
95
|
+
}>;
|
|
96
|
+
}>)>;
|
|
97
|
+
autoRefund: Installation<any>;
|
|
98
|
+
governed: Installation<T>;
|
|
99
|
+
};
|
|
100
|
+
}>;
|
|
101
|
+
//# sourceMappingURL=puppetGovernance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"puppetGovernance.d.ts","sourceRoot":"","sources":["puppetGovernance.js"],"names":[],"mappings":"AAgCO,wEAPI,KAAK,UAAU,CAAC,2CAEhB,OAAO,kDAAkD,EAAE,YAAY;;;;2BAEvE,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+EZ"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export function documentStorageSchema(t: import('ava').ExecutionContext<unknown>, storage: import('@agoric/internal/src/storage-test-utils.js').MockChainStorageRoot, opts: ({
|
|
2
|
+
note: string;
|
|
3
|
+
} | {
|
|
4
|
+
node: string;
|
|
5
|
+
owner: string;
|
|
6
|
+
}) & ({} | {
|
|
7
|
+
pattern: string;
|
|
8
|
+
replacement: string;
|
|
9
|
+
})): Promise<void>;
|
|
10
|
+
//# sourceMappingURL=storageDoc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storageDoc.d.ts","sourceRoot":"","sources":["storageDoc.js"],"names":[],"mappings":"AASO,yCANI,OAAO,KAAK,EAAE,gBAAgB,CAAC,OAAO,CAAC,WACvC,OAAO,4CAA4C,EAAE,oBAAoB;UAChE,MAAM;;UAAa,MAAM;WAAS,MAAM;;aAC5C,MAAM;iBAAe,MAAM;mBA8B1C"}
|