@agoric/governance 0.10.4-dev-8e94b2a.0 → 0.10.4-dev-24f7f32.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agoric/governance",
3
- "version": "0.10.4-dev-8e94b2a.0+8e94b2a",
3
+ "version": "0.10.4-dev-24f7f32.0+24f7f32",
4
4
  "description": "Core governance support",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -31,15 +31,15 @@
31
31
  },
32
32
  "homepage": "https://github.com/Agoric/agoric-sdk#readme",
33
33
  "dependencies": {
34
- "@agoric/assert": "0.6.1-dev-8e94b2a.0+8e94b2a",
35
- "@agoric/ertp": "0.16.3-dev-8e94b2a.0+8e94b2a",
36
- "@agoric/internal": "0.3.3-dev-8e94b2a.0+8e94b2a",
37
- "@agoric/network": "0.1.1-dev-8e94b2a.0+8e94b2a",
38
- "@agoric/notifier": "0.6.3-dev-8e94b2a.0+8e94b2a",
39
- "@agoric/store": "0.9.3-dev-8e94b2a.0+8e94b2a",
40
- "@agoric/time": "0.3.3-dev-8e94b2a.0+8e94b2a",
41
- "@agoric/vat-data": "0.5.3-dev-8e94b2a.0+8e94b2a",
42
- "@agoric/zoe": "0.26.3-dev-8e94b2a.0+8e94b2a",
34
+ "@agoric/assert": "0.6.1-dev-24f7f32.0+24f7f32",
35
+ "@agoric/ertp": "0.16.3-dev-24f7f32.0+24f7f32",
36
+ "@agoric/internal": "0.3.3-dev-24f7f32.0+24f7f32",
37
+ "@agoric/network": "0.1.1-dev-24f7f32.0+24f7f32",
38
+ "@agoric/notifier": "0.6.3-dev-24f7f32.0+24f7f32",
39
+ "@agoric/store": "0.9.3-dev-24f7f32.0+24f7f32",
40
+ "@agoric/time": "0.3.3-dev-24f7f32.0+24f7f32",
41
+ "@agoric/vat-data": "0.5.3-dev-24f7f32.0+24f7f32",
42
+ "@agoric/zoe": "0.26.3-dev-24f7f32.0+24f7f32",
43
43
  "@endo/bundle-source": "^3.2.2",
44
44
  "@endo/captp": "^4.1.1",
45
45
  "@endo/eventual-send": "^1.2.1",
@@ -50,7 +50,7 @@
50
50
  "import-meta-resolve": "^2.2.1"
51
51
  },
52
52
  "devDependencies": {
53
- "@agoric/swingset-vat": "0.32.3-dev-8e94b2a.0+8e94b2a",
53
+ "@agoric/swingset-vat": "0.32.3-dev-24f7f32.0+24f7f32",
54
54
  "@endo/bundle-source": "^3.2.2",
55
55
  "@endo/init": "^1.1.1",
56
56
  "ava": "^5.3.0",
@@ -79,5 +79,5 @@
79
79
  "typeCoverage": {
80
80
  "atLeast": 89.25
81
81
  },
82
- "gitHead": "8e94b2af44d002fbf1c6cd316ec309d24e82042e"
82
+ "gitHead": "24f7f32495a6eda13fd75d18620ab9f7989b5d2e"
83
83
  }
@@ -224,10 +224,10 @@ const makeParamManagerBuilder = (publisherKit, zoe) => {
224
224
  if (!zoe) {
225
225
  throw Fail`zoe must be provided for governed Invitations ${zoe}`;
226
226
  }
227
- const { instance, installation } = await E(zoe).getInvitationDetails(i);
228
227
 
229
- // @ts-expect-error typedefs say they're guaranteed truthy but just to be safe
230
- assert(instance && installation, 'must be an invitation');
228
+ // local check on isLive() gives better report than .getInvitationDetails()
229
+ const isLive = await E(E(zoe).getInvitationIssuer()).isLive(i);
230
+ isLive || Fail`Invitation passed to paramManager is not live ${i}`;
231
231
  };
232
232
 
