@agoric/builders 0.1.1-dev-6909994.0 → 0.1.1-dev-e3b41dc.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-6909994.0+6909994",
3
+ "version": "0.1.1-dev-e3b41dc.0+e3b41dc",
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-6909994.0+6909994",
27
- "@agoric/internal": "0.3.3-dev-6909994.0+6909994",
28
- "@agoric/notifier": "0.6.3-dev-6909994.0+6909994",
29
- "@agoric/smart-wallet": "0.5.4-dev-6909994.0+6909994",
30
- "@agoric/vat-data": "0.5.3-dev-6909994.0+6909994",
31
- "@agoric/vats": "0.15.2-dev-6909994.0+6909994",
32
- "@agoric/zoe": "0.26.3-dev-6909994.0+6909994",
26
+ "@agoric/ertp": "0.16.3-dev-e3b41dc.0+e3b41dc",
27
+ "@agoric/internal": "0.3.3-dev-e3b41dc.0+e3b41dc",
28
+ "@agoric/notifier": "0.6.3-dev-e3b41dc.0+e3b41dc",
29
+ "@agoric/smart-wallet": "0.5.4-dev-e3b41dc.0+e3b41dc",
30
+ "@agoric/vat-data": "0.5.3-dev-e3b41dc.0+e3b41dc",
31
+ "@agoric/vats": "0.15.2-dev-e3b41dc.0+e3b41dc",
32
+ "@agoric/zoe": "0.26.3-dev-e3b41dc.0+e3b41dc",
33
33
  "@endo/bundle-source": "^3.4.0",
34
34
  "@endo/captp": "^4.3.0",
35
35
  "@endo/eventual-send": "^1.2.5",
@@ -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-6909994.0+6909994",
45
- "@agoric/governance": "0.10.4-dev-6909994.0+6909994",
46
- "@agoric/inter-protocol": "0.16.2-dev-6909994.0+6909994",
47
- "@agoric/orchestration": "0.1.1-dev-6909994.0+6909994",
48
- "@agoric/store": "0.9.3-dev-6909994.0+6909994",
49
- "@agoric/swing-store": "0.9.2-dev-6909994.0+6909994",
50
- "@agoric/swingset-liveslots": "0.10.3-dev-6909994.0+6909994",
51
- "@agoric/time": "0.3.3-dev-6909994.0+6909994",
44
+ "@agoric/deploy-script-support": "0.10.4-dev-e3b41dc.0+e3b41dc",
45
+ "@agoric/governance": "0.10.4-dev-e3b41dc.0+e3b41dc",
46
+ "@agoric/inter-protocol": "0.16.2-dev-e3b41dc.0+e3b41dc",
47
+ "@agoric/orchestration": "0.1.1-dev-e3b41dc.0+e3b41dc",
48
+ "@agoric/store": "0.9.3-dev-e3b41dc.0+e3b41dc",
49
+ "@agoric/swing-store": "0.9.2-dev-e3b41dc.0+e3b41dc",
50
+ "@agoric/swingset-liveslots": "0.10.3-dev-e3b41dc.0+e3b41dc",
51
+ "@agoric/time": "0.3.3-dev-e3b41dc.0+e3b41dc",
52
52
  "@endo/errors": "^1.2.5",
53
53
  "ava": "^5.3.0",
54
54
  "c8": "^9.1.0"
@@ -81,5 +81,5 @@
81
81
  "typeCoverage": {
82
82
  "atLeast": 81.8
83
83
  },
84
- "gitHead": "6909994fc7df88c73d6a476f4d10f56aea85bea5"
84
+ "gitHead": "e3b41dc204ce335217bf18ed4889aba18734d8f6"
85
85
  }
