@agoric/builders 0.1.1-dev-e8c27f8.0 → 0.1.1-dev-0c96ea5.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-dev-e8c27f8.0+e8c27f8",
3
+ "version": "0.1.1-dev-0c96ea5.0+0c96ea5",
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-dev-e8c27f8.0+e8c27f8",
27
- "@agoric/internal": "0.3.3-dev-e8c27f8.0+e8c27f8",
28
- "@agoric/notifier": "0.6.3-dev-e8c27f8.0+e8c27f8",
29
- "@agoric/smart-wallet": "0.5.4-dev-e8c27f8.0+e8c27f8",
30
- "@agoric/vat-data": "0.5.3-dev-e8c27f8.0+e8c27f8",
31
- "@agoric/vats": "0.15.2-dev-e8c27f8.0+e8c27f8",
32
- "@agoric/zoe": "0.26.3-dev-e8c27f8.0+e8c27f8",
26
+ "@agoric/ertp": "0.16.3-dev-0c96ea5.0+0c96ea5",
27
+ "@agoric/internal": "0.3.3-dev-0c96ea5.0+0c96ea5",
28
+ "@agoric/notifier": "0.6.3-dev-0c96ea5.0+0c96ea5",
29
+ "@agoric/smart-wallet": "0.5.4-dev-0c96ea5.0+0c96ea5",
30
+ "@agoric/vat-data": "0.5.3-dev-0c96ea5.0+0c96ea5",
31
+ "@agoric/vats": "0.15.2-dev-0c96ea5.0+0c96ea5",
32
+ "@agoric/zoe": "0.26.3-dev-0c96ea5.0+0c96ea5",
33
33
  "@endo/bundle-source": "^3.2.3",
34
34
  "@endo/captp": "^4.2.0",
35
35
  "@endo/eventual-send": "^1.2.2",
@@ -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-dev-e8c27f8.0+e8c27f8",
45
- "@agoric/governance": "0.10.4-dev-e8c27f8.0+e8c27f8",
46
- "@agoric/inter-protocol": "0.16.2-dev-e8c27f8.0+e8c27f8",
47
- "@agoric/orchestration": "0.1.1-dev-e8c27f8.0+e8c27f8",
48
- "@agoric/store": "0.9.3-dev-e8c27f8.0+e8c27f8",
49
- "@agoric/swing-store": "0.9.2-dev-e8c27f8.0+e8c27f8",
50
- "@agoric/swingset-liveslots": "0.10.3-dev-e8c27f8.0+e8c27f8",
51
- "@agoric/time": "0.3.3-dev-e8c27f8.0+e8c27f8",
44
+ "@agoric/deploy-script-support": "0.10.4-dev-0c96ea5.0+0c96ea5",
45
+ "@agoric/governance": "0.10.4-dev-0c96ea5.0+0c96ea5",
46
+ "@agoric/inter-protocol": "0.16.2-dev-0c96ea5.0+0c96ea5",
47
+ "@agoric/orchestration": "0.1.1-dev-0c96ea5.0+0c96ea5",
48
+ "@agoric/store": "0.9.3-dev-0c96ea5.0+0c96ea5",
49
+ "@agoric/swing-store": "0.9.2-dev-0c96ea5.0+0c96ea5",
50
+ "@agoric/swingset-liveslots": "0.10.3-dev-0c96ea5.0+0c96ea5",
51
+ "@agoric/time": "0.3.3-dev-0c96ea5.0+0c96ea5",
52
52
  "@endo/errors": "^1.2.2",
53
53
  "ava": "^5.3.0",
54
54
  "c8": "^9.1.0"
@@ -81,5 +81,5 @@
81
81
  "typeCoverage": {
82
82
  "atLeast": 76.03
83
83
  },
84
- "gitHead": "e8c27f891217a42192a2e3c46edaa22010439645"
84
+ "gitHead": "0c96ea5a63bb001d5f11e99a1fa58de4cce475c1"
85
85
  }
