@agoric/builders 0.1.1-orchestration-dev-096c4e8.0 → 0.1.1-other-dev-fbe72e7.0.fbe72e7

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 (86) hide show
  1. package/package.json +39 -36
  2. package/scripts/inter-protocol/add-STARS.js +8 -7
  3. package/scripts/inter-protocol/add-collateral-core.js +12 -8
  4. package/scripts/inter-protocol/init-core.js +6 -5
  5. package/scripts/inter-protocol/invite-committee-core.js +5 -4
  6. package/scripts/inter-protocol/manual-price-feed.js +4 -0
  7. package/scripts/inter-protocol/price-feed-core.js +5 -5
  8. package/scripts/inter-protocol/replace-electorate-core.js +163 -0
  9. package/scripts/inter-protocol/replace-feeDistributor-combo.js +82 -0
  10. package/scripts/inter-protocol/replace-feeDistributor.js +36 -0
  11. package/scripts/inter-protocol/updatePriceFeeds.js +128 -0
  12. package/scripts/inter-protocol/withdraw-reserve.build.js +68 -0
  13. package/scripts/orchestration/axelar-gmp.build.js +81 -0
  14. package/scripts/orchestration/get-chain-config.js +121 -0
  15. package/scripts/orchestration/helpers.js +46 -0
  16. package/scripts/orchestration/hook-localchain-msg-send.js +30 -0
  17. package/scripts/orchestration/init-basic-flows.js +36 -0
  18. package/scripts/orchestration/init-stakeAtom.js +33 -0
  19. package/scripts/orchestration/init-stakeBld.js +24 -0
  20. package/scripts/orchestration/init-stakeOsmo.js +33 -0
  21. package/scripts/orchestration/write-chain-info.js +14 -0
  22. package/scripts/pegasus/init-core.js +4 -3
  23. package/scripts/smart-wallet/build-game1-start.js +5 -4
  24. package/scripts/smart-wallet/build-wallet-factory2-upgrade.js +4 -3
  25. package/scripts/smart-wallet/build-walletFactory-upgrade.js +4 -3
  26. package/scripts/testing/add-LEMONS.js +24 -0
  27. package/scripts/testing/add-OLIVES.js +23 -0
  28. package/scripts/testing/add-USD-LEMONS.js +19 -0
  29. package/scripts/testing/add-USD-OLIVES.js +19 -0
  30. package/scripts/testing/append-chain-info.js +50 -0
  31. package/scripts/testing/init-auto-stake-it.js +42 -0
  32. package/scripts/testing/init-send-anywhere.js +36 -0
  33. package/scripts/testing/init-swap-anything.js +36 -0
  34. package/scripts/testing/provokeBOYD.js +54 -0
  35. package/scripts/testing/publish-test-info.js +79 -0
  36. package/scripts/testing/recorded-retired-instances.js +81 -0
  37. package/scripts/testing/register-interchain-bank-assets.js +199 -0
  38. package/scripts/testing/replace-feeDistributor-short.js +33 -0
  39. package/scripts/testing/restart-axelar-gmp.js +94 -0
  40. package/scripts/testing/restart-basic-flows.js +101 -0
  41. package/scripts/testing/restart-send-anywhere.js +101 -0
  42. package/scripts/testing/restart-stakeAtom.js +91 -0
  43. package/scripts/testing/restart-valueVow.js +82 -0
  44. package/scripts/testing/start-query-flows.js +155 -0
  45. package/scripts/testing/start-valueVow.js +93 -0
  46. package/scripts/testing/test-upgraded-board.js +15 -0
  47. package/scripts/testing/tweak-chain-info.js +56 -0
  48. package/scripts/testing/upgrade-send-anywhere.js +139 -0
  49. package/scripts/testing/upgrade-vaultFactory.js +21 -0
  50. package/scripts/vats/add-auction.js +31 -0
  51. package/scripts/vats/init-core.js +4 -3
  52. package/scripts/vats/init-localchain.js +4 -3
  53. package/scripts/vats/init-network.js +4 -3
  54. package/scripts/vats/init-orchestration.js +21 -0
  55. package/scripts/vats/init-transfer.js +19 -0
  56. package/scripts/vats/priceFeedSupport.js +90 -0
  57. package/scripts/vats/probe-zcf-bundle.js +4 -3
  58. package/scripts/vats/replace-provisioning.js +4 -3
  59. package/scripts/vats/replace-zoe.js +4 -3
  60. package/scripts/vats/restart-vats.js +4 -3
  61. package/scripts/vats/revive-kread.js +14 -0
  62. package/scripts/vats/test-localchain.js +4 -3
  63. package/scripts/vats/test-vtransfer.js +19 -0
  64. package/scripts/vats/updateAtomPriceFeed.js +22 -0
  65. package/scripts/vats/updateStAtomPriceFeed.js +22 -0
  66. package/scripts/vats/updateStOsmoPriceFeed.js +22 -0
  67. package/scripts/vats/updateStTiaPriceFeed.js +22 -0
  68. package/scripts/vats/updateStkAtomPriceFeed.js +22 -0
  69. package/scripts/vats/upgrade-agoricNames.js +21 -0
  70. package/scripts/vats/upgrade-asset-reserve.js +21 -0
  71. package/scripts/vats/upgrade-bank.js +19 -0
  72. package/scripts/vats/upgrade-board.js +20 -0
  73. package/scripts/vats/upgrade-mintHolder.js +105 -0
  74. package/scripts/vats/upgrade-orchestration.js +21 -0
  75. package/scripts/vats/upgrade-paRegistry.js +21 -0
  76. package/scripts/vats/upgrade-provisionPool-to-BLD.js +25 -0
  77. package/scripts/vats/upgrade-provisionPool.js +21 -0
  78. package/scripts/vats/upgrade-psm.js +19 -0
  79. package/scripts/vats/upgrade-vats.js +49 -0
  80. package/scripts/vats/upgrade-zcf.js +19 -0
  81. package/scripts/vats/upgrade-zoe.js +4 -3
  82. package/scripts/vats/upgradeScaledPriceAuthorities.js +23 -0
  83. package/scripts/vats/upgradeVaults.js +24 -0
  84. package/tsconfig.json +0 -2
  85. package/index.js +0 -2
  86. package/scripts/inter-protocol/deploy-contracts.js +0 -110