@@ -0,0 +1,142 @@
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, Far } from '@endo/far';
11
+
12
+ /// <reference types="@agoric/vats/src/core/types-ambient"/>
13
+ /**
14
+ * @import {Installation, Instance} from '@agoric/zoe/src/zoeService/utils.js';
15
+ */
16
+
17
+ const trace = makeTracer('FixBuggySA', true);
18
+
19
+ /**
20
+ * @import {start as StartFn} from '@agoric/orchestration/src/examples/send-anywhere.contract.js';
21
+ */
22
+
23
+ /**
24
+ * @param {BootstrapPowers & {
25
+ * instance: {
26
+ * consume: {
27
+ * sendAnywhere: Instance<StartFn>;
28
+ * };
29
+ * };
30
+ * }} powers
31
+ * @param {...any} rest
32
+ */
33
+ export const fixSendAnywhere = async (
34
+ {
35
+ consume: {
36
+ agoricNames,
37
+ board,
38
+ chainStorage,
39
+ chainTimerService,
40
+ contractKits,
41
+ cosmosInterchainService,
42
+ localchain,
43
+ },
44
+ instance: instances,
45
+ },
46
+ { options: { sendAnywhereRef } },
47
+ ) => {
48
+ trace(fixSendAnywhere.name);
49
+
50
+ const saInstance = await instances.consume.sendAnywhere;
51
+ trace('saInstance', saInstance);
52
+ const saKit = await E(contractKits).get(saInstance);
53
+
54
+ const marshaller = await E(board).getReadonlyMarshaller();
55
+
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
+ const privateArgs = await deeplyFulfilledObject(
65
+ harden({
66
+ agoricNames: agoricNamesResolves,
67
+ localchain,
68
+ marshaller,
69
+ orchestrationService: cosmosInterchainService,
70
+ storageNode: E(NonNullish(await chainStorage)).makeChildNode(
71
+ 'sendAnywhere',
72
+ ),
73
+ timerService: chainTimerService,
74
+ }),
75
+ );
76
+
77
+ trace('upgrading...');
78
+ await E(saKit.adminFacet).upgradeContract(
79
+ sendAnywhereRef.bundleID,
80
+ privateArgs,
81
+ );
82
+
83
+ trace('done');
84
+ };
85
+ harden(fixSendAnywhere);
86
+
87
+ export const getManifestForValueVow = ({ restoreRef }, { sendAnywhereRef }) => {
88
+ console.log('sendAnywhereRef', sendAnywhereRef);
89
+ return {
90
+ manifest: {
91
+ [fixSendAnywhere.name]: {
92
+ consume: {
93
+ agoricNames: true,
94
+ board: true,
95
+ chainStorage: true,
96
+ chainTimerService: true,
97
+ cosmosInterchainService: true,
98
+ localchain: true,
99
+
100
+ contractKits: true,
101
+ },
102
+ installation: {
103
+ consume: { sendAnywhere: true },
104
+ },
105
+ instance: {
106
+ consume: { sendAnywhere: true },
107
+ },
108
+ },
109
+ },
110
+ installations: {
111
+ sendAnywhere: restoreRef(sendAnywhereRef),
112
+ },
113
+ options: {
114
+ sendAnywhereRef,
115
+ },
116
+ };
117
+ };
118
+
119
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
120
+ export const defaultProposalBuilder = async ({ publishRef, install }) =>
121
+ harden({
122
+ // Somewhat unorthodox, source the exports from this builder module
123
+ sourceSpec: '@agoric/builders/scripts/testing/fix-buggy-sendAnywhere.js',
124
+ getManifestCall: [
125
+ 'getManifestForValueVow',
126
+ {
127
+ sendAnywhereRef: publishRef(
128
+ install(
129
+ '@agoric/orchestration/src/examples/send-anywhere.contract.js',
130
+ ),
131
+ ),
132
+ },
133
+ ],
134
+ });
135
+
136
+ export default async (homeP, endowments) => {
137
+ // import dynamically so the module can work in CoreEval environment
138
+ const dspModule = await import('@agoric/deploy-script-support');
139
+ const { makeHelpers } = dspModule;
140
+ const { writeCoreEval } = await makeHelpers(homeP, endowments);
141
+ await writeCoreEval(fixSendAnywhere.name, defaultProposalBuilder);
142
+ };
@@ -0,0 +1,142 @@
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, Far } 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('StartBuggySA', true);
18
+
19
+ /**
20
+ * @import {start as StartFn} from '@agoric/orchestration/src/examples/send-anywhere.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
+ /** @type {import('@agoric/vats').NameHub} */
68
+ // @ts-expect-error intentional fake
69
+ const agoricNamesHangs = Far('agoricNames that hangs', {
70
+ lookup: async () => {
71
+ trace('agoricNames.lookup being called that will never resolve');
72
+ // BUG: this never resolves
73
+ return new Promise(() => {});
74
+ },
75
+ });
76
+
77
+ const { instance } = await E(startUpgradable)({
78
+ label: 'sendAnywhere',
79
+ installation: sendAnywhere,
80
+ privateArgs: {
81
+ ...privateArgs,
82
+ agoricNames: agoricNamesHangs,
83
+ },
84
+ });
85
+ produceInstance.resolve(instance);
86
+ trace('done');
87
+ };
88
+ harden(startSendAnywhere);
89
+
90
+ export const getManifestForValueVow = ({ restoreRef }, { sendAnywhereRef }) => {
91
+ trace('sendAnywhereRef', sendAnywhereRef);
92
+ return {
93
+ manifest: {
94
+ [startSendAnywhere.name]: {
95
+ consume: {
96
+ agoricNames: true,
97
+ board: true,
98
+ chainStorage: true,
99
+ chainTimerService: true,
100
+ cosmosInterchainService: true,
101
+ localchain: true,
102
+
103
+ startUpgradable: true,
104
+ },
105
+ installation: {
106
+ consume: { sendAnywhere: true },
107
+ },
108
+ instance: {
109
+ produce: { sendAnywhere: true },
110
+ },
111
+ },
112
+ },
113
+ installations: {
114
+ sendAnywhere: restoreRef(sendAnywhereRef),
115
+ },
116
+ };
117
+ };
118
+
119
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
120
+ export const defaultProposalBuilder = async ({ publishRef, install }) =>
121
+ harden({
122
+ // Somewhat unorthodox, source the exports from this builder module
123
+ sourceSpec: '@agoric/builders/scripts/testing/start-buggy-sendAnywhere.js',
124
+ getManifestCall: [
125
+ 'getManifestForValueVow',
126
+ {
127
+ sendAnywhereRef: publishRef(
128
+ install(
129
+ '@agoric/orchestration/src/examples/send-anywhere.contract.js',
130
+ ),
131
+ ),
132
+ },
133
+ ],
134
+ });
135
+
136
+ export default async (homeP, endowments) => {
137
+ // import dynamically so the module can work in CoreEval environment
138
+ const dspModule = await import('@agoric/deploy-script-support');
139
+ const { makeHelpers } = dspModule;
140
+ const { writeCoreEval } = await makeHelpers(homeP, endowments);
141
+ await writeCoreEval(startSendAnywhere.name, defaultProposalBuilder);
142
+ };