@@ -0,0 +1,100 @@
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"/>
13
+
14
+ const trace = makeTracer('StartSA', true);
15
+
16
+ /**
17
+ * @import {start as StartFn} from '@agoric/orchestration/src/examples/sendAnywhere.contract.js';
18
+ */
19
+
20
+ /**
21
+ * @param {BootstrapPowers} powers
22
+ */
23
+ export const restartSendAnywhere = async ({
24
+ consume: {
25
+ agoricNames,
26
+ board,
27
+ chainStorage,
28
+ chainTimerService,
29
+ cosmosInterchainService,
30
+ localchain,
31
+
32
+ contractKits,
33
+ },
34
+ instance: instances,
35
+ }) => {
36
+ trace(restartSendAnywhere.name);
37
+
38
+ // @ts-expect-error unknown instance
39
+ const instance = await instances.consume.sendAnywhere;
40
+ trace('instance', instance);
41
+ /** @type {StartedInstanceKit<StartFn>} */
42
+ const kit = /** @type {any} */ (await E(contractKits).get(instance));
43
+
44
+ const marshaller = await E(board).getReadonlyMarshaller();
45
+
46
+ const privateArgs = await deeplyFulfilledObject(
47
+ harden({
48
+ agoricNames,
49
+ localchain,
50
+ marshaller,
51
+ orchestrationService: cosmosInterchainService,
52
+ storageNode: E(NonNullish(await chainStorage)).makeChildNode(
53
+ 'sendAnywhere',
54
+ ),
55
+ timerService: chainTimerService,
56
+ }),
57
+ );
58
+
59
+ await E(kit.adminFacet).restartContract(privateArgs);
60
+ trace('done');
61
+ };
62
+ harden(restartSendAnywhere);
63
+
64
+ export const getManifest = () => {
65
+ return {
66
+ manifest: {
67
+ [restartSendAnywhere.name]: {
68
+ consume: {
69
+ agoricNames: true,
70
+ board: true,
71
+ chainStorage: true,
72
+ chainTimerService: true,
73
+ cosmosInterchainService: true,
74
+ localchain: true,
75
+
76
+ contractKits: true,
77
+ },
78
+ instance: {
79
+ consume: { sendAnywhere: true },
80
+ },
81
+ },
82
+ },
83
+ };
84
+ };
85
+
86
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
87
+ export const defaultProposalBuilder = async () =>
88
+ harden({
89
+ // Somewhat unorthodox, source the exports from this builder module
90
+ sourceSpec: '@agoric/builders/scripts/testing/restart-sendAnywhere.js',
91
+ getManifestCall: [getManifest.name],
92
+ });
93
+
94
+ export default async (homeP, endowments) => {
95
+ // import dynamically so the module can work in CoreEval environment
96
+ const dspModule = await import('@agoric/deploy-script-support');
97
+ const { makeHelpers } = dspModule;
98
+ const { writeCoreEval } = await makeHelpers(homeP, endowments);
99
+ await writeCoreEval(restartSendAnywhere.name, defaultProposalBuilder);
100
+ };
@@ -0,0 +1,89 @@
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 { deeplyFulfilledObject, makeTracer } from '@agoric/internal';
6
+ import { makeStorageNodeChild } from '@agoric/internal/src/lib-chainStorage.js';
7
+ import { E } from '@endo/far';
8
+
9
+ /// <reference types="@agoric/vats/src/core/types-ambient"/>
10
+
11
+ const trace = makeTracer('RestartSA', true);
12
+
13
+ /**
14
+ * @import {start as StartFn} from '@agoric/orchestration/src/examples/stakeIca.contract.js';
15
+ */
16
+
17
+ /**
18
+ * @param {BootstrapPowers} powers
19
+ */
20
+ export const restartStakeAtom = async ({
21
+ consume: {
22
+ board,
23
+ chainStorage,
24
+ chainTimerService,
25
+ cosmosInterchainService,
26
+
27
+ contractKits,
28
+ },
29
+ instance: instances,
30
+ }) => {
31
+ trace(restartStakeAtom.name);
32
+
33
+ const instance = await instances.consume.stakeAtom;
34
+ trace('instance', instance);
35
+
36
+ /** @type {StartedInstanceKit<StartFn>} */
37
+ const kit = /** @type {any} */ (await E(contractKits).get(instance));
38
+
39
+ const marshaller = await E(board).getReadonlyMarshaller();
40
+
41
+ const privateArgs = await deeplyFulfilledObject(
42
+ harden({
43
+ cosmosInterchainService,
44
+ storageNode: makeStorageNodeChild(chainStorage, 'stakeAtom'),
45
+ marshaller,
46
+ timer: chainTimerService,
47
+ }),
48
+ );
49
+
50
+ await E(kit.adminFacet).restartContract(privateArgs);
51
+ trace('done');
52
+ };
53
+ harden(restartStakeAtom);
54
+
55
+ export const getManifest = () => {
56
+ return {
57
+ manifest: {
58
+ [restartStakeAtom.name]: {
59
+ consume: {
60
+ board: true,
61
+ chainStorage: true,
62
+ chainTimerService: true,
63
+ cosmosInterchainService: true,
64
+
65
+ contractKits: true,
66
+ },
67
+ instance: {
68
+ consume: { stakeAtom: true },
69
+ },
70
+ },
71
+ },
72
+ };
73
+ };
74
+
75
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
76
+ export const defaultProposalBuilder = async () =>
77
+ harden({
78
+ // Somewhat unorthodox, source the exports from this builder module
79
+ sourceSpec: '@agoric/builders/scripts/testing/restart-stakeAtom.js',
80
+ getManifestCall: [getManifest.name],
81
+ });
82
+
83
+ export default async (homeP, endowments) => {
84
+ // import dynamically so the module can work in CoreEval environment
85
+ const dspModule = await import('@agoric/deploy-script-support');
86
+ const { makeHelpers } = dspModule;
87
+ const { writeCoreEval } = await makeHelpers(homeP, endowments);
88
+ await writeCoreEval(restartStakeAtom.name, defaultProposalBuilder);
89
+ };
@@ -0,0 +1,128 @@
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"/>
13
+ /**
14
+ * @import {Installation} from '@agoric/zoe/src/zoeService/utils.js';
15
+ */
16
+
17
+ const trace = makeTracer('StartSA', true);
18
+
19
+ /**
20
+ * @import {start as StartFn} from '@agoric/orchestration/src/examples/sendAnywhere.contract.js';
21
+ */
22
+
23
+ /**
24
+ * @param {BootstrapPowers & {
25
+ * installation: {
26
+ * consume: {
27
+ * sendAnywhere: Installation<StartFn>;
28
+ * };
29
+ * };
30
+ * }} powers
31
+ */
32
+ export const startSendAnywhere = async ({
33
+ consume: {
34
+ agoricNames,
35
+ board,
36
+ chainStorage,
37
+ chainTimerService,
38
+ cosmosInterchainService,
39
+ localchain,
40
+ startUpgradable,
41
+ },
42
+ installation: {
43
+ consume: { sendAnywhere },
44
+ },
45
+ instance: {
46
+ // @ts-expect-error unknown instance
47
+ produce: { sendAnywhere: produceInstance },
48
+ },
49
+ }) => {
50
+ trace(startSendAnywhere.name);
51
+
52
+ const marshaller = await E(board).getReadonlyMarshaller();
53
+
54
+ const privateArgs = await deeplyFulfilledObject(
55
+ harden({
56
+ agoricNames,
57
+ localchain,
58
+ marshaller,
59
+ orchestrationService: cosmosInterchainService,
60
+ storageNode: E(NonNullish(await chainStorage)).makeChildNode(
61
+ 'sendAnywhere',
62
+ ),
63
+ timerService: chainTimerService,
64
+ }),
65
+ );
66
+
67
+ const { instance } = await E(startUpgradable)({
68
+ label: 'sendAnywhere',
69
+ installation: sendAnywhere,
70
+ privateArgs,
71
+ });
72
+ produceInstance.resolve(instance);
73
+ trace('done');
74
+ };
75
+ harden(startSendAnywhere);
76
+
77
+ export const getManifest = ({ restoreRef }, { installationRef }) => {
78
+ return {
79
+ manifest: {
80
+ [startSendAnywhere.name]: {
81
+ consume: {
82
+ agoricNames: true,
83
+ board: true,
84
+ chainStorage: true,
85
+ chainTimerService: true,
86
+ cosmosInterchainService: true,
87
+ localchain: true,
88
+
89
+ startUpgradable: true,
90
+ },
91
+ installation: {
92
+ consume: { sendAnywhere: true },
93
+ },
94
+ instance: {
95
+ produce: { sendAnywhere: true },
96
+ },
97
+ },
98
+ },
99
+ installations: {
100
+ sendAnywhere: restoreRef(installationRef),
101
+ },
102
+ };
103
+ };
104
+
105
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
106
+ export const defaultProposalBuilder = async ({ publishRef, install }) =>
107
+ harden({
108
+ // Somewhat unorthodox, source the exports from this builder module
109
+ sourceSpec: '@agoric/builders/scripts/testing/start-sendAnywhere.js',
110
+ getManifestCall: [
111
+ getManifest.name,
112
+ {
113
+ installationRef: publishRef(
114
+ install(
115
+ '@agoric/orchestration/src/examples/sendAnywhere.contract.js',
116
+ ),
117
+ ),
118
+ },
119
+ ],
120
+ });
121
+
122
+ export default async (homeP, endowments) => {
123
+ // import dynamically so the module can work in CoreEval environment
124
+ const dspModule = await import('@agoric/deploy-script-support');
125
+ const { makeHelpers } = dspModule;
126
+ const { writeCoreEval } = await makeHelpers(homeP, endowments);
127
+ await writeCoreEval(startSendAnywhere.name, defaultProposalBuilder);
128
+ };