233
233
  /**
@@ -1,5 +1,5 @@
1
1
  export const GOVERNANCE_STORAGE_KEY: "governance";
2
- export function validateElectorate(zcf: ZCF<GovernanceTerms<{}>>, paramManager: import("./contractGovernance/typedParamManager.js").TypedParamManager<any>): Promise<void>;
2
+ export function validateElectorate(zcf: ZCF<GovernanceTerms<{}>>, paramManager: import("./contractGovernance/typedParamManager.js").TypedParamManager<any>): Promise<true>;
3
3
  import type { GovernanceTerms } from './types.js';
4
4
  /**
5
5
  * Helper for the 90% of contracts that will have only a single set of
@@ -1 +1 @@
1
- {"version":3,"file":"contractHelper.d.ts","sourceRoot":"","sources":["contractHelper.js"],"names":[],"mappings":"AAkBA,kDAAmD;AAsB5C,gFAFI,OAAO,2CAA2C,EAAE,iBAAiB,CAAC,GAAG,CAAC,iBAepF;qCAxCqO,YAAY;AAkOlP;;;;;;;;;;;;;;;;;;;GAmBG;AACH,sCAJW,CAAC,kIADD,UAAU,iBACV,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wHAxI4B,OAAO;;yCAuCI,OAAO,WAAW,OAAO,EAAE,KAAK,OAAO;;;;;8CA+B7E,OAAO,kBAAkB,EAAE,OAAO,8EAEP,OAAO;;;;;;;;;;;;;YAkBvC,iCAAiC;;;;;;;;;;EAuExC;;;;;;;;;;;;;;;;iDA3QqO,YAAY;yCAAZ,YAAY;0CAAZ,YAAY;kCAAZ,YAAY"}
1
+ {"version":3,"file":"contractHelper.d.ts","sourceRoot":"","sources":["contractHelper.js"],"names":[],"mappings":"AAkBA,kDAAmD;AAwB5C,gFAFI,OAAO,2CAA2C,EAAE,iBAAiB,CAAC,GAAG,CAAC,iBAQpF;qCAnCqO,YAAY;AA6NlP;;;;;;;;;;;;;;;;;;;GAmBG;AACH,sCAJW,CAAC,kIADD,UAAU,iBACV,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wHAxI4B,OAAO;;yCAuCI,OAAO,WAAW,OAAO,EAAE,KAAK,OAAO;;;;;8CA+B7E,OAAO,kBAAkB,EAAE,OAAO,8EAEP,OAAO;;;;;;;;;;;;;YAkBvC,iCAAiC;;;;;;;;;;EAuExC;;;;;;;;;;;;;;;;iDAtQqO,YAAY;yCAAZ,YAAY;0CAAZ,YAAY;kCAAZ,YAAY"}
@@ -2,19 +2,19 @@ import { Far } from '@endo/marshal';
2
2
  import { makeStoredPublisherKit } from '@agoric/notifier';
3
3
  import { getMethodNames, objectMap } from '@agoric/internal';
4
4
  import { ignoreContext, prepareExo } from '@agoric/vat-data';
5
- import { keyEQ, M } from '@agoric/store';
5
+ import { M } from '@agoric/store';
6
6
  import { AmountShape, BrandShape } from '@agoric/ertp';
7
7
  import { RelativeTimeRecordShape, TimestampRecordShape } from '@agoric/time';
8
8
  import { E } from '@endo/eventual-send';
9
- import { assertElectorateMatches } from './contractGovernance/paramManager.js';
10
9
  import { makeParamManagerFromTerms } from './contractGovernance/typedParamManager.js';
11
10
  import { GovernorFacetShape } from './typeGuards.js';
11
+ import { CONTRACT_ELECTORATE } from './contractGovernance/governParam.js';
12
12
 
13
13
  /**
14
14
  * @import {VoteCounterCreatorFacet, VoteCounterPublicFacet, QuestionSpec, OutcomeRecord, AddQuestion, AddQuestionReturn, GovernanceSubscriptionState, GovernanceTerms, GovernedApis, GovernedCreatorFacet, GovernedPublicFacet} from './types.js';
15
15
  */
16
16
 
17
- const { Fail, quote: q } = assert;
17
+ const { Fail } = assert;
18
18
 
19
19
  export const GOVERNANCE_STORAGE_KEY = 'governance';
20
20
 
@@ -35,22 +35,17 @@ const publicMixinAPI = harden({
35
35
  });
36
36
 
37
37
  /**
38
+ * Verify that the electorate is represented by a live invitation.
39
+ *
38
40
  * @param {ZCF<GovernanceTerms<{}> & {}>} zcf
39
41
  * @param {import('./contractGovernance/typedParamManager.js').TypedParamManager<any>} paramManager
40
42
  */
41
43
  export const validateElectorate = (zcf, paramManager) => {
42
- const { governedParams } = zcf.getTerms();
43
- return E.when(paramManager.getParams(), finishedParams => {
44
- try {
45
- keyEQ(governedParams, finishedParams) ||
46
- Fail`The 'governedParams' term must be an object like ${q(
47
- finishedParams,
48
- )}, but was ${q(governedParams)}`;
49
- assertElectorateMatches(paramManager, governedParams);
50
- } catch (err) {
51
- zcf.shutdownWithFailure(err);
52
- }
53
- });
44
+ const invitation = paramManager.getInternalParamValue(CONTRACT_ELECTORATE);
45
+ return E.when(
46
+ E(zcf.getInvitationIssuer()).isLive(invitation),
47
+ isLive => isLive || Fail`Electorate invitation is not live.`,
48
+ );
54
49
  };
55
50
  harden(validateElectorate);
56
51