@agoric/builders 0.1.1-other-dev-3eb1a1d.0 → 0.1.1-other-dev-d15096d.0.d15096d

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.
Files changed (91) hide show
  1. package/package.json +38 -37
  2. package/scripts/inter-protocol/add-STARS.js +8 -3
  3. package/scripts/inter-protocol/add-collateral-core.js +10 -4
  4. package/scripts/inter-protocol/init-core.js +7 -2
  5. package/scripts/inter-protocol/invite-committee-core.js +7 -2
  6. package/scripts/inter-protocol/manual-price-feed.js +5 -1
  7. package/scripts/inter-protocol/price-feed-core.js +5 -1
  8. package/scripts/inter-protocol/replace-electorate-core.js +9 -3
  9. package/scripts/inter-protocol/replace-feeDistributor-combo.js +87 -0
  10. package/scripts/inter-protocol/replace-feeDistributor.js +19 -6
  11. package/scripts/inter-protocol/updatePriceFeeds.js +18 -4
  12. package/scripts/inter-protocol/withdraw-reserve.build.js +73 -0
  13. package/scripts/inter-protocol/withdraw-vbank-reserve-permit.json +6 -0
  14. package/scripts/inter-protocol/withdraw-vbank-reserve.js +67 -0
  15. package/scripts/orchestration/axelar-gmp.build.js +83 -0
  16. package/scripts/orchestration/get-chain-config.js +121 -0
  17. package/scripts/orchestration/helpers.js +46 -0
  18. package/scripts/orchestration/hook-localchain-msg-send.js +35 -0
  19. package/scripts/orchestration/init-basic-flows.js +18 -4
  20. package/scripts/orchestration/init-stakeAtom.js +18 -4
  21. package/scripts/orchestration/init-stakeBld.js +7 -2
  22. package/scripts/orchestration/init-stakeOsmo.js +18 -4
  23. package/scripts/orchestration/write-chain-info.js +7 -2
  24. package/scripts/pegasus/init-core.js +7 -2
  25. package/scripts/smart-wallet/build-game1-start.js +7 -2
  26. package/scripts/smart-wallet/build-wallet-factory2-upgrade.js +7 -2
  27. package/scripts/smart-wallet/build-walletFactory-upgrade.js +7 -2
  28. package/scripts/testing/add-LEMONS.js +7 -2
  29. package/scripts/testing/add-OLIVES.js +7 -2
  30. package/scripts/testing/add-USD-LEMONS.js +23 -0
  31. package/scripts/testing/add-USD-OLIVES.js +23 -0
  32. package/scripts/testing/append-chain-info.js +12 -4
  33. package/scripts/testing/init-auto-stake-it.js +47 -0
  34. package/scripts/testing/init-send-anywhere.js +41 -0
  35. package/scripts/testing/init-swap-anything.js +41 -0
  36. package/scripts/testing/provokeBOYD.js +58 -0
  37. package/scripts/testing/publish-test-info.js +84 -0
  38. package/scripts/testing/recorded-retired-instances.js +86 -0
  39. package/scripts/testing/register-interchain-bank-assets.js +199 -0
  40. package/scripts/testing/replace-feeDistributor-short.js +14 -3
  41. package/scripts/testing/restart-axelar-gmp.js +96 -0
  42. package/scripts/testing/restart-basic-flows.js +5 -3
  43. package/scripts/testing/restart-send-anywhere.js +5 -3
  44. package/scripts/testing/restart-stakeAtom.js +5 -3
  45. package/scripts/testing/restart-valueVow.js +7 -4
  46. package/scripts/testing/start-query-flows.js +47 -25
  47. package/scripts/testing/start-valueVow.js +7 -4
  48. package/scripts/testing/test-upgraded-board.js +20 -0
  49. package/scripts/testing/tweak-chain-info.js +15 -4
  50. package/scripts/testing/{fix-buggy-sendAnywhere.js → upgrade-send-anywhere.js} +19 -21
  51. package/scripts/testing/upgrade-vaultFactory.js +26 -0
  52. package/scripts/vats/add-auction.js +7 -2
  53. package/scripts/vats/init-core.js +7 -2
  54. package/scripts/vats/init-localchain.js +7 -2
  55. package/scripts/vats/init-network.js +7 -2
  56. package/scripts/vats/init-orchestration.js +7 -2
  57. package/scripts/vats/init-transfer.js +7 -2
  58. package/scripts/vats/priceFeedSupport.js +7 -3
  59. package/scripts/vats/probe-zcf-bundle.js +7 -2
  60. package/scripts/vats/replace-provisioning.js +7 -2
  61. package/scripts/vats/replace-zoe.js +7 -2
  62. package/scripts/vats/restart-vats.js +7 -2
  63. package/scripts/vats/revive-kread.js +7 -2
  64. package/scripts/vats/test-localchain.js +7 -2
  65. package/scripts/vats/test-vtransfer.js +7 -2
  66. package/scripts/vats/updateAtomPriceFeed.js +7 -2
  67. package/scripts/vats/updateStAtomPriceFeed.js +7 -2
  68. package/scripts/vats/updateStOsmoPriceFeed.js +7 -2
  69. package/scripts/vats/updateStTiaPriceFeed.js +7 -2
  70. package/scripts/vats/updateStkAtomPriceFeed.js +7 -2
  71. package/scripts/vats/upgrade-agoricNames.js +26 -0
  72. package/scripts/vats/upgrade-asset-reserve.js +26 -0
  73. package/scripts/vats/upgrade-bank.js +9 -4
  74. package/scripts/vats/upgrade-board.js +25 -0
  75. package/scripts/vats/upgrade-mintHolder.js +110 -0
  76. package/scripts/vats/upgrade-orchestration.js +26 -0
  77. package/scripts/vats/upgrade-paRegistry.js +26 -0
  78. package/scripts/vats/upgrade-provisionPool-to-BLD.js +30 -0
  79. package/scripts/vats/upgrade-provisionPool.js +7 -2
  80. package/scripts/vats/upgrade-psm.js +24 -0
  81. package/scripts/vats/upgrade-vats.js +53 -0
  82. package/scripts/vats/upgrade-zcf.js +7 -2
  83. package/scripts/vats/upgrade-zoe.js +7 -2
  84. package/scripts/vats/upgradeScaledPriceAuthorities.js +7 -2
  85. package/scripts/vats/upgradeVaults.js +7 -2
  86. package/index.js +0 -0
  87. package/scripts/fast-usdc/init-fast-usdc.js +0 -242
  88. package/scripts/testing/start-auto-stake-it.js +0 -128
  89. package/scripts/testing/start-buggy-sendAnywhere.js +0 -143
  90. package/scripts/testing/start-send-anywhere.js +0 -136
  91. package/scripts/vats/upgrade-orch-core.js +0 -24