@@ -7,7 +7,7 @@ import { makeHelpers } from '@agoric/deploy-script-support';
7
7
  * also prints helpful instructions for copying the files and installing them.
8
8
  */
9
9
 
10
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').ProposalBuilder} */
10
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
11
11
  export const defaultProposalBuilder = async ({ publishRef, install }) =>
12
12
  harden({
13
13
  sourceSpec:
@@ -22,7 +22,8 @@ export const defaultProposalBuilder = async ({ publishRef, install }) =>
22
22
  ],
23
23
  });
24
24
 
25
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
25
26
  export default async (homeP, endowments) => {
26
- const { writeCoreProposal } = await makeHelpers(homeP, endowments);
27
- await writeCoreProposal('upgrade-wallet-factory', defaultProposalBuilder);
27
+ const { writeCoreEval } = await makeHelpers(homeP, endowments);
28
+ await writeCoreEval('upgrade-wallet-factory', defaultProposalBuilder);
28
29
  };
@@ -8,7 +8,7 @@
8
8
  import { makeHelpers } from '@agoric/deploy-script-support';
9
9
  import { getManifestForUpgrade } from '@agoric/smart-wallet/src/proposals/upgrade-walletFactory-proposal.js';
10
10
 
11
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').ProposalBuilder} */
11
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
12
12
  export const defaultProposalBuilder = async ({ publishRef, install }) => {
13
13
  return harden({
14
14
  sourceSpec:
@@ -28,7 +28,8 @@ export const defaultProposalBuilder = async ({ publishRef, install }) => {
28
28
  });
29
29
  };
30
30
 
31
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
31
32
  export default async (homeP, endowments) => {
32
- const { writeCoreProposal } = await makeHelpers(homeP, endowments);
33
- await writeCoreProposal('upgrade-walletFactory', defaultProposalBuilder);
33
+ const { writeCoreEval } = await makeHelpers(homeP, endowments);
34
+ await writeCoreEval('upgrade-walletFactory', defaultProposalBuilder);
34
35
  };
@@ -0,0 +1,24 @@
1
+ import { makeHelpers } from '@agoric/deploy-script-support';
2
+ import { defaultProposalBuilder as vaultProposalBuilder } from '../inter-protocol/add-collateral-core.js';
3
+
4
+ /** @file This is for use in tests in a3p-integration */
5
+
6
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
7
+ const starsVaultProposalBuilder = async powers => {
8
+ return vaultProposalBuilder(powers, {
9
+ interchainAssetOptions: {
10
+ denom: 'ibc/000C0FFEECAFE000',
11
+ decimalPlaces: 6,
12
+ keyword: 'LEMONS',
13
+
14
+ oracleBrand: 'LEMONS',
15
+ proposedName: 'LEMONS',
16
+ },
17
+ });
18
+ };
19
+
20
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
21
+ export default async (homeP, endowments) => {
22
+ const { writeCoreEval } = await makeHelpers(homeP, endowments);
23
+ await writeCoreEval('add-STARS-collateral', starsVaultProposalBuilder);
24
+ };
@@ -0,0 +1,23 @@
1
+ import { makeHelpers } from '@agoric/deploy-script-support';
2
+ import { defaultProposalBuilder as vaultProposalBuilder } from '../inter-protocol/add-collateral-core.js';
3
+
4
+ /** @file This is for use in tests in a3p-integration */
5
+
6
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
7
+ const stars2VaultProposalBuilder = async powers => {
8
+ return vaultProposalBuilder(powers, {
9
+ interchainAssetOptions: {
10
+ denom: 'ibc/111C0FFEECAFE111',
11
+ decimalPlaces: 6,
12
+ keyword: 'OLIVES',
13
+ oracleBrand: 'OLIVES',
14
+ proposedName: 'OLIVES',
15
+ },
16
+ });
17
+ };
18
+
19
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
20
+ export default async (homeP, endowments) => {
21
+ const { writeCoreEval } = await makeHelpers(homeP, endowments);
22
+ await writeCoreEval('add-STARS2-collateral', stars2VaultProposalBuilder);
23
+ };
@@ -0,0 +1,19 @@
1
+ import { makeHelpers } from '@agoric/deploy-script-support';
2
+ import { psmProposalBuilder } from '../inter-protocol/add-collateral-core.js';
3
+
4
+ const addUsdLemonsProposalBuilder = async powers => {
5
+ return psmProposalBuilder(powers, {
6
+ anchorOptions: {
7
+ denom: 'ibc/000C0AAAEECAFE000',
8
+ keyword: 'USD_LEMONS',
9
+ decimalPlaces: 6,
10
+ proposedName: 'USD_LEMONS',
11
+ },
12
+ });
13
+ };
14
+
15
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
16
+ export default async (homeP, endowments) => {
17
+ const { writeCoreEval } = await makeHelpers(homeP, endowments);
18
+ await writeCoreEval('add-LEMONS-PSM', addUsdLemonsProposalBuilder);
19
+ };
@@ -0,0 +1,19 @@
1
+ import { makeHelpers } from '@agoric/deploy-script-support';
2
+ import { psmProposalBuilder } from '../inter-protocol/add-collateral-core.js';
3
+
4
+ const addUsdOlivesProposalBuilder = async powers => {
5
+ return psmProposalBuilder(powers, {
6
+ anchorOptions: {
7
+ denom: 'ibc/000C0AAAEECAFE111',
8
+ keyword: 'USD_OLIVES',
9
+ decimalPlaces: 6,
10
+ proposedName: 'USD_OLIVES',
11
+ },
12
+ });
13
+ };
14
+
15
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
16
+ export default async (homeP, endowments) => {
17
+ const { writeCoreEval } = await makeHelpers(homeP, endowments);
18
+ await writeCoreEval('add-OLIVES-PSM', addUsdOlivesProposalBuilder);
19
+ };
@@ -0,0 +1,50 @@
1
+ /// <reference types="ses" />
2
+ import { makeHelpers } from '@agoric/deploy-script-support';
3
+
4
+ /** @type {Record<string, import('@agoric/orchestration').ChainInfo>} */
5
+ const chainInfo = {
6
+ hot: {
7
+ bech32Prefix: 'cosmos',
8
+ chainId: 'hot-1',
9
+ connections: {
10
+ 'cosmoshub-4': {
11
+ id: 'connection-99',
12
+ client_id: '07-tendermint-3',
13
+ counterparty: {
14
+ client_id: '07-tendermint-2',
15
+ connection_id: 'connection-1',
16
+ },
17
+ state: 3 /* IBCConnectionState.STATE_OPEN */,
18
+ transferChannel: {
19
+ portId: 'transfer',
20
+ channelId: 'channel-1',
21
+ counterPartyChannelId: 'channel-1',
22
+ counterPartyPortId: 'transfer',
23
+ ordering: 1 /* Order.ORDER_UNORDERED */,
24
+ state: 3 /* IBCConnectionState.STATE_OPEN */,
25
+ version: 'ics20-1',
26
+ },
27
+ },
28
+ },
29
+ namespace: 'cosmos',
30
+ reference: 'hot-1',
31
+ },
32
+ };
33
+
34
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
35
+ export const defaultProposalBuilder = async () =>
36
+ harden({
37
+ sourceSpec: '@agoric/orchestration/src/proposals/revise-chain-info.js',
38
+ getManifestCall: [
39
+ 'getManifestForReviseChains',
40
+ {
41
+ chainInfo,
42
+ },
43
+ ],
44
+ });
45
+
46
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
47
+ export default async (homeP, endowments) => {
48
+ const { writeCoreEval } = await makeHelpers(homeP, endowments);
49
+ await writeCoreEval('revise-chain-info', defaultProposalBuilder);
50
+ };
@@ -0,0 +1,42 @@
1
+ /**
2
+ * @file A proposal to start the auto-stake-it contract.
3
+ *
4
+ * AutoStakeIt allows users to to create an auto-forwarding address that
5
+ * transfers and stakes tokens on a remote chain when received.
6
+ */
7
+ import { makeHelpers } from '@agoric/deploy-script-support';
8
+ import { startAutoStakeIt } from '@agoric/orchestration/src/proposals/start-auto-stake-it.js';
9
+ import { parseChainHubOpts } from '../orchestration/helpers.js';
10
+
11
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
12
+ export const defaultProposalBuilder = async (
13
+ { publishRef, install },
14
+ options,
15
+ ) => {
16
+ return harden({
17
+ sourceSpec: '@agoric/orchestration/src/proposals/start-auto-stake-it.js',
18
+ getManifestCall: [
19
+ 'getManifest',
20
+ {
21
+ installKeys: {
22
+ autoAutoStakeIt: publishRef(
23
+ install(
24
+ '@agoric/orchestration/src/examples/auto-stake-it.contract.js',
25
+ ),
26
+ ),
27
+ },
28
+ options,
29
+ },
30
+ ],
31
+ });
32
+ };
33
+
34
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
35
+ export default async (homeP, endowments) => {
36
+ const { scriptArgs } = endowments;
37
+ const opts = parseChainHubOpts(scriptArgs);
38
+ const { writeCoreEval } = await makeHelpers(homeP, endowments);
39
+ await writeCoreEval(startAutoStakeIt.name, utils =>
40
+ defaultProposalBuilder(utils, opts),
41
+ );
42
+ };
@@ -0,0 +1,36 @@
1
+ import { makeHelpers } from '@agoric/deploy-script-support';
2
+ import {
3
+ getManifest,
4
+ startSendAnywhere,
5
+ } from '@agoric/orchestration/src/proposals/start-send-anywhere.js';
6
+ import { parseChainHubOpts } from '../orchestration/helpers.js';
7
+
8
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
9
+ export const defaultProposalBuilder = async (
10
+ { publishRef, install },
11
+ options,
12
+ ) =>
13
+ harden({
14
+ sourceSpec: '@agoric/orchestration/src/proposals/start-send-anywhere.js',
15
+ getManifestCall: [
16
+ getManifest.name,
17
+ {
18
+ installationRef: publishRef(
19
+ install(
20
+ '@agoric/orchestration/src/examples/send-anywhere.contract.js',
21
+ ),
22
+ ),
23
+ options,
24
+ },
25
+ ],
26
+ });
27
+
28
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
29
+ export default async (homeP, endowments) => {
30
+ const { scriptArgs } = endowments;
31
+ const opts = parseChainHubOpts(scriptArgs);
32
+ const { writeCoreEval } = await makeHelpers(homeP, endowments);
33
+ await writeCoreEval(startSendAnywhere.name, utils =>
34
+ defaultProposalBuilder(utils, opts),
35
+ );
36
+ };
@@ -0,0 +1,36 @@
1
+ import { makeHelpers } from '@agoric/deploy-script-support';
2
+ import {
3
+ getManifest,
4
+ startSwapAnything,
5
+ } from '@agoric/orchestration/src/proposals/start-swap-anything.js';
6
+ import { parseChainHubOpts } from '../orchestration/helpers.js';
7
+
8
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
9
+ export const defaultProposalBuilder = async (
10
+ { publishRef, install },
11
+ options,
12
+ ) =>
13
+ harden({
14
+ sourceSpec: '@agoric/orchestration/src/proposals/start-swap-anything.js',
15
+ getManifestCall: [
16
+ getManifest.name,
17
+ {
18
+ installationRef: publishRef(
19
+ install(
20
+ '@agoric/orchestration/src/examples/swap-anything.contract.js',
21
+ ),
22
+ ),
23
+ options,
24
+ },
25
+ ],
26
+ });
27
+
28
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
29
+ export default async (homeP, endowments) => {
30
+ const { scriptArgs } = endowments;
31
+ const opts = parseChainHubOpts(scriptArgs);
32
+ const { writeCoreEval } = await makeHelpers(homeP, endowments);
33
+ await writeCoreEval(startSwapAnything.name, utils =>
34
+ defaultProposalBuilder(utils, opts),
35
+ );
36
+ };
@@ -0,0 +1,54 @@
1
+ /**
2
+ * @file call getTimerBrand() 300 times in hopes of provoking BOYD. This is
3
+ * intended for tests on mainFork for upgrade-18. If there's a similar need in
4
+ * other tests, it can be included there as well. There would be no value in
5
+ * including it in an upgrade of MainNet; it just spins cycles to provoke
6
+ * garbage collection.
7
+ */
8
+
9
+ import { makeTracer } from '@agoric/internal';
10
+ import { E } from '@endo/far';
11
+
12
+ /// <reference types="@agoric/vats/src/core/types-ambient"/>
13
+ /** @import {Instance} from '@agoric/zoe/src/zoeService/utils.js'; */
14
+
15
+ const trace = makeTracer('provokeBOYD', true);
16
+
17
+ /**
18
+ * @param {BootstrapPowers} powers
19
+ */
20
+ export const provokeBOYD = async ({ consume: { chainTimerService } }) => {
21
+ trace(provokeBOYD.name);
22
+ await null;
23
+
24
+ for (let i = 0; i < 300; i += 1) {
25
+ await E(chainTimerService).getTimerBrand();
26
+ }
27
+ trace('done');
28
+ };
29
+ harden(provokeBOYD);
30
+
31
+ export const getManifestForProvokeBOYD = () => {
32
+ return {
33
+ manifest: {
34
+ [provokeBOYD.name]: {
35
+ consume: { chainTimerService: true },
36
+ },
37
+ },
38
+ };
39
+ };
40
+
41
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
42
+ export const defaultProposalBuilder = async () =>
43
+ harden({
44
+ sourceSpec: '@agoric/builders/scripts/testing/provokeBOYD.js',
45
+ getManifestCall: ['getManifestForProvokeBOYD'],
46
+ });
47
+
48
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
49
+ export default async (homeP, endowments) => {
50
+ const dspModule = await import('@agoric/deploy-script-support');
51
+ const { makeHelpers } = dspModule;
52
+ const { writeCoreEval } = await makeHelpers(homeP, endowments);
53
+ await writeCoreEval(provokeBOYD.name, defaultProposalBuilder);
54
+ };
@@ -0,0 +1,79 @@
1
+ import { makeTracer } from '@agoric/internal';
2
+ import { E, Far } from '@endo/far';
3
+ import { makeMarshal } from '@endo/marshal';
4
+
5
+ const trace = makeTracer('PublishTestInfo');
6
+ const { Fail } = assert;
7
+
8
+ /**
9
+ * @param {BootstrapPowers} powers
10
+ */
11
+ export const publishTestInfo = async powers => {
12
+ const {
13
+ consume: { agoricNamesAdmin, chainStorage: chainStorageP },
14
+ } = powers;
15
+
16
+ const chainStorage = await chainStorageP;
17
+ if (!chainStorage) {
18
+ trace('no chain storage, not registering chain info');
19
+ return;
20
+ }
21
+
22
+ trace('publishing testInfo');
23
+ const agoricNamesNode = E(chainStorage).makeChildNode('agoricNames');
24
+ const testInfoNode = E(agoricNamesNode).makeChildNode('testInfo');
25
+ const { nameAdmin } = await E(agoricNamesAdmin).provideChild('testInfo');
26
+
27
+ trace('registering onUpdate...');
28
+ await E(nameAdmin).onUpdate(
29
+ Far('chain info writer', {
30
+ write(entries) {
31
+ const marshalData = makeMarshal(_val => Fail`data only`);
32
+ const value = JSON.stringify(marshalData.toCapData(entries));
33
+ void E(testInfoNode)
34
+ .setValue(value)
35
+ .catch(() =>
36
+ console.log('cannot update vstorage after write to testInfo'),
37
+ );
38
+ },
39
+ }),
40
+ );
41
+
42
+ trace('writing to testInfo...');
43
+ await E(nameAdmin).update('agoric', {
44
+ isAwesome: 'yes',
45
+ tech: ['HardenedJs', 'Orchestration', 'Async_Execution'],
46
+ });
47
+
48
+ trace('Done.');
49
+ };
50
+
51
+ export const getManifestForPublishTestInfo = () => {
52
+ return {
53
+ manifest: {
54
+ [publishTestInfo.name]: {
55
+ consume: {
56
+ agoricNamesAdmin: true,
57
+ chainStorage: true,
58
+ },
59
+ },
60
+ },
61
+ };
62
+ };
63
+
64
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
65
+ export const defaultProposalBuilder = async () =>
66
+ harden({
67
+ // Somewhat unorthodox, source the exports from this builder module
68
+ sourceSpec: '@agoric/builders/scripts/testing/publish-test-info.js',
69
+ getManifestCall: ['getManifestForPublishTestInfo'],
70
+ });
71
+
72
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
73
+ export default async (homeP, endowments) => {
74
+ // import dynamically so the module can work in CoreEval environment
75
+ const dspModule = await import('@agoric/deploy-script-support');
76
+ const { makeHelpers } = dspModule;
77
+ const { writeCoreEval } = await makeHelpers(homeP, endowments);
78
+ await writeCoreEval('publish-test-info', defaultProposalBuilder);
79
+ };
@@ -0,0 +1,81 @@
1
+ import { makeTracer } from '@agoric/internal';
2
+ import { E } from '@endo/far';
3
+
4
+ const trace = makeTracer('RecordedRetired', true);
5
+
6
+ /**
7
+ * @param {BootstrapPowers &
8
+ * PromiseSpaceOf<{ retiredContractInstances: MapStore<string, Instance>;
9
+ * }>
10
+ * } powers
11
+ */
12
+ export const testRecordedRetiredInstances = async ({
13
+ consume: {
14
+ contractKits,
15
+ governedContractKits,
16
+ retiredContractInstances: retiredContractInstancesP,
17
+ },
18
+ }) => {
19
+ trace('Start');
20
+ const retiredContractInstances = await retiredContractInstancesP;
21
+
22
+ const auctionIDs = Array.from(retiredContractInstances.keys()).filter(k =>
23
+ k.startsWith('auction'),
24
+ );
25
+ assert(auctionIDs);
26
+ assert(auctionIDs.length === 1);
27
+ const auctionInstance = retiredContractInstances.get(auctionIDs[0]);
28
+ trace({ auctionInstance });
29
+ assert(await E(governedContractKits).get(auctionInstance));
30
+
31
+ const committeeIDs = Array.from(retiredContractInstances.keys()).filter(k =>
32
+ k.startsWith('economicCommittee'),
33
+ );
34
+ assert(committeeIDs);
35
+ assert(committeeIDs.length === 1);
36
+ trace('found committeeIDs', committeeIDs);
37
+
38
+ const committeeInstance = retiredContractInstances.get(committeeIDs[0]);
39
+ assert(await E(contractKits).get(committeeInstance));
40
+
41
+ const charterIDs = [...retiredContractInstances.keys()].filter(k =>
42
+ k.startsWith('econCommitteeCharter'),
43
+ );
44
+ assert(charterIDs);
45
+ assert(charterIDs.length === 1);
46
+ trace('found charterID', charterIDs);
47
+
48
+ trace('done');
49
+ };
50
+ harden(testRecordedRetiredInstances);
51
+
52
+ export const getManifestForRecordedRetiredInstances = () => {
53
+ return {
54
+ manifest: {
55
+ [testRecordedRetiredInstances.name]: {
56
+ consume: {
57
+ contractKits: true,
58
+ governedContractKits: true,
59
+ retiredContractInstances: true,
60
+ },
61
+ },
62
+ },
63
+ };
64
+ };
65
+
66
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
67
+ export const defaultProposalBuilder = async () =>
68
+ harden({
69
+ sourceSpec:
70
+ '@agoric/builders/scripts/testing/recorded-retired-instances.js',
71
+ getManifestCall: ['getManifestForRecordedRetiredInstances', {}],
72
+ });
73
+
74
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
75
+ export default async (homeP, endowments) => {
76
+ // import dynamically so the module can work in CoreEval environment
77
+ const dspModule = await import('@agoric/deploy-script-support');
78
+ const { makeHelpers } = dspModule;
79
+ const { writeCoreEval } = await makeHelpers(homeP, endowments);
80
+ await writeCoreEval('recorded-retired', defaultProposalBuilder);
81
+ };