@agoric/builders 0.1.1-upgrade-18-dev-d7c994b.0 → 0.1.1-upgrade-18-dev-ef001c0.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/builders",
3
- "version": "0.1.1-upgrade-18-dev-d7c994b.0+d7c994b",
3
+ "version": "0.1.1-upgrade-18-dev-ef001c0.0+ef001c0",
4
4
  "description": "Build scripts for proposals to an Agoric chain",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -23,13 +23,13 @@
23
23
  "author": "Agoric",
24
24
  "license": "Apache-2.0",
25
25
  "dependencies": {
26
- "@agoric/ertp": "0.16.3-upgrade-18-dev-d7c994b.0+d7c994b",
27
- "@agoric/internal": "0.3.3-upgrade-18-dev-d7c994b.0+d7c994b",
28
- "@agoric/notifier": "0.6.3-upgrade-18-dev-d7c994b.0+d7c994b",
29
- "@agoric/smart-wallet": "0.5.4-upgrade-18-dev-d7c994b.0+d7c994b",
30
- "@agoric/vat-data": "0.5.3-upgrade-18-dev-d7c994b.0+d7c994b",
31
- "@agoric/vats": "0.15.2-upgrade-18-dev-d7c994b.0+d7c994b",
32
- "@agoric/zoe": "0.26.3-upgrade-18-dev-d7c994b.0+d7c994b",
26
+ "@agoric/ertp": "0.16.3-upgrade-18-dev-ef001c0.0+ef001c0",
27
+ "@agoric/internal": "0.3.3-upgrade-18-dev-ef001c0.0+ef001c0",
28
+ "@agoric/notifier": "0.6.3-upgrade-18-dev-ef001c0.0+ef001c0",
29
+ "@agoric/smart-wallet": "0.5.4-upgrade-18-dev-ef001c0.0+ef001c0",
30
+ "@agoric/vat-data": "0.5.3-upgrade-18-dev-ef001c0.0+ef001c0",
31
+ "@agoric/vats": "0.15.2-upgrade-18-dev-ef001c0.0+ef001c0",
32
+ "@agoric/zoe": "0.26.3-upgrade-18-dev-ef001c0.0+ef001c0",
33
33
  "@endo/bundle-source": "^3.4.2",
34
34
  "@endo/captp": "^4.4.2",
35
35
  "@endo/eventual-send": "^1.2.7",
@@ -41,14 +41,14 @@
41
41
  "import-meta-resolve": "^2.2.1"
42
42
  },
43
43
  "devDependencies": {
44
- "@agoric/deploy-script-support": "0.10.4-upgrade-18-dev-d7c994b.0+d7c994b",
45
- "@agoric/governance": "0.10.4-upgrade-18-dev-d7c994b.0+d7c994b",
46
- "@agoric/inter-protocol": "0.16.2-upgrade-18-dev-d7c994b.0+d7c994b",
47
- "@agoric/orchestration": "0.1.1-upgrade-18-dev-d7c994b.0+d7c994b",
48
- "@agoric/store": "0.9.3-upgrade-18-dev-d7c994b.0+d7c994b",
49
- "@agoric/swing-store": "0.9.2-upgrade-18-dev-d7c994b.0+d7c994b",
50
- "@agoric/swingset-liveslots": "0.10.3-upgrade-18-dev-d7c994b.0+d7c994b",
51
- "@agoric/time": "0.3.3-upgrade-18-dev-d7c994b.0+d7c994b",
44
+ "@agoric/deploy-script-support": "0.10.4-upgrade-18-dev-ef001c0.0+ef001c0",
45
+ "@agoric/governance": "0.10.4-upgrade-18-dev-ef001c0.0+ef001c0",
46
+ "@agoric/inter-protocol": "0.16.2-upgrade-18-dev-ef001c0.0+ef001c0",
47
+ "@agoric/orchestration": "0.1.1-upgrade-18-dev-ef001c0.0+ef001c0",
48
+ "@agoric/store": "0.9.3-upgrade-18-dev-ef001c0.0+ef001c0",
49
+ "@agoric/swing-store": "0.9.2-upgrade-18-dev-ef001c0.0+ef001c0",
50
+ "@agoric/swingset-liveslots": "0.10.3-upgrade-18-dev-ef001c0.0+ef001c0",
51
+ "@agoric/time": "0.3.3-upgrade-18-dev-ef001c0.0+ef001c0",
52
52
  "@endo/errors": "^1.2.7",
53
53
  "ava": "^5.3.0",
54
54
  "c8": "^9.1.0"
@@ -81,5 +81,5 @@
81
81
  "typeCoverage": {
82
82
  "atLeast": 82.43
83
83
  },
84
- "gitHead": "d7c994b8d33c0cd22b257f3e33b579588ab6c6d8"
84
+ "gitHead": "ef001c015ac66ff65840bee1f7fd3847e999154d"
85
85
  }
