@agoric/builders 0.2.0-u20.0 → 0.2.0-u21.0.1

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.
@@ -7,8 +7,10 @@
7
7
  import { deeplyFulfilledObject, makeTracer } from '@agoric/internal';
8
8
  import { makeStorageNodeChild } from '@agoric/internal/src/lib-chainStorage.js';
9
9
  import { E } from '@endo/far';
10
+ import { parseChainHubOpts } from '../orchestration/helpers.js';
10
11
 
11
12
  /**
13
+ * @import {CosmosChainInfo, Denom, DenomDetail} from '@agoric/orchestration';
12
14
  * @import {QueryFlowsSF as StartFn} from '@agoric/orchestration/src/fixtures/query-flows.contract.js';
13
15
  */
14
16
 
@@ -28,25 +30,34 @@ const trace = makeTracer(contractName, true);
28
30
  * };
29
31
  * };
30
32
  * }} powers
33
+ * @param {{
34
+ * options: {
35
+ * chainInfo: Record<string, CosmosChainInfo>;
36
+ * assetInfo: [Denom, DenomDetail & { brandKey?: string }][];
37
+ * };
38
+ * }} config
31
39
  */
32
- export const startQueryFlows = async ({
33
- consume: {
34
- agoricNames,
35
- board,
36
- chainStorage,
37
- chainTimerService,
38
- cosmosInterchainService,
39
- localchain,
40
- startUpgradable,
41
- },
42
- installation: {
43
- consume: { [contractName]: installation },
44
- },
45
- instance: {
46
- // @ts-expect-error unknown instance
47
- produce: { [contractName]: produceInstance },
40
+ export const startQueryFlows = async (
41
+ {
42
+ consume: {
43
+ agoricNames,
44
+ board,
45
+ chainStorage,
46
+ chainTimerService,
47
+ cosmosInterchainService,
48
+ localchain,
49
+ startUpgradable,
50
+ },
51
+ installation: {
52
+ consume: { [contractName]: installation },
53
+ },
54
+ instance: {
55
+ // @ts-expect-error unknown instance
56
+ produce: { [contractName]: produceInstance },
57
+ },
48
58
  },
49
- }) => {
59
+ { options: { chainInfo, assetInfo } },
60
+ ) => {
50
61
  trace(`start ${contractName}`);
51
62
 
52
63
  const storageNode = await makeStorageNodeChild(chainStorage, contractName);
@@ -60,6 +71,8 @@ export const startQueryFlows = async ({
60
71
  privateArgs: await deeplyFulfilledObject(
61
72
  harden({
62
73
  agoricNames,
74
+ assetInfo,
75
+ chainInfo,
63
76
  orchestrationService: cosmosInterchainService,
64
77
  localchain,
65
78
  storageNode,
@@ -76,7 +89,7 @@ harden(startQueryFlows);
76
89
 
77
90
  export const getManifestForContract = (
78
91
  { restoreRef },
79
- { installKeys, ...options },
92
+ { installKeys, options },
80
93
  ) => {
81
94
  return {
82
95
  manifest: {
@@ -106,7 +119,10 @@ export const getManifestForContract = (
106
119
  };
107
120
 
108
121
  /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
109
- export const defaultProposalBuilder = async ({ publishRef, install }) => {
122
+ export const defaultProposalBuilder = async (
123
+ { publishRef, install },
124
+ options,
125
+ ) => {
110
126
  return harden({
111
127
  // Somewhat unorthodox, source the exports from this builder module
112
128
  sourceSpec: '@agoric/builders/scripts/testing/start-query-flows.js',
@@ -120,6 +136,7 @@ export const defaultProposalBuilder = async ({ publishRef, install }) => {
120
136
  ),
121
137
  ),
122
138
  },
139
+ options,
123
140
  },
124
141
  ],
125
142
  });
@@ -127,9 +144,12 @@ export const defaultProposalBuilder = async ({ publishRef, install }) => {
127
144
 
128
145
  /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
129
146
  export default async (homeP, endowments) => {
130
- // import dynamically so the module can work in CoreEval environment
131
- const dspModule = await import('@agoric/deploy-script-support');
132
- const { makeHelpers } = dspModule;
147
+ // import dynamically so the modules can work in CoreEval environment
148
+ const { makeHelpers } = await import('@agoric/deploy-script-support');
149
+ const { scriptArgs } = endowments;
150
+ const opts = parseChainHubOpts(scriptArgs);
133
151
  const { writeCoreEval } = await makeHelpers(homeP, endowments);
134
- await writeCoreEval(startQueryFlows.name, defaultProposalBuilder);
152
+ await writeCoreEval(startQueryFlows.name, utils =>
153
+ defaultProposalBuilder(utils, opts),
154
+ );
135
155
  };
@@ -0,0 +1,25 @@
1
+ import { makeHelpers } from '@agoric/deploy-script-support';
2
+
3
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
4
+ export const defaultProposalBuilder = async ({ publishRef, install }) =>
5
+ harden({
6
+ sourceSpec:
7
+ '@agoric/vats/src/proposals/upgrade-provisionPool-to-BLD-proposal.js',
8
+ getManifestCall: [
9
+ 'getManifestForUpgradingProvisionPool',
10
+ {
11
+ provisionPoolRef: publishRef(
12
+ install('@agoric/inter-protocol/src/provisionPool.js'),
13
+ ),
14
+ },
15
+ ],
16
+ });
17
+
18
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
19
+ export default async (homeP, endowments) => {
20
+ const { writeCoreProposal } = await makeHelpers(homeP, endowments);
21
+ await writeCoreProposal(
22
+ 'upgrade-provision-pool-to-BLD',
23
+ defaultProposalBuilder,
24
+ );
25
+ };
@@ -1,10 +1,10 @@
1
1
  /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
2
2
  export const upgradeVatsProposalBuilder = async (
3
3
  { publishRef, install },
4
- bundleRecord,
4
+ vatNameToEntrypoint,
5
5
  ) => {
6
- if (!bundleRecord) {
7
- throw Error('Missing bundleRecord');
6
+ if (!vatNameToEntrypoint) {
7
+ throw Error('Missing vatNameToEntrypoint');
8
8
  }
9
9
  return harden({
10
10
  sourceSpec: '@agoric/vats/src/proposals/upgrade-vats-generic-proposal.js',
@@ -12,7 +12,7 @@ export const upgradeVatsProposalBuilder = async (
12
12
  'getManifestForUpgradingVats',
13
13
  {
14
14
  bundleRefs: Object.fromEntries(
15
- Object.entries(bundleRecord).map(
15
+ Object.entries(vatNameToEntrypoint).map(
16
16
  ([name, entrypoint]) =>
17
17
  /** @type {const} */ ([name, publishRef(install(entrypoint))]),
18
18
  ),
@@ -21,3 +21,29 @@ export const upgradeVatsProposalBuilder = async (
21
21
  ],
22
22
  });
23
23
  };
24
+
25
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
26
+ export const upgradeZoeContractsProposalBuilder = async (
27
+ { publishRef, install },
28
+ contractKitSpecs,
29
+ ) => {
30
+ if (!contractKitSpecs) {
31
+ throw Error('Missing contractKitSpecs');
32
+ }
33
+ return harden({
34
+ sourceSpec: '@agoric/vats/src/proposals/upgrade-vats-generic-proposal.js',
35
+ getManifestCall: [
36
+ 'getManifestForUpgradingZoeContractKits',
37
+ {
38
+ contractKitSpecs,
39
+ /** @type {{ [bundleName: string]: VatSourceRef }} */
40
+ installationBundleRefs: Object.fromEntries(
41
+ contractKitSpecs.map(({ bundleName, entrypoint }) => [
42
+ bundleName,
43
+ publishRef(install(entrypoint)),
44
+ ]),
45
+ ),
46
+ },
47
+ ],
48
+ });
49
+ };
package/index.js DELETED
File without changes