@@ -0,0 +1,96 @@
1
+ /**
2
+ * @file This is for use in tests in a3p-integration
3
+ * Unlike most builder scripts, this one includes the proposal exports as well.
4
+ */
5
+ import {
6
+ deeplyFulfilledObject,
7
+ makeTracer,
8
+ NonNullish,
9
+ } from '@agoric/internal';
10
+ import { E } from '@endo/far';
11
+
12
+ /// <reference types="@agoric/vats/src/core/types-ambient.js"/>
13
+
14
+ const trace = makeTracer('StartAxelarGmp', true);
15
+
16
+ /**
17
+ * @import {start as StartFn} from '@agoric/orchestration/src/examples/axelar-gmp.contract.js';
18
+ * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
19
+ * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
20
+ */
21
+
22
+ /**
23
+ * @param {BootstrapPowers} powers
24
+ */
25
+ export const restartAxelarGmp = async ({
26
+ consume: {
27
+ agoricNames,
28
+ board,
29
+ chainStorage,
30
+ chainTimerService,
31
+ cosmosInterchainService,
32
+ localchain,
33
+ contractKits,
34
+ },
35
+ instance: instances,
36
+ }) => {
37
+ trace(restartAxelarGmp.name);
38
+
39
+ const marshaller = await E(board).getReadonlyMarshaller();
40
+ const privateArgs = await deeplyFulfilledObject(
41
+ harden({
42
+ agoricNames,
43
+ localchain,
44
+ marshaller,
45
+ orchestrationService: cosmosInterchainService,
46
+ storageNode: E(NonNullish(await chainStorage)).makeChildNode('axelarGmp'),
47
+ timerService: chainTimerService,
48
+ }),
49
+ );
50
+
51
+ // @ts-expect-error unknown instance
52
+ const instance = await instances.consume.axelarGmp;
53
+ trace('instance', instance);
54
+ /** @type {StartedInstanceKit<StartFn>} */
55
+ const kit = /** @type {any} */ (await E(contractKits).get(instance));
56
+
57
+ await E(kit.adminFacet).restartContract(privateArgs);
58
+ trace('done');
59
+ };
60
+ harden(restartAxelarGmp);
61
+
62
+ export const getManifest = () => {
63
+ return {
64
+ manifest: {
65
+ [restartAxelarGmp.name]: {
66
+ consume: {
67
+ agoricNames: true,
68
+ board: true,
69
+ chainTimerService: true,
70
+ chainStorage: true,
71
+ cosmosInterchainService: true,
72
+ localchain: true,
73
+ contractKits: true,
74
+ },
75
+ instance: {
76
+ consume: { axelarGmp: true },
77
+ },
78
+ },
79
+ },
80
+ };
81
+ };
82
+
83
+ /** @type {CoreEvalBuilder} */
84
+ export const defaultProposalBuilder = async () =>
85
+ harden({
86
+ sourceSpec: '@agoric/builders/scripts/testing/restart-axelar-gmp.js',
87
+ getManifestCall: [getManifest.name],
88
+ });
89
+
90
+ /** @type {DeployScriptFunction} */
91
+ export default async (homeP, endowments) => {
92
+ const dspModule = await import('@agoric/deploy-script-support');
93
+ const { makeHelpers } = dspModule;
94
+ const { writeCoreEval } = await makeHelpers(homeP, endowments);
95
+ await writeCoreEval(restartAxelarGmp.name, defaultProposalBuilder);
96
+ };
@@ -9,12 +9,14 @@ import {
9
9
  } from '@agoric/internal';
