@agoric/builders 0.1.1-dev-bc8900d.0 → 0.1.1-dev-9ced650.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/start-query-flows.js +134 -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-9ced650.0+9ced650",
|
|
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-9ced650.0+9ced650",
|
|
27
|
+
"@agoric/internal": "0.3.3-dev-9ced650.0+9ced650",
|
|
28
|
+
"@agoric/notifier": "0.6.3-dev-9ced650.0+9ced650",
|
|
29
|
+
"@agoric/smart-wallet": "0.5.4-dev-9ced650.0+9ced650",
|
|
30
|
+
"@agoric/vat-data": "0.5.3-dev-9ced650.0+9ced650",
|
|
31
|
+
"@agoric/vats": "0.15.2-dev-9ced650.0+9ced650",
|
|
32
|
+
"@agoric/zoe": "0.26.3-dev-9ced650.0+9ced650",
|
|
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-
|
|
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-9ced650.0+9ced650",
|
|
45
|
+
"@agoric/governance": "0.10.4-dev-9ced650.0+9ced650",
|
|
46
|
+
"@agoric/inter-protocol": "0.16.2-dev-9ced650.0+9ced650",
|
|
47
|
+
"@agoric/orchestration": "0.1.1-dev-9ced650.0+9ced650",
|
|
48
|
+
"@agoric/store": "0.9.3-dev-9ced650.0+9ced650",
|
|
49
|
+
"@agoric/swing-store": "0.9.2-dev-9ced650.0+9ced650",
|
|
50
|
+
"@agoric/swingset-liveslots": "0.10.3-dev-9ced650.0+9ced650",
|
|
51
|
+
"@agoric/time": "0.3.3-dev-9ced650.0+9ced650",
|
|
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": 76.03
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "9ced650db6b0983ae5d060a00b3752c3700c4f06"
|
|
85
85
|
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file A proposal to start the query-flows contract.
|
|
3
|
+
*
|
|
4
|
+
* QueryFlows is a testing fixture that publishes query results to vstorage.
|
|
5
|
+
* It's purpose is to support E2E testing.
|
|
6
|
+
*/
|
|
7
|
+
import { deeplyFulfilledObject, makeTracer } from '@agoric/internal';
|
|
8
|
+
import { makeStorageNodeChild } from '@agoric/internal/src/lib-chainStorage.js';
|
|
9
|
+
import { E } from '@endo/far';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @import {QueryFlowsSF as StartFn} from '@agoric/orchestration/src/fixtures/query-flows.contract.js';
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
const contractName = 'queryFlows';
|
|
16
|
+
const trace = makeTracer(contractName, true);
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* See `@agoric/builders/builders/scripts/orchestration/init-query-flows.js` for
|
|
20
|
+
* the accompanying proposal builder. Run `agoric run
|
|
21
|
+
* packages/builders/scripts/orchestration/init-query-flows.js` to build the
|
|
22
|
+
* contract and proposal files.
|
|
23
|
+
*
|
|
24
|
+
* @param {BootstrapPowers & {
|
|
25
|
+
* installation: {
|
|
26
|
+
* consume: {
|
|
27
|
+
* queryFlows: Installation<StartFn>;
|
|
28
|
+
* };
|
|
29
|
+
* };
|
|
30
|
+
* }} powers
|
|
31
|
+
*/
|
|
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 },
|
|
48
|
+
},
|
|
49
|
+
}) => {
|
|
50
|
+
trace(`start ${contractName}`);
|
|
51
|
+
|
|
52
|
+
const storageNode = await makeStorageNodeChild(chainStorage, contractName);
|
|
53
|
+
const marshaller = await E(board).getPublishingMarshaller();
|
|
54
|
+
|
|
55
|
+
/** @type {StartUpgradableOpts<StartFn>} */
|
|
56
|
+
const startOpts = {
|
|
57
|
+
label: 'queryFlows',
|
|
58
|
+
installation,
|
|
59
|
+
terms: undefined,
|
|
60
|
+
privateArgs: await deeplyFulfilledObject(
|
|
61
|
+
harden({
|
|
62
|
+
agoricNames,
|
|
63
|
+
orchestrationService: cosmosInterchainService,
|
|
64
|
+
localchain,
|
|
65
|
+
storageNode,
|
|
66
|
+
marshaller,
|
|
67
|
+
timerService: chainTimerService,
|
|
68
|
+
}),
|
|
69
|
+
),
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const { instance } = await E(startUpgradable)(startOpts);
|
|
73
|
+
produceInstance.resolve(instance);
|
|
74
|
+
};
|
|
75
|
+
harden(startQueryFlows);
|
|
76
|
+
|
|
77
|
+
export const getManifestForContract = (
|
|
78
|
+
{ restoreRef },
|
|
79
|
+
{ installKeys, ...options },
|
|
80
|
+
) => {
|
|
81
|
+
return {
|
|
82
|
+
manifest: {
|
|
83
|
+
[startQueryFlows.name]: {
|
|
84
|
+
consume: {
|
|
85
|
+
agoricNames: true,
|
|
86
|
+
board: true,
|
|
87
|
+
chainStorage: true,
|
|
88
|
+
chainTimerService: true,
|
|
89
|
+
cosmosInterchainService: true,
|
|
90
|
+
localchain: true,
|
|
91
|
+
startUpgradable: true,
|
|
92
|
+
},
|
|
93
|
+
installation: {
|
|
94
|
+
consume: { [contractName]: true },
|
|
95
|
+
},
|
|
96
|
+
instance: {
|
|
97
|
+
produce: { [contractName]: true },
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
installations: {
|
|
102
|
+
[contractName]: restoreRef(installKeys[contractName]),
|
|
103
|
+
},
|
|
104
|
+
options,
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
109
|
+
export const defaultProposalBuilder = async ({ publishRef, install }) => {
|
|
110
|
+
return harden({
|
|
111
|
+
// Somewhat unorthodox, source the exports from this builder module
|
|
112
|
+
sourceSpec: '@agoric/builders/scripts/testing/start-query-flows.js',
|
|
113
|
+
getManifestCall: [
|
|
114
|
+
'getManifestForContract',
|
|
115
|
+
{
|
|
116
|
+
installKeys: {
|
|
117
|
+
queryFlows: publishRef(
|
|
118
|
+
install(
|
|
119
|
+
'@agoric/orchestration/src/fixtures/query-flows.contract.js',
|
|
120
|
+
),
|
|
121
|
+
),
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
export default async (homeP, endowments) => {
|
|
129
|
+
// import dynamically so the module can work in CoreEval environment
|
|
130
|
+
const dspModule = await import('@agoric/deploy-script-support');
|
|
131
|
+
const { makeHelpers } = dspModule;
|
|
132
|
+
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
133
|
+
await writeCoreEval(startQueryFlows.name, defaultProposalBuilder);
|
|
134
|
+
};
|