@@ -12,10 +12,12 @@
12
12
  * Example:
13
13
  * agoric run replace-electorate-core.js MAINNET
14
14
  */
15
- /* global process */
16
15
  import { makeHelpers } from '@agoric/deploy-script-support';
17
16
  import { getManifestForReplaceAllElectorates } from '@agoric/inter-protocol/src/proposals/replaceElectorate.js';
18
17
 
18
+ /** @typedef {Parameters<typeof import('@agoric/inter-protocol/src/proposals/replaceElectorate.js').replaceAllElectorates>[1]['options']} ReplaceElectorateOptions */
19
+
20
+ /** @type {Record<string, ReplaceElectorateOptions>} */
19
21
  const configurations = {
20
22
  MAINNET: {
21
23
  committeeName: 'Economic Committee',
@@ -76,20 +78,33 @@ const configurations = {
76
78
  };
77
79
 
78
80
  const { keys } = Object;
79
- const Usage = `agoric run replace-electorate-core.js ${keys(configurations).join(' | ')}`;
81
+ const knownVariants = keys(configurations);
82
+
80
83
  /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
81
84
  export const defaultProposalBuilder = async ({ publishRef, install }, opts) => {
82
- const config = configurations[opts.variant];
85
+ const config = opts.config || configurations[opts.variant];
83
86
  if (!config) {
84
- console.error(Usage);
85
- process.exit(1);
87
+ const error = `Unknown variant "${opts.variant}". Expected one of ${knownVariants.join(', ')}`;
88
+ console.error(error);
89
+ throw Error(error);
86
90
  }
91
+ const { committeeName, voterAddresses, highPrioritySendersConfig } = config;
92
+ console.log(
93
+ 'Generating replace committee proposal with config',
94
+ JSON.stringify({
95
+ committeeName,
96
+ voterAddresses,
97
+ highPrioritySendersConfig,
98
+ }),
99
+ );
87
100
  return harden({
88
101
  sourceSpec: '@agoric/inter-protocol/src/proposals/replaceElectorate.js',
89
102
  getManifestCall: [
90
103
  getManifestForReplaceAllElectorates.name,
91
104
  {
92
- ...config,
105
+ committeeName,
106
+ voterAddresses,
107
+ highPrioritySendersConfig,
93
108
  economicCommitteeRef: publishRef(
94
109
  install(
95
110
  '@agoric/governance/src/committee.js',
@@ -101,15 +116,35 @@ export const defaultProposalBuilder = async ({ publishRef, install }, opts) => {
101
116
  });
102
117
  };
103
118
 
119
+ const Usage = `agoric run replace-electorate-core.js ${[...knownVariants, '<json-config>'].join(' | ')}`;
120
+
104
121
  /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
105
122
  export default async (homeP, endowments) => {
106
123
  const { scriptArgs } = endowments;
107
- const variant = scriptArgs?.[0];
108
- console.log('replace-committee', scriptArgs, variant);
124
+ const variantOrConfig = scriptArgs?.[0];
125
+ console.log('replace-electorate-core.js', variantOrConfig);
126
+
127
+ const opts = {};
128
+
129
+ if (typeof variantOrConfig === 'string') {
130
+ if (variantOrConfig[0] === '{') {
131
+ try {
132
+ opts.config = JSON.parse(variantOrConfig);
133
+ } catch (err) {
134
+ throw Error(`Failed to parse config argument ${variantOrConfig}`);
135
+ }
136
+ } else {
137
+ opts.variant = variantOrConfig;
138
+ }
139
+ } else {
140
+ console.error(Usage);
141
+ throw Error(Usage);
142
+ }
109
143
 
110
144
  const { writeCoreEval } = await makeHelpers(homeP, endowments);
111
145
 
112
- await writeCoreEval(`replace-committee-${variant}`, (utils, opts) =>
113
- defaultProposalBuilder(utils, { ...opts, variant }),
146
+ await writeCoreEval(
147
+ `replace-committee-${opts.variant || 'from-config'}`,
148
+ utils => defaultProposalBuilder(utils, opts),
114
149
  );
115
150
  };
@@ -13,7 +13,7 @@ const configurations = {
13
13
  ],
14
14
  inBrandNames: ['ATOM', 'stATOM'],
15
15
  },
16
- main: {
16
+ MAINNET: {
17
17
  oracleAddresses: [
18
18
  'agoric144rrhh4m09mh7aaffhm6xy223ym76gve2x7y78', // DSRV
19
19
  'agoric19d6gnr9fyp6hev4tlrg87zjrzsd5gzr5qlfq2p', // Stakin
@@ -24,7 +24,7 @@ const configurations = {
24
24
  inBrandNames: ['ATOM', 'stATOM', 'stOSMO', 'stTIA', 'stkATOM'],
25
25
  contractTerms: { minSubmissionCount: 3 },
26
26
  },
27
- devnet: {
27
+ DEVNET: {
28
28
  oracleAddresses: [
29
29
  'agoric1lw4e4aas9q84tq0q92j85rwjjjapf8dmnllnft', // DSRV
30
30
  'agoric1zj6vrrrjq4gsyr9lw7dplv4vyejg3p8j2urm82', // Stakin
@@ -37,20 +37,29 @@ const configurations = {
37
37
  };
38
38
 
39
39
  const { keys } = Object;
40
- const Usage = `agoric run updatePriceFeed.js ${keys(configurations).join(' | ')}`;
40
+ const knownVariants = keys(configurations);
41
+
41
42
  /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
42
43
  export const defaultProposalBuilder = async ({ publishRef, install }, opts) => {
43
- const config = configurations[opts.variant];
44
+ const config = opts.config || configurations[opts.variant];
44
45
  if (!config) {
45
- console.error(Usage);
46
- throw Error(Usage);
46
+ const error = `Unknown variant "${opts.variant}". Expected one of ${knownVariants.join(', ')}`;
47
+ console.error(error);
48
+ throw Error(error);
47
49
  }
50
+ const { oracleAddresses, inBrandNames, contractTerms } = config;
51
+ console.log(
52
+ 'Generating price feeds update proposal with config',
53
+ JSON.stringify({ oracleAddresses, inBrandNames, contractTerms }),
54
+ );
48
55
  return harden({
49
56
  sourceSpec: '@agoric/inter-protocol/src/proposals/deploy-price-feeds.js',
50
57
  getManifestCall: [
51
58
  getManifestForPriceFeeds.name,
52
59
  {
53
- ...config,
60
+ oracleAddresses,
61
+ inBrandNames,
62
+ contractTerms,
54
63
  priceAggregatorRef: publishRef(
55
64
  install(
56
65
  '@agoric/inter-protocol/src/price/fluxAggregatorContract.js',
@@ -68,15 +77,35 @@ export const defaultProposalBuilder = async ({ publishRef, install }, opts) => {
68
77
  });
69
78
  };
70
79
 
80
+ const Usage = `agoric run updatePriceFeeds.js ${[...knownVariants, '<json-config>'].join(' | ')}`;
81
+
71
82
  /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
72
83
  export default async (homeP, endowments) => {
73
84
  const { scriptArgs } = endowments;
74
- const variant = scriptArgs?.[0];
75
- console.log('updatePriceFeeds', scriptArgs, variant);
85
+ const variantOrConfig = scriptArgs?.[0];
86
+ console.log('updatePriceFeeds.js', variantOrConfig);
87
+
88
+ const opts = {};
89
+
90
+ if (typeof variantOrConfig === 'string') {
91
+ if (variantOrConfig[0] === '{') {
92
+ try {
93
+ opts.config = JSON.parse(variantOrConfig);
94
+ } catch (err) {
95
+ throw Error(`Failed to parse config argument ${variantOrConfig}`);
96
+ }
97
+ } else {
98
+ opts.variant = variantOrConfig;
99
+ }
100
+ } else {
101
+ console.error(Usage);
102
+ throw Error(Usage);
103
+ }
76
104
 
77
105
  const { writeCoreEval } = await makeHelpers(homeP, endowments);
78
106
 
79
- await writeCoreEval(`gov-price-feeds-${variant}`, (utils, opts) =>
80
- defaultProposalBuilder(utils, { ...opts, variant }),
107
+ await writeCoreEval(
108
+ `gov-price-feeds-${opts.variant || 'from-config'}`,
109
+ utils => defaultProposalBuilder(utils, opts),
81
110
  );
82
111
  };