@agoric/swing-store 0.10.0-upgrade-18-dev-aaebae4.0 → 0.10.0-upgrade-18-dev-bd8fd54.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/CHANGELOG.md CHANGED
@@ -3,6 +3,15 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.10.0-u18.1](https://github.com/Agoric/agoric-sdk/compare/@agoric/swing-store@0.10.0-u18.0...@agoric/swing-store@0.10.0-u18.1) (2024-12-24)
7
+
8
+
9
+ ### Features
10
+
11
+ * **cosmic-swingset:** Allow `launch` to accept an already-open swingStore ([c65e5b1](https://github.com/Agoric/agoric-sdk/commit/c65e5b1c531c08026f5f11cf5d5dcdbe238b05ee))
12
+
13
+
14
+
6
15
  ## [0.10.0-u18.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/swing-store@0.9.1...@agoric/swing-store@0.10.0-u18.0) (2024-10-31)
7
16
 
8
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agoric/swing-store",
3
- "version": "0.10.0-upgrade-18-dev-aaebae4.0+aaebae4",
3
+ "version": "0.10.0-upgrade-18-dev-bd8fd54.0+bd8fd54",
4
4
  "description": "Persistent storage for SwingSet",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
@@ -13,7 +13,7 @@
13
13
  "scripts": {
14
14
  "build": "exit 0",
15
15
  "test": "ava",
16
- "test:c8": "c8 $C8_OPTIONS ava --config=ava-nesm.config.js",
16
+ "test:c8": "c8 --all $C8_OPTIONS ava",
17
17
  "test:xs": "exit 0",
18
18
  "lint-fix": "yarn lint:eslint --fix",
19
19
  "lint": "run-s --continue-on-error lint:*",
@@ -21,19 +21,19 @@
21
21
  "lint:eslint": "eslint ."
22
22
  },
23
23
  "dependencies": {
24
- "@agoric/internal": "0.4.0-upgrade-18-dev-aaebae4.0+aaebae4",
25
- "@endo/base64": "^1.0.8",
26
- "@endo/bundle-source": "^3.4.2",
27
- "@endo/check-bundle": "^1.0.11",
28
- "@endo/errors": "^1.2.7",
29
- "@endo/nat": "^5.0.12",
24
+ "@agoric/internal": "0.4.0-upgrade-18-dev-bd8fd54.0+bd8fd54",
25
+ "@endo/base64": "^1.0.9",
26
+ "@endo/bundle-source": "^3.5.0",
27
+ "@endo/check-bundle": "^1.0.12",
28
+ "@endo/errors": "^1.2.8",
29
+ "@endo/nat": "^5.0.13",
30
30
  "better-sqlite3": "^9.1.1"
31
31
  },
32
32
  "devDependencies": {
33
- "@endo/init": "^1.1.6",
33
+ "@endo/init": "^1.1.7",
34
34
  "@types/better-sqlite3": "^7.6.9",
35
35
  "ava": "^5.3.0",
36
- "c8": "^9.1.0",
36
+ "c8": "^10.1.2",
37
37
  "tmp": "^0.2.1"
38
38
  },
39
39
  "publishConfig": {
@@ -49,7 +49,7 @@
49
49
  "timeout": "2m"
50
50
  },
51
51
  "typeCoverage": {
52
- "atLeast": 79.08
52
+ "atLeast": 79.04
53
53
  },
54
- "gitHead": "aaebae4892112869b545faad80bfbe0b8d8602b8"
54
+ "gitHead": "bd8fd545c40400566a6ff3838b1499173fcf9aaf"
55
55
  }
package/src/exporter.js CHANGED
@@ -133,7 +133,6 @@ export function makeSwingStoreExporter(dirPath, options = {}) {
133
133
  * section
134
134
  */
135
135
  function getHostKV(key) {
136
- typeof key === 'string' || Fail`key must be a string`;
137
136
  getKeyType(key) === 'host' || Fail`getHostKV requires host keys`;
138
137
  // @ts-expect-error unknown
139
138
  return sqlKVGet.get(key);
@@ -176,7 +175,7 @@ export function makeSwingStoreExporter(dirPath, options = {}) {
176
175
  function getArtifactNames() {
177
176
  if (artifactMode !== 'debug') {
178
177
  // synchronously throw if this DB will not be able to yield all the desired artifacts
179
- const internal = { snapStore, bundleStore, transcriptStore };
178
+ const internal = { dirPath, snapStore, bundleStore, transcriptStore };
180
179
  assertComplete(internal, artifactMode);
181
180
  }
182
181
  return generateArtifactNames();
package/src/hasher.js CHANGED
@@ -16,7 +16,6 @@ import { createHash } from 'crypto';
16
16
  function createSHA256(initial = undefined) {
17
17
  const hash = createHash('sha256');
18
18
  let done = false;
19
- // eslint-disable-next-line no-use-before-define
20
19
  const self = harden({ add, finish, sample });
21
20
  function add(more) {
22
21
  !done || Fail`hash already finished`;
package/src/internal.js CHANGED
@@ -6,6 +6,7 @@ import { Fail, q } from '@endo/errors';
6
6
  * @typedef { import('./bundleStore.js').BundleStoreInternal } BundleStoreInternal
7
7
  *
8
8
  * @typedef {{
9
+ * dirPath: string | null,
9
10
  * transcriptStore: TranscriptStoreInternal,
10
11
  * snapStore: SnapStoreInternal,
11
12
  * bundleStore: BundleStoreInternal,
package/src/kvStore.js CHANGED
@@ -15,6 +15,7 @@ import { Fail } from '@endo/errors';
15
15
  * @param {string} key
16
16
  */
17
17
  export function getKeyType(key) {
18
+ typeof key === 'string' || Fail`key must be a string`;
18
19
  if (key.startsWith('local.')) {
19
20
  return 'local';
20
21
  } else if (key.startsWith('host.')) {
package/src/swingStore.js CHANGED
@@ -337,7 +337,6 @@ export function makeSwingStore(dirPath, forceReset, options = {}) {
337
337
  const kernelKVStore = {
338
338
  ...kvStore,
339
339
  set(key, value) {
340
- typeof key === 'string' || Fail`key must be a string`;
341
340
  const keyType = getKeyType(key);
342
341
  keyType !== 'host' || Fail`kernelKVStore refuses host keys`;
343
342
  kvStore.set(key, value);
@@ -352,7 +351,6 @@ export function makeSwingStore(dirPath, forceReset, options = {}) {
352
351
  }
353
352
  },
354
353
  delete(key) {
355
- typeof key === 'string' || Fail`key must be a string`;
356
354
  const keyType = getKeyType(key);
357
355
  keyType !== 'host' || Fail`kernelKVStore refuses host keys`;
358
356
  kvStore.delete(key);
@@ -505,6 +503,7 @@ export function makeSwingStore(dirPath, forceReset, options = {}) {
505
503
 
506
504
  /** @type {import('./internal.js').SwingStoreInternal} */
507
505
  const internal = harden({
506
+ dirPath,
508
507
  snapStore,
509
508
  transcriptStore,
510
509
  bundleStore,