10
10
  import { E } from '@endo/far';
11
11
 
12
- /// <reference types="@agoric/vats/src/core/types-ambient"/>
12
+ /// <reference types="@agoric/vats/src/core/types-ambient.js"/>
13
13
 
14
14
  const trace = makeTracer('RestartBasicFlows', true);
15
15
 
16
16
  /**
17
17
  * @import {start as StartFn} from '@agoric/orchestration/src/examples/basic-flows.contract.js';
18
+ * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
19
+ * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
18
20
  */
19
21
 
20
22
  /**
@@ -83,7 +85,7 @@ export const getManifest = () => {
83
85
  };
84
86
  };
85
87
 
86
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
88
+ /** @type {CoreEvalBuilder} */
87
89
  export const defaultProposalBuilder = async () =>
88
90
  harden({
89
91
  // Somewhat unorthodox, source the exports from this builder module
@@ -91,7 +93,7 @@ export const defaultProposalBuilder = async () =>
91
93
  getManifestCall: [getManifest.name],
92
94
  });
93
95
 
94
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
96
+ /** @type {DeployScriptFunction} */
95
97
  export default async (homeP, endowments) => {
96
98
  // import dynamically so the module can work in CoreEval environment
97
99
  const dspModule = await import('@agoric/deploy-script-support');
@@ -9,12 +9,14 @@ import {
9
9
  } from '@agoric/internal';
10
10
  import { E } from '@endo/far';
11
11
 
12
- /// <reference types="@agoric/vats/src/core/types-ambient"/>
12
+ /// <reference types="@agoric/vats/src/core/types-ambient.js"/>
13
13
 
14
14
  const trace = makeTracer('StartSA', true);
15
15
 
16
16
  /**
17
17
  * @import {start as StartFn} from '@agoric/orchestration/src/examples/send-anywhere.contract.js';
18
+ * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
19
+ * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
18
20
  */
19
21
 
20
22
  /**
@@ -83,7 +85,7 @@ export const getManifest = () => {
83
85
  };
84
86
  };
85
87
 
86
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
88
+ /** @type {CoreEvalBuilder} */
87
89
  export const defaultProposalBuilder = async () =>
88
90
  harden({
89
91
  // Somewhat unorthodox, source the exports from this builder module
@@ -91,7 +93,7 @@ export const defaultProposalBuilder = async () =>
91
93
  getManifestCall: [getManifest.name],
92
94
  });
93
95
 
94
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
96
+ /** @type {DeployScriptFunction} */
95
97
  export default async (homeP, endowments) => {
96
98
  // import dynamically so the module can work in CoreEval environment
97
99
  const dspModule = await import('@agoric/deploy-script-support');
@@ -6,12 +6,14 @@ import { deeplyFulfilledObject, makeTracer } from '@agoric/internal';
6
6
  import { makeStorageNodeChild } from '@agoric/internal/src/lib-chainStorage.js';
7
7
  import { E } from '@endo/far';
8
8
 
9
- /// <reference types="@agoric/vats/src/core/types-ambient"/>
9
+ /// <reference types="@agoric/vats/src/core/types-ambient.js"/>
10
10
 
11
11
  const trace = makeTracer('RestartSA', true);
12
12
 
13
13
  /**
14
14
  * @import {start as StartFn} from '@agoric/orchestration/src/examples/stake-ica.contract.js';
15
+ * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
16
+ * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
15
17
  */
16
18
 
17
19
  /**
@@ -73,7 +75,7 @@ export const getManifest = () => {
73
75
  };
74
76
  };
75
77
 
76
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
78
+ /** @type {CoreEvalBuilder} */
77
79
  export const defaultProposalBuilder = async () =>
78
80
  harden({
79
81
  // Somewhat unorthodox, source the exports from this builder module
@@ -81,7 +83,7 @@ export const defaultProposalBuilder = async () =>
81
83
  getManifestCall: [getManifest.name],
82
84
  });
83
85
 
84
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
86
+ /** @type {DeployScriptFunction} */
85
87
  export default async (homeP, endowments) => {
86
88
  // import dynamically so the module can work in CoreEval environment
87
89
  const dspModule = await import('@agoric/deploy-script-support');
@@ -5,9 +5,12 @@
5
5
  import { makeTracer } from '@agoric/internal';
6
6
  import { E } from '@endo/far';
7
7
 
8
- /// <reference types="@agoric/vats/src/core/types-ambient"/>
8
+ /// <reference types="@agoric/vats/src/core/types-ambient.js"/>
9
9
  /**
10
10
  * @import {Instance} from '@agoric/zoe/src/zoeService/utils.js';
11
+ * @import {start} from '@agoric/zoe/src/contracts/valueVow.contract.js';
12
+ * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
13
+ * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
11
14
  */
12
15
 
13
16
  const trace = makeTracer('RestartValueVow', true);
@@ -17,7 +20,7 @@ const trace = makeTracer('RestartValueVow', true);
17
20
  * instance: {
18
21
  * consume: {
19
22
  * valueVow: Instance<
20
- * import('@agoric/zoe/src/contracts/valueVow.contract.js').start
23
+ * start
21
24
  * >;
22
25
  * };
23
26
  * };
@@ -57,7 +60,7 @@ export const getManifestForValueVow = ({ restoreRef }, { valueVowRef }) => {
57
60
  };
58
61
  };
59
62
 
60
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
63
+ /** @type {CoreEvalBuilder} */
61
64
  export const defaultProposalBuilder = async ({ publishRef, install }) =>
62
65
  harden({
63
66
  // Somewhat unorthodox, source the exports from this builder module
@@ -72,7 +75,7 @@ export const defaultProposalBuilder = async ({ publishRef, install }) =>
72
75
  ],
73
76
  });
74
77
 
75
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
78
+ /** @type {DeployScriptFunction} */
76
79
  export default async (homeP, endowments) => {
77
80
  // import dynamically so the module can work in CoreEval environment
78
81
  const dspModule = await import('@agoric/deploy-script-support');
@@ -7,9 +7,13 @@
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';
15
+ * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
16
+ * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
13
17
  */
14
18
 
15
19
  const contractName = 'queryFlows';
@@ -28,25 +32,34 @@ const trace = makeTracer(contractName, true);
28
32
  * };
29
33
  * };
