@agoric/swing-store 0.9.2-dev-79a22bb.0.79a22bb → 0.9.2-dev-3294e0c.0.3294e0c
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 +3 -3
- package/src/archiver.js +6 -6
- package/src/assertComplete.js +5 -5
- package/test/bundles.test.js +10 -4
- package/test/import.test.js +2 -2
- package/test/state.test.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/swing-store",
|
|
3
|
-
"version": "0.9.2-dev-
|
|
3
|
+
"version": "0.9.2-dev-3294e0c.0.3294e0c",
|
|
4
4
|
"description": "Persistent storage for SwingSet",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"lint:eslint": "node ../../scripts/eslint-repo.mjs ."
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@agoric/internal": "0.3.3-dev-
|
|
24
|
+
"@agoric/internal": "0.3.3-dev-3294e0c.0.3294e0c",
|
|
25
25
|
"@endo/base64": "^1.0.12",
|
|
26
26
|
"@endo/bundle-source": "^4.1.2",
|
|
27
27
|
"@endo/check-bundle": "^1.0.17",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"engines": {
|
|
58
58
|
"node": "^20.9 || ^22.11"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "3294e0c1e81f8d145c6b57624d080908b935f524"
|
|
61
61
|
}
|
package/src/archiver.js
CHANGED
|
@@ -13,9 +13,9 @@ const streamFinished = promisify(streamFinishedCallback);
|
|
|
13
13
|
/**
|
|
14
14
|
* @param {string} dirPath
|
|
15
15
|
* @param {object} powers
|
|
16
|
-
* @param {Pick<import('fs'), 'createWriteStream' | 'mkdirSync' | 'renameSync'>} powers.fs
|
|
17
|
-
* @param {Pick<import('path'), 'join'>} powers.path
|
|
18
|
-
* @param {Pick<import('tmp'), 'fileSync'>} powers.tmp
|
|
16
|
+
* @param {Pick<typeof import('fs'), 'createWriteStream' | 'mkdirSync' | 'renameSync'>} powers.fs
|
|
17
|
+
* @param {Pick<typeof import('path'), 'join'>} powers.path
|
|
18
|
+
* @param {Pick<typeof import('tmp'), 'fileSync'>} powers.tmp
|
|
19
19
|
*/
|
|
20
20
|
export const makeArchiveSnapshot = (dirPath, powers) => {
|
|
21
21
|
const { fs, path, tmp } = powers;
|
|
@@ -55,9 +55,9 @@ harden(makeArchiveSnapshot);
|
|
|
55
55
|
/**
|
|
56
56
|
* @param {string} dirPath
|
|
57
57
|
* @param {object} powers
|
|
58
|
-
* @param {Pick<import('fs'), 'createWriteStream' | 'mkdirSync' | 'renameSync'>} powers.fs
|
|
59
|
-
* @param {Pick<import('path'), 'join'>} powers.path
|
|
60
|
-
* @param {Pick<import('tmp'), 'fileSync'>} powers.tmp
|
|
58
|
+
* @param {Pick<typeof import('fs'), 'createWriteStream' | 'mkdirSync' | 'renameSync'>} powers.fs
|
|
59
|
+
* @param {Pick<typeof import('path'), 'join'>} powers.path
|
|
60
|
+
* @param {Pick<typeof import('tmp'), 'fileSync'>} powers.tmp
|
|
61
61
|
*/
|
|
62
62
|
export const makeArchiveTranscript = (dirPath, powers) => {
|
|
63
63
|
const { fs, path, tmp } = powers;
|
package/src/assertComplete.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @import {SwingStoreInternal} from './internal.js';
|
|
3
|
+
* @import {ArtifactMode} from './internal.js';
|
|
4
|
+
*/
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
* @param {Pick<SwingStoreInternal, 'bundleStore' | 'transcriptStore' | 'snapStore'>} internal
|
|
3
8
|
* @param {Exclude<ArtifactMode, 'debug'>} checkMode
|
|
@@ -7,11 +12,6 @@ export function assertComplete(internal, checkMode) {
|
|
|
7
12
|
// every bundle must be populated
|
|
8
13
|
internal.bundleStore.assertComplete(checkMode);
|
|
9
14
|
|
|
10
|
-
/**
|
|
11
|
-
* @import {SwingStoreInternal} from './internal.js';
|
|
12
|
-
* @import {ArtifactMode} from './internal.js';
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
15
|
// every 'isCurrent' transcript span must have all items
|
|
16
16
|
// TODO: every vat with any data must have a isCurrent transcript
|
|
17
17
|
// span
|
package/test/bundles.test.js
CHANGED
|
@@ -157,8 +157,14 @@ test('unknown format', t => {
|
|
|
157
157
|
const { kernelStorage } = initSwingStore();
|
|
158
158
|
const { bundleStore } = kernelStorage;
|
|
159
159
|
const unknownID = 'b1999-whoa-futuristic';
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
160
|
+
t.throws(
|
|
161
|
+
() =>
|
|
162
|
+
bundleStore.addBundle(
|
|
163
|
+
unknownID,
|
|
164
|
+
/** @type {import('../src/bundleStore.js').Bundle} */ ({}),
|
|
165
|
+
),
|
|
166
|
+
{
|
|
167
|
+
message: /unsupported BundleID/,
|
|
168
|
+
},
|
|
169
|
+
);
|
|
164
170
|
});
|
package/test/import.test.js
CHANGED
|
@@ -62,8 +62,8 @@ test('import empty', async t => {
|
|
|
62
62
|
});
|
|
63
63
|
|
|
64
64
|
const importTest = test.macro(async (t, mode) => {
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
const artifactMode =
|
|
66
|
+
/** @type {import('../src/internal.js').ArtifactMode} */ (mode);
|
|
67
67
|
|
|
68
68
|
const [dbDir, cleanup] = tmpDir('testdb');
|
|
69
69
|
t.teardown(cleanup);
|
package/test/state.test.js
CHANGED
|
@@ -151,7 +151,7 @@ const testTranscriptStore = test.macro({
|
|
|
151
151
|
return `${prefix.replace(/.$/, '$& ')}${type} transcriptStore ${detail}`;
|
|
152
152
|
},
|
|
153
153
|
async exec(t, { ephemeral, keepTranscripts }) {
|
|
154
|
-
let dbDir = null;
|
|
154
|
+
let dbDir = /** @type {string | null} */ (null);
|
|
155
155
|
if (!ephemeral) {
|
|
156
156
|
const [tmpPath, cleanup] = tmpDir('testdb');
|
|
157
157
|
t.teardown(cleanup);
|