@agoric/internal 0.2.2-dev-b85149a.0 → 0.2.2-dev-1a66ff6.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 +2 -2
- package/src/createBundles.d.ts.map +1 -1
- package/src/createBundles.js +10 -11
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -0
- package/src/storage-test-utils.d.ts.map +1 -1
- package/src/storage-test-utils.js +4 -2
- package/src/typeGuards.d.ts +4 -0
- package/src/typeGuards.d.ts.map +1 -0
- package/src/typeGuards.js +8 -0
- package/src/utils.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/internal",
|
|
3
|
-
"version": "0.2.2-dev-
|
|
3
|
+
"version": "0.2.2-dev-1a66ff6.0+1a66ff6",
|
|
4
4
|
"description": "Externally unsupported utilities internal to agoric-sdk",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "1a66ff6bf2d457c0f5316208d0158d1cf86510e3"
|
|
41
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createBundles.d.ts","sourceRoot":"","sources":["createBundles.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createBundles.d.ts","sourceRoot":"","sources":["createBundles.js"],"names":[],"mappings":"AAQO,6EAyBN;AAEM,mFAMN;AAEM,iGAkCN"}
|
package/src/createBundles.js
CHANGED
|
@@ -2,6 +2,7 @@ import path from 'path';
|
|
|
2
2
|
import { spawnSync } from 'child_process';
|
|
3
3
|
import { createRequire } from 'module';
|
|
4
4
|
|
|
5
|
+
const { Fail, quote: q } = assert;
|
|
5
6
|
const BUNDLE_SOURCE_PROGRAM = 'bundle-source';
|
|
6
7
|
const req = createRequire(import.meta.url);
|
|
7
8
|
|
|
@@ -14,7 +15,9 @@ export const createBundlesFromAbsolute = async sourceBundles => {
|
|
|
14
15
|
const base = path.basename(bundlePath);
|
|
15
16
|
|
|
16
17
|
const match = base.match(/^bundle-(.*)\.js$/);
|
|
17
|
-
|
|
18
|
+
if (!match) {
|
|
19
|
+
throw Fail`${q(bundlePath)} is not 'DIR/bundle-NAME.js'`;
|
|
20
|
+
}
|
|
18
21
|
const bundle = match[1];
|
|
19
22
|
|
|
20
23
|
const args = cacheToArgs.get(cache) || ['--to', cache];
|
|
@@ -25,11 +28,8 @@ export const createBundlesFromAbsolute = async sourceBundles => {
|
|
|
25
28
|
for (const args of cacheToArgs.values()) {
|
|
26
29
|
console.log(BUNDLE_SOURCE_PROGRAM, ...args);
|
|
27
30
|
const { status } = spawnSync(prog, args, { stdio: 'inherit' });
|
|
28
|
-
|
|
29
|
-
status
|
|
30
|
-
0,
|
|
31
|
-
`${BUNDLE_SOURCE_PROGRAM} failed with status ${status}`,
|
|
32
|
-
);
|
|
31
|
+
status === 0 ||
|
|
32
|
+
Fail`${q(BUNDLE_SOURCE_PROGRAM)} failed with status ${q(status)}`;
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
|
|
@@ -57,11 +57,10 @@ export const extractProposalBundles = async (
|
|
|
57
57
|
const srcPath = req.resolve(src, { paths: [home] });
|
|
58
58
|
if (toBundle.has(bundlePath)) {
|
|
59
59
|
const oldSrc = toBundle.get(bundlePath);
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
);
|
|
60
|
+
oldSrc === srcPath ||
|
|
61
|
+
Fail`${q(bundlePath)} already installed as ${q(
|
|
62
|
+
oldSrc,
|
|
63
|
+
)}, also given ${q(srcPath)}`;
|
|
65
64
|
}
|
|
66
65
|
toBundle.set(bundlePath, srcPath);
|
|
67
66
|
}
|
package/src/index.d.ts
CHANGED
package/src/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage-test-utils.d.ts","sourceRoot":"","sources":["storage-test-utils.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"storage-test-utils.d.ts","sourceRoot":"","sources":["storage-test-utils.js"],"names":[],"mappings":"AAaO,6CAHI,MAAM;;;;yBAQH,OAAO,4BAA4B,EAAE,cAAc;;;;EAkDhE;AAIM;IASH;;;;;;;;OAQG;oBAHQ,MAAM,eACN,OAAO,uBAAuB,EAAE,UAAU,KACxC,OAAO;;;;;;;;;;;;;;;;;IAPpB;;;;;;;;OAQG;oBAHQ,MAAM,eACN,OAAO,uBAAuB,EAAE,UAAU,KACxC,OAAO;;;;;;;;;;;;;;;;GAcvB;6BAhCa,WAAY,yBAAyB,CAAC;mCAiCtC,WAAW,+BAA+B,CAAC"}
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
import { Far, makeMarshal } from '@endo/marshal';
|
|
3
3
|
import { makeChainStorageRoot } from './lib-chainStorage.js';
|
|
4
4
|
|
|
5
|
+
const { Fail, quote: q } = assert;
|
|
6
|
+
|
|
5
7
|
/**
|
|
6
8
|
* For testing, creates a chainStorage root node over an in-memory map
|
|
7
9
|
* and exposes both the map and the sequence of received messages.
|
|
@@ -87,11 +89,11 @@ export const makeMockChainStorageRoot = () => {
|
|
|
87
89
|
* @returns {unknown}
|
|
88
90
|
*/
|
|
89
91
|
getBody: (path, marshaller = defaultMarshaller) => {
|
|
90
|
-
|
|
92
|
+
data.size || Fail`no data in storage`;
|
|
91
93
|
const dataStr = data.get(path);
|
|
92
94
|
if (!dataStr) {
|
|
93
95
|
console.debug('mockChainStorage data:', data);
|
|
94
|
-
|
|
96
|
+
Fail`no data at ${q(path)}`;
|
|
95
97
|
}
|
|
96
98
|
assert.typeof(dataStr, 'string');
|
|
97
99
|
const datum = JSON.parse(dataStr);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typeGuards.d.ts","sourceRoot":"","sources":["typeGuards.js"],"names":[],"mappings":"AAGO,kCAFI,cAAc,eAAe,EAAE,CAAC;;EAKvC"}
|
package/src/utils.js
CHANGED
|
@@ -174,7 +174,7 @@ harden(applyLabelingError);
|
|
|
174
174
|
* @type {<T extends {}>(unfulfilledTerms: T) => import('@endo/far').ERef<DeeplyAwaited<T>>}
|
|
175
175
|
*/
|
|
176
176
|
export const deeplyFulfilledObject = obj => {
|
|
177
|
-
|
|
177
|
+
isObject(obj) || Fail`param must be an object`;
|
|
178
178
|
return deeplyFulfilled(obj);
|
|
179
179
|
};
|
|
180
180
|
|