30
34
  * }} powers
35
+ * @param {{
36
+ * options: {
37
+ * chainInfo: Record<string, CosmosChainInfo>;
38
+ * assetInfo: [Denom, DenomDetail & { brandKey?: string }][];
39
+ * };
40
+ * }} config
31
41
  */
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 },
42
+ export const startQueryFlows = async (
43
+ {
44
+ consume: {
45
+ agoricNames,
46
+ board,
47
+ chainStorage,
48
+ chainTimerService,
49
+ cosmosInterchainService,
50
+ localchain,
51
+ startUpgradable,
52
+ },
53
+ installation: {
54
+ consume: { [contractName]: installation },
55
+ },
56
+ instance: {
57
+ // @ts-expect-error unknown instance
58
+ produce: { [contractName]: produceInstance },
59
+ },
48
60
  },
49
- }) => {
61
+ { options: { chainInfo, assetInfo } },
62
+ ) => {
50
63
  trace(`start ${contractName}`);
51
64
 
52
65
  const storageNode = await makeStorageNodeChild(chainStorage, contractName);
@@ -60,6 +73,8 @@ export const startQueryFlows = async ({
60
73
  privateArgs: await deeplyFulfilledObject(
61
74
  harden({
62
75
  agoricNames,
76
+ assetInfo,
77
+ chainInfo,
63
78
  orchestrationService: cosmosInterchainService,
64
79
  localchain,
65
80
  storageNode,
@@ -76,7 +91,7 @@ harden(startQueryFlows);
76
91
 
77
92
  export const getManifestForContract = (
78
93
  { restoreRef },
79
- { installKeys, ...options },
94
+ { installKeys, options },
80
95
  ) => {
81
96
  return {
82
97
  manifest: {
@@ -105,8 +120,11 @@ export const getManifestForContract = (
105
120
  };
106
121
  };
107
122
 
108
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
109
- export const defaultProposalBuilder = async ({ publishRef, install }) => {
123
+ /** @type {CoreEvalBuilder} */
124
+ export const defaultProposalBuilder = async (
125
+ { publishRef, install },
126
+ options,
127
+ ) => {
110
128
  return harden({
111
129
  // Somewhat unorthodox, source the exports from this builder module
112
130
  sourceSpec: '@agoric/builders/scripts/testing/start-query-flows.js',
@@ -120,16 +138,20 @@ export const defaultProposalBuilder = async ({ publishRef, install }) => {
120
138
  ),
121
139
  ),
122
140
  },
141
+ options,
123
142
  },
124
143
  ],
125
144
  });
126
145
  };
127
146
 
128
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
147
+ /** @type {DeployScriptFunction} */
129
148
  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;
149
+ // import dynamically so the modules can work in CoreEval environment
150
+ const { makeHelpers } = await import('@agoric/deploy-script-support');
151
+ const { scriptArgs } = endowments;
152
+ const opts = parseChainHubOpts(scriptArgs);
133
153
  const { writeCoreEval } = await makeHelpers(homeP, endowments);
134
- await writeCoreEval(startQueryFlows.name, defaultProposalBuilder);
154
+ await writeCoreEval(startQueryFlows.name, utils =>
155
+ defaultProposalBuilder(utils, opts),
156
+ );
135
157
  };
@@ -5,9 +5,12 @@
5
5
  import { makeTracer } from '@agoric/internal';
6
6
  import { E } from '@endo/far';
7
7
 
8
- /// <reference types="@agoric/vats/src/core/types-ambient"/>
8
+ /// <reference types="@agoric/vats/src/core/types-ambient.js"/>
9
9
  /**
10
10
  * @import {Installation} from '@agoric/zoe/src/zoeService/utils.js';
11
+ * @import {start} from '@agoric/zoe/src/contracts/valueVow.contract.js';
12
+ * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
13
+ * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
11
14
  */
12
15
 
13
16
  const trace = makeTracer('StartValueVow', true);
@@ -17,7 +20,7 @@ const trace = makeTracer('StartValueVow', true);
17
20
  * installation: {
18
21
  * consume: {
19
22
  * valueVow: Installation<
20
- * import('@agoric/zoe/src/contracts/valueVow.contract.js').start
23
+ * start
21
24
  * >;
22
25
  * };
23
26
  * };
@@ -68,7 +71,7 @@ export const getManifestForValueVow = ({ restoreRef }, { valueVowRef }) => {
68
71
  };
69
72
  };
70
73
 
71
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
74
+ /** @type {CoreEvalBuilder} */
72
75
  export const defaultProposalBuilder = async ({ publishRef, install }) =>
73
76
  harden({
74
77
  // Somewhat unorthodox, source the exports from this builder module
@@ -83,7 +86,7 @@ export const defaultProposalBuilder = async ({ publishRef, install }) =>
83
86
  ],
84
87
  });
85
88
 
86
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
89
+ /** @type {DeployScriptFunction} */
87
90
  export default async (homeP, endowments) => {
88
91
  // import dynamically so the module can work in CoreEval environment
89
92
  const dspModule = await import('@agoric/deploy-script-support');
@@ -0,0 +1,20 @@
1
+ import { makeHelpers } from '@agoric/deploy-script-support';
2
+ import { getManifestForTestUpgradedBoard } from '@agoric/vats/src/proposals/testUpgradedBoard.js';
3
+
4
+ /**
5
+ * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
6
+ * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
7
+ */
8
+
9
+ /** @type {CoreEvalBuilder} */
10
+ export const defaultProposalBuilder = async () =>
11
+ harden({
12
+ sourceSpec: '@agoric/vats/src/proposals/testUpgradedBoard.js',
13
+ getManifestCall: [getManifestForTestUpgradedBoard.name],
14
+ });
15
+
16
+ /** @type {DeployScriptFunction} */
17
+ export default async (homeP, endowments) => {
18
+ const { writeCoreEval } = await makeHelpers(homeP, endowments);
19
+ await writeCoreEval('testUpgradedBoard', defaultProposalBuilder);
20
+ };
@@ -1,13 +1,22 @@
1
1
  /// <reference types="ses" />
2
2
  import { makeHelpers } from '@agoric/deploy-script-support';
3
3
 
4
- /** @type {Record<string, import('@agoric/orchestration/src/chain-info.js').ChainInfo>} */
4
+ /**
5
+ * @import {ChainInfo} from '@agoric/orchestration';
6
+ * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
7
+ * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
8
+ */
9
+
10
+ /** @type {Record<string, ChainInfo>} */
5
11
  const chainInfo = {
6
12
  agoric: {
13
+ bech32Prefix: 'agoric',
7
14
  chainId: 'agoric-4',
15
+ namespace: 'cosmos',
16
+ reference: 'agoric-4',
8
17
  },
9
18
  hot: {
10
- allegedName: 'Hot New Chain',
19
+ bech32Prefix: 'hot',
11
20
  chainId: 'hot-1',
12
21
  connections: {
13
22
  'cosmoshub-4': {
@@ -29,10 +38,12 @@ const chainInfo = {
29
38
  },
30
39
  },
31
40
  },
41
+ namespace: 'cosmos',
42
+ reference: 'hot-1',
32
43
  },
33
44
  };
34
45
 
35
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
46
+ /** @type {CoreEvalBuilder} */
36
47
  export const defaultProposalBuilder = async () =>
37
48
  harden({
38
49
  sourceSpec: '@agoric/orchestration/src/proposals/revise-chain-info.js',
@@ -44,7 +55,7 @@ export const defaultProposalBuilder = async () =>
44
55
  ],
45
56
  });
46
57
 
47
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
58
+ /** @type {DeployScriptFunction} */
48
59
  export default async (homeP, endowments) => {
49
60
  const { writeCoreEval } = await makeHelpers(homeP, endowments);
50
61
  await writeCoreEval('revise-chain-info', defaultProposalBuilder);
@@ -7,14 +7,16 @@ import {
7
7
  makeTracer,
8
8
  NonNullish,
9
9
  } from '@agoric/internal';
10
- import { E, Far } from '@endo/far';
10
+ import { E } from '@endo/far';
11
11
 
12
- /// <reference types="@agoric/vats/src/core/types-ambient"/>
12
+ /// <reference types="@agoric/vats/src/core/types-ambient.js"/>
13
13
  /**
14
14
  * @import {Installation, Instance} from '@agoric/zoe/src/zoeService/utils.js';
15
+ * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
16
+ * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
15
17
  */
16
18
 
17
- const trace = makeTracer('FixBuggySA', true);
19
+ const trace = makeTracer('UpgradeSA', true);
18
20
 
19
21
  /**
20
22
  * @import {start as StartFn} from '@agoric/orchestration/src/examples/send-anywhere.contract.js';
@@ -30,7 +32,7 @@ const trace = makeTracer('FixBuggySA', true);
30
32
  * }} powers
31
33
  * @param {...any} rest
32
34
  */
33
- export const fixSendAnywhere = async (
35
+ export const upgradeSendAnywhere = async (
34
36
  {
35
37
  consume: {
36
38
  agoricNames,
@@ -45,7 +47,7 @@ export const fixSendAnywhere = async (
45
47
  },
46
48
  { options: { sendAnywhereRef } },
47
49
  ) => {
48
- trace(fixSendAnywhere.name);
50
+ trace(upgradeSendAnywhere.name);
49
51
 
50
52
  const saInstance = await instances.consume.sendAnywhere;
51
53
  trace('saInstance', saInstance);
@@ -53,28 +55,24 @@ export const fixSendAnywhere = async (
53
55
 
54
56
  const marshaller = await E(board).getReadonlyMarshaller();
55
57
 
56
- // This apparently pointless wrapper is to maintain structural parity
57
- // with the buggy core-eval's wrapper to make lookup() hang.
58
- const agoricNamesResolves = Far('agoricNames that resolves', {
59
- lookup: async (...args) => {
60
- return E(agoricNames).lookup(...args);
61
- },
62
- });
63
-
64
58
  const privateArgs = await deeplyFulfilledObject(
65
59
  harden({
66
- agoricNames: agoricNamesResolves,
60
+ agoricNames,
67
61
  localchain,
68
62
  marshaller,
69
63
  orchestrationService: cosmosInterchainService,
70
64
  storageNode: E(NonNullish(await chainStorage)).makeChildNode(
71
- 'sendAnywhere',
65
+ 'send-anywhere',
72
66
  ),
73
67
  timerService: chainTimerService,
68
+ // undefined so `registerKnownChainsAndAssets` does not run again
69
+ chainInfo: undefined,
70
+ assetInfo: undefined,
74
71
  }),
75
72
  );
76
73
 
77
74
  trace('upgrading...');
75
+ trace('ref', sendAnywhereRef);
78
76
  await E(saKit.adminFacet).upgradeContract(
79
77
  sendAnywhereRef.bundleID,
80
78
  privateArgs,
@@ -82,13 +80,13 @@ export const fixSendAnywhere = async (
82
80
 
83
81
  trace('done');
84
82
  };
85
- harden(fixSendAnywhere);
83
+ harden(upgradeSendAnywhere);
86
84
 
87
85
  export const getManifestForValueVow = ({ restoreRef }, { sendAnywhereRef }) => {
88
86
  console.log('sendAnywhereRef', sendAnywhereRef);
89
87
  return {
90
88
  manifest: {
91
- [fixSendAnywhere.name]: {
89
+ [upgradeSendAnywhere.name]: {
92
90
  consume: {
93
91
  agoricNames: true,
94
92
  board: true,
@@ -116,11 +114,11 @@ export const getManifestForValueVow = ({ restoreRef }, { sendAnywhereRef }) => {
116
114
  };
117
115
  };
118
116
 
119
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
117
+ /** @type {CoreEvalBuilder} */
120
118
  export const defaultProposalBuilder = async ({ publishRef, install }) =>
121
119
  harden({
122
120
  // Somewhat unorthodox, source the exports from this builder module
123
- sourceSpec: '@agoric/builders/scripts/testing/fix-buggy-sendAnywhere.js',
121
+ sourceSpec: '@agoric/builders/scripts/testing/upgrade-send-anywhere.js',
124
122
  getManifestCall: [
125
123
  'getManifestForValueVow',
126
124
  {
@@ -133,11 +131,11 @@ export const defaultProposalBuilder = async ({ publishRef, install }) =>
133
131
  ],
134
132
  });
135
133
 
136
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
134
+ /** @type {DeployScriptFunction} */
137
135
  export default async (homeP, endowments) => {
138
136
  // import dynamically so the module can work in CoreEval environment
139
137
  const dspModule = await import('@agoric/deploy-script-support');
140
138
  const { makeHelpers } = dspModule;
141
139
  const { writeCoreEval } = await makeHelpers(homeP, endowments);
142
- await writeCoreEval(fixSendAnywhere.name, defaultProposalBuilder);
140
+ await writeCoreEval(upgradeSendAnywhere.name, defaultProposalBuilder);
143
141
  };
@@ -0,0 +1,26 @@
1
+ import { makeHelpers } from '@agoric/deploy-script-support';
2
+
3
+ /**
4
+ * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
5
+ * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
6
+ */
7
+
8
+ /** @type {CoreEvalBuilder} */
9
+ export const defaultProposalBuilder = async ({ publishRef, install }) =>
10
+ harden({
11
+ sourceSpec: '@agoric/vats/src/proposals/upgrade-vaultFactory-proposal.js',
12
+ getManifestCall: [
13
+ 'getManifestForVaultFactoryUpgrade',
14
+ {
15
+ contractRef: publishRef(
16
+ install('@agoric/inter-protocol/src/vaultFactory/vaultFactory.js'),
17
+ ),
18
+ },
19
+ ],
20
+ });
21
+
22
+ /** @type {DeployScriptFunction} */
23
+ export default async (homeP, endowments) => {
24
+ const { writeCoreEval } = await makeHelpers(homeP, endowments);
25
+ await writeCoreEval('upgrade-vaults', defaultProposalBuilder);
26
+ };
@@ -1,6 +1,11 @@
1
1
  import { makeHelpers } from '@agoric/deploy-script-support';
2
2
 
3
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
3
+ /**
4
+ * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
5
+ * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
6
+ */
7
+
8
+ /** @type {CoreEvalBuilder} */
4
9
  export const defaultProposalBuilder = async ({ publishRef, install }) => {
5
10
  return harden({
6
11
  sourceSpec: '@agoric/inter-protocol/src/proposals/add-auction.js',
@@ -24,7 +29,7 @@ export const defaultProposalBuilder = async ({ publishRef, install }) => {
24
29
  });
25
30
  };
26
31
 
27
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
32
+ /** @type {DeployScriptFunction} */
28
33
  export default async (homeP, endowments) => {
29
34
  const { writeCoreEval } = await makeHelpers(homeP, endowments);
30
35
  await writeCoreEval('add-auction', defaultProposalBuilder);
@@ -1,6 +1,11 @@
1
1
  import { makeHelpers } from '@agoric/deploy-script-support';
2
2
 
3
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
3
+ /**
4
+ * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
5
+ * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
6
+ */
7
+
8
+ /** @type {CoreEvalBuilder} */
4
9
  export const defaultProposalBuilder = async ({ publishRef, install }) =>
5
10
  harden({
6
11
  sourceSpec: '@agoric/vats/src/core/startWalletFactory.js',
@@ -25,7 +30,7 @@ export const defaultProposalBuilder = async ({ publishRef, install }) =>
25
30
  ],
26
31
  });
27
32
 
28
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
33
+ /** @type {DeployScriptFunction} */
29
34
  export default async (homeP, endowments) => {
30
35
  const { writeCoreEval } = await makeHelpers(homeP, endowments);
31
36
  await writeCoreEval('gov-vats', defaultProposalBuilder);