@agoric/governance 0.10.4-dev-5a127d4.0 → 0.10.4-dev-fb2d05c.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/package.json +10 -10
- package/src/typeGuards.d.ts.map +1 -1
- package/src/typeGuards.js +88 -55
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/governance",
|
|
3
|
-
"version": "0.10.4-dev-
|
|
3
|
+
"version": "0.10.4-dev-fb2d05c.0+fb2d05c",
|
|
4
4
|
"description": "Core governance support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
},
|
|
32
32
|
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@agoric/ertp": "0.16.3-dev-
|
|
35
|
-
"@agoric/internal": "0.3.3-dev-
|
|
36
|
-
"@agoric/notifier": "0.6.3-dev-
|
|
37
|
-
"@agoric/store": "0.9.3-dev-
|
|
38
|
-
"@agoric/time": "0.3.3-dev-
|
|
39
|
-
"@agoric/vat-data": "0.5.3-dev-
|
|
40
|
-
"@agoric/zoe": "0.26.3-dev-
|
|
34
|
+
"@agoric/ertp": "0.16.3-dev-fb2d05c.0+fb2d05c",
|
|
35
|
+
"@agoric/internal": "0.3.3-dev-fb2d05c.0+fb2d05c",
|
|
36
|
+
"@agoric/notifier": "0.6.3-dev-fb2d05c.0+fb2d05c",
|
|
37
|
+
"@agoric/store": "0.9.3-dev-fb2d05c.0+fb2d05c",
|
|
38
|
+
"@agoric/time": "0.3.3-dev-fb2d05c.0+fb2d05c",
|
|
39
|
+
"@agoric/vat-data": "0.5.3-dev-fb2d05c.0+fb2d05c",
|
|
40
|
+
"@agoric/zoe": "0.26.3-dev-fb2d05c.0+fb2d05c",
|
|
41
41
|
"@endo/bundle-source": "^3.4.2",
|
|
42
42
|
"@endo/captp": "^4.4.2",
|
|
43
43
|
"@endo/errors": "^1.2.7",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"import-meta-resolve": "^2.2.1"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@agoric/swingset-vat": "0.32.3-dev-
|
|
52
|
+
"@agoric/swingset-vat": "0.32.3-dev-fb2d05c.0+fb2d05c",
|
|
53
53
|
"@endo/bundle-source": "^3.4.2",
|
|
54
54
|
"@endo/init": "^1.1.6",
|
|
55
55
|
"ava": "^5.3.0",
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"typeCoverage": {
|
|
79
79
|
"atLeast": 89.46
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "fb2d05c0d755e1ad68aed1ae1112ea4973aad92e"
|
|
82
82
|
}
|
package/src/typeGuards.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeGuards.d.ts","sourceRoot":"","sources":["typeGuards.js"],"names":[],"mappings":"AASA,iEAAwE;AACxE,+DAAoE;AACpE,iEAME;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"typeGuards.d.ts","sourceRoot":"","sources":["typeGuards.js"],"names":[],"mappings":"AASA,iEAAwE;AACxE,+DAAoE;AACpE,iEAME;;;;;;;;;;;AAiBF;;;;KAGE;;;;;;;;;;;;;;;;;;;;AA2BF,qEAAqE;AACrE,4EAAkE;;;;AAIlE;;KAGE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CF;;;;;KAGE;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCF;;IAGE;;;;;;;;;;;;;;;;;;;;;;;;AA0BF,iEAKE;AAEF,6DASE;AAEF,mEAA+D;AAG/D,+DAAyD;AAKzD,oEAKE;AAEF;;;;;;GAMG;AAGH;;;;;;GAQG;;;;;;AASH;;;GAGG;AAGH;;;;;;;GAUE;AAEF,2DAAyC;AACzC;;GAOE;AAEF;;GAKE;AAEF;;;;;;;GAOG;AAEH;;GAIG;AAEH;;GAEG;;;;;;;;;+BAnS4B,cAAc;oCAKtC,+BAA+B"}
|
package/src/typeGuards.js
CHANGED
|
@@ -17,26 +17,31 @@ export const ElectionTypeShape = M.or(
|
|
|
17
17
|
'offer_filter',
|
|
18
18
|
);
|
|
19
19
|
|
|
20
|
-
export const ClosingRuleShape =
|
|
20
|
+
export const ClosingRuleShape = {
|
|
21
21
|
timer: M.eref(TimerShape),
|
|
22
22
|
deadline: TimestampShape,
|
|
23
|
-
}
|
|
23
|
+
};
|
|
24
|
+
harden(ClosingRuleShape);
|
|
24
25
|
|
|
25
26
|
// all the strings that will be in the filter after passing
|
|
26
|
-
export const YesOfferFilterPositionShape =
|
|
27
|
+
export const YesOfferFilterPositionShape = {
|
|
27
28
|
strings: M.arrayOf(M.string()),
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
29
|
+
};
|
|
30
|
+
harden(YesOfferFilterPositionShape);
|
|
31
|
+
|
|
32
|
+
export const NoOfferFilterPositionShape = { dontUpdate: M.arrayOf(M.string()) };
|
|
33
|
+
harden(NoOfferFilterPositionShape);
|
|
34
|
+
|
|
35
|
+
export const OfferFilterPositionsShape = [
|
|
33
36
|
YesOfferFilterPositionShape,
|
|
34
37
|
NoOfferFilterPositionShape,
|
|
35
|
-
]
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
38
|
+
];
|
|
39
|
+
harden(OfferFilterPositionsShape);
|
|
40
|
+
|
|
41
|
+
export const OfferFilterIssueShape = { strings: M.arrayOf(M.string()) };
|
|
42
|
+
harden(OfferFilterIssueShape);
|
|
43
|
+
|
|
44
|
+
export const OfferFilterQuestionSpecShape = {
|
|
40
45
|
method: ChoiceMethodShape,
|
|
41
46
|
issue: OfferFilterIssueShape,
|
|
42
47
|
positions: OfferFilterPositionsShape,
|
|
@@ -46,34 +51,41 @@ export const OfferFilterQuestionSpecShape = harden({
|
|
|
46
51
|
closingRule: ClosingRuleShape,
|
|
47
52
|
quorumRule: QuorumRuleShape,
|
|
48
53
|
tieOutcome: NoOfferFilterPositionShape,
|
|
49
|
-
}
|
|
50
|
-
|
|
54
|
+
};
|
|
55
|
+
harden(OfferFilterQuestionSpecShape);
|
|
56
|
+
|
|
57
|
+
export const OfferFilterQuestionDetailsShape = {
|
|
51
58
|
...OfferFilterQuestionSpecShape,
|
|
52
59
|
questionHandle: makeHandleShape('Question'),
|
|
53
60
|
counterInstance: InstanceHandleShape,
|
|
54
|
-
}
|
|
61
|
+
};
|
|
62
|
+
harden(OfferFilterQuestionDetailsShape);
|
|
55
63
|
|
|
56
64
|
// keys are parameter names, values are proposed values
|
|
57
65
|
export const ParamChangesSpecShape = M.recordOf(M.string(), M.any());
|
|
58
66
|
export const YesParamChangesPositionShape = ParamChangesSpecShape;
|
|
59
|
-
export const NoParamChangesPositionShape =
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
export const ParamChangesPositionsShape =
|
|
67
|
+
export const NoParamChangesPositionShape = { noChange: M.arrayOf(M.string()) };
|
|
68
|
+
harden(NoParamChangesPositionShape);
|
|
69
|
+
|
|
70
|
+
export const ParamChangesPositionsShape = [
|
|
63
71
|
YesParamChangesPositionShape,
|
|
64
72
|
NoParamChangesPositionShape,
|
|
65
|
-
]
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
|
|
73
|
+
];
|
|
74
|
+
harden(ParamChangesPositionsShape);
|
|
75
|
+
|
|
76
|
+
export const ParamPathShape = { key: M.any() };
|
|
77
|
+
harden(ParamPathShape);
|
|
78
|
+
|
|
79
|
+
export const ParamChangesIssueShape = {
|
|
70
80
|
spec: {
|
|
71
81
|
paramPath: ParamPathShape,
|
|
72
82
|
changes: ParamChangesSpecShape,
|
|
73
83
|
},
|
|
74
84
|
contract: InstanceHandleShape,
|
|
75
|
-
}
|
|
76
|
-
|
|
85
|
+
};
|
|
86
|
+
harden(ParamChangesIssueShape);
|
|
87
|
+
|
|
88
|
+
export const ParamChangesQuestionSpecShape = {
|
|
77
89
|
method: 'unranked',
|
|
78
90
|
issue: ParamChangesIssueShape,
|
|
79
91
|
positions: ParamChangesPositionsShape,
|
|
@@ -83,27 +95,33 @@ export const ParamChangesQuestionSpecShape = harden({
|
|
|
83
95
|
closingRule: ClosingRuleShape,
|
|
84
96
|
quorumRule: 'majority',
|
|
85
97
|
tieOutcome: NoParamChangesPositionShape,
|
|
86
|
-
}
|
|
98
|
+
};
|
|
99
|
+
harden(ParamChangesQuestionSpecShape);
|
|
87
100
|
|
|
88
|
-
export const ParamChangesQuestionDetailsShape =
|
|
101
|
+
export const ParamChangesQuestionDetailsShape = {
|
|
89
102
|
...ParamChangesQuestionSpecShape,
|
|
90
103
|
questionHandle: makeHandleShape('Question'),
|
|
91
104
|
counterInstance: InstanceHandleShape,
|
|
92
|
-
}
|
|
105
|
+
};
|
|
106
|
+
harden(ParamChangesQuestionDetailsShape);
|
|
93
107
|
|
|
94
|
-
const ApiInvocationSpecShape =
|
|
108
|
+
const ApiInvocationSpecShape = {
|
|
95
109
|
apiMethodName: M.string(),
|
|
96
110
|
methodArgs: M.arrayOf(M.any()),
|
|
97
|
-
}
|
|
111
|
+
};
|
|
112
|
+
harden(ApiInvocationSpecShape);
|
|
113
|
+
|
|
98
114
|
export const YesApiInvocationPositionShape = ApiInvocationSpecShape;
|
|
99
|
-
export const NoApiInvocationPositionShape =
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
export const ApiInvocationPositionsShape =
|
|
115
|
+
export const NoApiInvocationPositionShape = { dontInvoke: M.string() };
|
|
116
|
+
harden(NoApiInvocationPositionShape);
|
|
117
|
+
|
|
118
|
+
export const ApiInvocationPositionsShape = [
|
|
103
119
|
YesApiInvocationPositionShape,
|
|
104
120
|
NoApiInvocationPositionShape,
|
|
105
|
-
]
|
|
106
|
-
|
|
121
|
+
];
|
|
122
|
+
harden(ApiInvocationPositionsShape);
|
|
123
|
+
|
|
124
|
+
export const ApiInvocationQuestionSpecShape = {
|
|
107
125
|
method: 'unranked',
|
|
108
126
|
issue: ApiInvocationSpecShape,
|
|
109
127
|
positions: ApiInvocationPositionsShape,
|
|
@@ -113,39 +131,53 @@ export const ApiInvocationQuestionSpecShape = harden({
|
|
|
113
131
|
closingRule: ClosingRuleShape,
|
|
114
132
|
quorumRule: QuorumRuleShape,
|
|
115
133
|
tieOutcome: NoApiInvocationPositionShape,
|
|
116
|
-
}
|
|
117
|
-
|
|
134
|
+
};
|
|
135
|
+
harden(ApiInvocationQuestionSpecShape);
|
|
136
|
+
|
|
137
|
+
export const ApiInvocationQuestionDetailsShape = {
|
|
118
138
|
...ApiInvocationQuestionSpecShape,
|
|
119
139
|
questionHandle: makeHandleShape('Question'),
|
|
120
140
|
counterInstance: InstanceHandleShape,
|
|
121
|
-
}
|
|
141
|
+
};
|
|
142
|
+
harden(ApiInvocationQuestionDetailsShape);
|
|
122
143
|
|
|
123
|
-
const SimpleSpecShape =
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
export const YesSimplePositionShape =
|
|
127
|
-
|
|
128
|
-
|
|
144
|
+
const SimpleSpecShape = { text: M.string() };
|
|
145
|
+
harden(SimpleSpecShape);
|
|
146
|
+
|
|
147
|
+
export const YesSimplePositionShape = { text: M.string() };
|
|
148
|
+
harden(YesSimplePositionShape);
|
|
149
|
+
|
|
150
|
+
export const NoSimplePositionShape = { text: M.string() };
|
|
151
|
+
harden(NoSimplePositionShape);
|
|
152
|
+
|
|
153
|
+
export const SimplePositionsShape = [
|
|
129
154
|
YesSimplePositionShape,
|
|
130
155
|
NoSimplePositionShape,
|
|
131
|
-
]
|
|
156
|
+
];
|
|
157
|
+
harden(SimplePositionsShape);
|
|
158
|
+
|
|
132
159
|
export const SimpleIssueShape = SimpleSpecShape;
|
|
133
|
-
|
|
160
|
+
harden(SimpleIssueShape);
|
|
161
|
+
|
|
162
|
+
export const SimpleQuestionSpecShape = {
|
|
134
163
|
method: ChoiceMethodShape,
|
|
135
164
|
issue: SimpleIssueShape,
|
|
136
|
-
positions: M.arrayOf(
|
|
165
|
+
positions: M.arrayOf({ text: M.string() }),
|
|
137
166
|
electionType: M.or('election', 'survey'),
|
|
138
167
|
maxChoices: M.gte(1),
|
|
139
168
|
maxWinners: M.gte(1),
|
|
140
169
|
closingRule: ClosingRuleShape,
|
|
141
170
|
quorumRule: QuorumRuleShape,
|
|
142
171
|
tieOutcome: NoSimplePositionShape,
|
|
143
|
-
}
|
|
144
|
-
|
|
172
|
+
};
|
|
173
|
+
harden(SimpleQuestionSpecShape);
|
|
174
|
+
|
|
175
|
+
export const SimpleQuestionDetailsShape = {
|
|
145
176
|
...SimpleQuestionSpecShape,
|
|
146
177
|
questionHandle: makeHandleShape('Question'),
|
|
147
178
|
counterInstance: InstanceHandleShape,
|
|
148
|
-
}
|
|
179
|
+
};
|
|
180
|
+
harden(SimpleQuestionDetailsShape);
|
|
149
181
|
|
|
150
182
|
export const QuestionSpecShape = M.or(
|
|
151
183
|
ApiInvocationQuestionSpecShape,
|
|
@@ -199,11 +231,12 @@ export const ElectorateCreatorI = M.interface('Committee AdminFacet', {
|
|
|
199
231
|
getPublicFacet: M.call().returns(ElectoratePublicShape),
|
|
200
232
|
});
|
|
201
233
|
|
|
202
|
-
export const QuestionStatsShape =
|
|
234
|
+
export const QuestionStatsShape = {
|
|
203
235
|
spoiled: M.nat(),
|
|
204
236
|
votes: M.nat(),
|
|
205
237
|
results: M.arrayOf({ position: PositionShape, total: M.nat() }),
|
|
206
|
-
}
|
|
238
|
+
};
|
|
239
|
+
harden(QuestionStatsShape);
|
|
207
240
|
|
|
208
241
|
export const QuestionI = M.interface('Question', {
|
|
209
242
|
getVoteCounter: M.call().returns(InstanceHandleShape),
|