@agoric/builders 0.1.1-dev-bf791ed.0 → 0.1.1-dev-1875030.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 +17 -17
- package/scripts/testing/restart-basic-flows.js +100 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/builders",
|
|
3
|
-
"version": "0.1.1-dev-
|
|
3
|
+
"version": "0.1.1-dev-1875030.0+1875030",
|
|
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-
|
|
27
|
-
"@agoric/internal": "0.3.3-dev-
|
|
28
|
-
"@agoric/notifier": "0.6.3-dev-
|
|
29
|
-
"@agoric/smart-wallet": "0.5.4-dev-
|
|
30
|
-
"@agoric/vat-data": "0.5.3-dev-
|
|
31
|
-
"@agoric/vats": "0.15.2-dev-
|
|
32
|
-
"@agoric/zoe": "0.26.3-dev-
|
|
26
|
+
"@agoric/ertp": "0.16.3-dev-1875030.0+1875030",
|
|
27
|
+
"@agoric/internal": "0.3.3-dev-1875030.0+1875030",
|
|
28
|
+
"@agoric/notifier": "0.6.3-dev-1875030.0+1875030",
|
|
29
|
+
"@agoric/smart-wallet": "0.5.4-dev-1875030.0+1875030",
|
|
30
|
+
"@agoric/vat-data": "0.5.3-dev-1875030.0+1875030",
|
|
31
|
+
"@agoric/vats": "0.15.2-dev-1875030.0+1875030",
|
|
32
|
+
"@agoric/zoe": "0.26.3-dev-1875030.0+1875030",
|
|
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-
|
|
45
|
-
"@agoric/governance": "0.10.4-dev-
|
|
46
|
-
"@agoric/inter-protocol": "0.16.2-dev-
|
|
47
|
-
"@agoric/orchestration": "0.1.1-dev-
|
|
48
|
-
"@agoric/store": "0.9.3-dev-
|
|
49
|
-
"@agoric/swing-store": "0.9.2-dev-
|
|
50
|
-
"@agoric/swingset-liveslots": "0.10.3-dev-
|
|
51
|
-
"@agoric/time": "0.3.3-dev-
|
|
44
|
+
"@agoric/deploy-script-support": "0.10.4-dev-1875030.0+1875030",
|
|
45
|
+
"@agoric/governance": "0.10.4-dev-1875030.0+1875030",
|
|
46
|
+
"@agoric/inter-protocol": "0.16.2-dev-1875030.0+1875030",
|
|
47
|
+
"@agoric/orchestration": "0.1.1-dev-1875030.0+1875030",
|
|
48
|
+
"@agoric/store": "0.9.3-dev-1875030.0+1875030",
|
|
49
|
+
"@agoric/swing-store": "0.9.2-dev-1875030.0+1875030",
|
|
50
|
+
"@agoric/swingset-liveslots": "0.10.3-dev-1875030.0+1875030",
|
|
51
|
+
"@agoric/time": "0.3.3-dev-1875030.0+1875030",
|
|
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": "
|
|
84
|
+
"gitHead": "18750306d274ce845dd8ec70777cf92917a6e3e1"
|
|
85
85
|
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file This is for use in tests.
|
|
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('RestartBasicFlows', true);
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @import {start as StartFn} from '@agoric/orchestration/src/examples/basic-flows.contract.js';
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @param {BootstrapPowers} powers
|
|
22
|
+
*/
|
|
23
|
+
export const restartBasicFlows = 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(restartBasicFlows.name);
|
|
37
|
+
|
|
38
|
+
// @ts-expect-error unknown instance
|
|
39
|
+
const instance = await instances.consume.basicFlows;
|
|
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
|
+
'basicFlows',
|
|
54
|
+
),
|
|
55
|
+
timerService: chainTimerService,
|
|
56
|
+
}),
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
await E(kit.adminFacet).restartContract(privateArgs);
|
|
60
|
+
trace('done');
|
|
61
|
+
};
|
|
62
|
+
harden(restartBasicFlows);
|
|
63
|
+
|
|
64
|
+
export const getManifest = () => {
|
|
65
|
+
return {
|
|
66
|
+
manifest: {
|
|
67
|
+
[restartBasicFlows.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: { basicFlows: 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-basic-flows.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(restartBasicFlows.name, defaultProposalBuilder);
|
|
100
|
+
};
|