@agoric/cache 0.3.3-mainnet1B-dev-26244e8.0 → 0.3.3-orchestration-dev-096c4e8.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 +0 -24
- package/package.json +17 -11
- package/src/cache.js +1 -1
- package/src/state.js +1 -1
- package/src/store.js +10 -12
- package/test/test-storage.js +1 -3
- package/{jsconfig.json → tsconfig.json} +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,30 +3,6 @@
|
|
|
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.3.3-u12.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/cache@0.3.3-u11wf.0...@agoric/cache@0.3.3-u12.0) (2023-11-10)
|
|
7
|
-
|
|
8
|
-
**Note:** Version bump only for package @agoric/cache
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
### [0.3.3-u11wf.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/cache@0.3.3-u11.0...@agoric/cache@0.3.3-u11wf.0) (2023-09-23)
|
|
15
|
-
|
|
16
|
-
**Note:** Version bump only for package @agoric/cache
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
### [0.3.3-u11.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/cache@0.3.2...@agoric/cache@0.3.3-u11.0) (2023-08-24)
|
|
23
|
-
|
|
24
|
-
**Note:** Version bump only for package @agoric/cache
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
6
|
### [0.3.2](https://github.com/Agoric/agoric-sdk/compare/@agoric/cache@0.3.1...@agoric/cache@0.3.2) (2023-06-02)
|
|
31
7
|
|
|
32
8
|
**Note:** Version bump only for package @agoric/cache
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/cache",
|
|
3
|
-
"version": "0.3.3-
|
|
3
|
+
"version": "0.3.3-orchestration-dev-096c4e8.0+096c4e8",
|
|
4
4
|
"description": "Agoric's simple cache interface",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/main.js",
|
|
@@ -12,23 +12,23 @@
|
|
|
12
12
|
"test:xs": "exit 0",
|
|
13
13
|
"lint-fix": "yarn lint:eslint --fix",
|
|
14
14
|
"lint": "run-s --continue-on-error lint:*",
|
|
15
|
-
"lint:types": "tsc
|
|
15
|
+
"lint:types": "tsc",
|
|
16
16
|
"lint:eslint": "eslint --ext .js,.ts ."
|
|
17
17
|
},
|
|
18
18
|
"keywords": [],
|
|
19
19
|
"author": "Agoric",
|
|
20
20
|
"license": "Apache-2.0",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@agoric/internal": "0.
|
|
23
|
-
"@agoric/notifier": "0.6.3-
|
|
24
|
-
"@agoric/store": "0.9.3-
|
|
25
|
-
"@agoric/vat-data": "0.5.3-
|
|
26
|
-
"@endo/far": "0.
|
|
27
|
-
"@endo/marshal": "
|
|
22
|
+
"@agoric/internal": "0.3.3-orchestration-dev-096c4e8.0+096c4e8",
|
|
23
|
+
"@agoric/notifier": "0.6.3-orchestration-dev-096c4e8.0+096c4e8",
|
|
24
|
+
"@agoric/store": "0.9.3-orchestration-dev-096c4e8.0+096c4e8",
|
|
25
|
+
"@agoric/vat-data": "0.5.3-orchestration-dev-096c4e8.0+096c4e8",
|
|
26
|
+
"@endo/far": "^1.0.4",
|
|
27
|
+
"@endo/marshal": "^1.3.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@agoric/zoe": "0.26.3-
|
|
31
|
-
"ava": "^5.
|
|
30
|
+
"@agoric/zoe": "0.26.3-orchestration-dev-096c4e8.0+096c4e8",
|
|
31
|
+
"ava": "^5.3.0",
|
|
32
32
|
"c8": "^7.13.0"
|
|
33
33
|
},
|
|
34
34
|
"publishConfig": {
|
|
@@ -41,7 +41,13 @@
|
|
|
41
41
|
"files": [
|
|
42
42
|
"test/**/test-*.js"
|
|
43
43
|
],
|
|
44
|
+
"require": [
|
|
45
|
+
"@endo/init/debug.js"
|
|
46
|
+
],
|
|
44
47
|
"timeout": "20m"
|
|
45
48
|
},
|
|
46
|
-
"
|
|
49
|
+
"typeCoverage": {
|
|
50
|
+
"atLeast": 86.81
|
|
51
|
+
},
|
|
52
|
+
"gitHead": "096c4e8fce80e9a509b0e1a30fda11736c4570e1"
|
|
47
53
|
}
|
package/src/cache.js
CHANGED
|
@@ -12,7 +12,7 @@ import { makeScalarStoreCoordinator } from './store.js';
|
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* @param {ERef<import('./types').Coordinator>} [coordinator]
|
|
15
|
+
* @param {ERef<import('./types.js').Coordinator>} [coordinator]
|
|
16
16
|
*/
|
|
17
17
|
export const makeCache = (coordinator = makeScalarStoreCoordinator()) => {
|
|
18
18
|
/**
|
package/src/state.js
CHANGED
|
@@ -30,7 +30,7 @@ export const makeState = (value, priorState = GROUND_STATE) =>
|
|
|
30
30
|
/**
|
|
31
31
|
* Wrap a state store to have a default value using the GROUND_STATE
|
|
32
32
|
*
|
|
33
|
-
* @param {MapStore<string, import('./state').State>} stateStore
|
|
33
|
+
* @param {MapStore<string, import('./state.js').State>} stateStore
|
|
34
34
|
*/
|
|
35
35
|
export const withGroundState = stateStore => ({
|
|
36
36
|
...stateStore,
|
package/src/store.js
CHANGED
|
@@ -5,8 +5,6 @@ import { makeScalarBigMapStore } from '@agoric/vat-data';
|
|
|
5
5
|
import { untilTrue } from '@agoric/internal';
|
|
6
6
|
import { withGroundState, makeState } from './state.js';
|
|
7
7
|
|
|
8
|
-
import './types.js';
|
|
9
|
-
|
|
10
8
|
/**
|
|
11
9
|
* @param {(obj: unknown) => unknown} [sanitize]
|
|
12
10
|
* @returns {(key: Passable) => Promise<string>}
|
|
@@ -42,9 +40,9 @@ const makeKeyToString = (sanitize = obj => obj) => {
|
|
|
42
40
|
* @param {(obj: unknown) => unknown} sanitize Process keys and values with
|
|
43
41
|
* this function before storing them
|
|
44
42
|
* @param {{
|
|
45
|
-
* get(key: string): import('./state').State;
|
|
46
|
-
* set(key: string, value: import('./state').State): void;
|
|
47
|
-
* init(key: string, value: import('./state').State): void;
|
|
43
|
+
* get(key: string): import('./state.js').State;
|
|
44
|
+
* set(key: string, value: import('./state.js').State): void;
|
|
45
|
+
* init(key: string, value: import('./state.js').State): void;
|
|
48
46
|
* }} stateStore
|
|
49
47
|
* @returns {Promise<unknown>} the value of the updated state
|
|
50
48
|
*/
|
|
@@ -58,8 +56,8 @@ const applyCacheTransaction = async (
|
|
|
58
56
|
/**
|
|
59
57
|
* Retrieve a potential updated state from the transaction.
|
|
60
58
|
*
|
|
61
|
-
* @param {import('./state').State} basisState
|
|
62
|
-
* @returns {Promise<import('./state').State | null>} the updated state, or null if no longer applicable
|
|
59
|
+
* @param {import('./state.js').State} basisState
|
|
60
|
+
* @returns {Promise<import('./state.js').State | null>} the updated state, or null if no longer applicable
|
|
63
61
|
*/
|
|
64
62
|
const getUpdatedState = async basisState => {
|
|
65
63
|
const { value } = basisState;
|
|
@@ -108,7 +106,7 @@ const applyCacheTransaction = async (
|
|
|
108
106
|
};
|
|
109
107
|
|
|
110
108
|
/**
|
|
111
|
-
* @param {MapStore<string, import('./state').State>} stateStore
|
|
109
|
+
* @param {MapStore<string, import('./state.js').State>} stateStore
|
|
112
110
|
* @param {ERef<Marshaller>} marshaller
|
|
113
111
|
* @returns {Promise<string>}
|
|
114
112
|
*/
|
|
@@ -126,7 +124,7 @@ const stringifyStateStore = async (stateStore, marshaller) => {
|
|
|
126
124
|
* Make a cache coordinator backed by a MapStore. This coordinator doesn't
|
|
127
125
|
* currently enforce any cache eviction, but that would be a useful feature.
|
|
128
126
|
*
|
|
129
|
-
* @param {MapStore<string, import('./state').State>} [stateStore]
|
|
127
|
+
* @param {MapStore<string, import('./state.js').State>} [stateStore]
|
|
130
128
|
* @param {(obj: unknown) => unknown} [sanitize] Process keys and values with
|
|
131
129
|
* this function before storing them. Defaults to deeplyFulfilled.
|
|
132
130
|
*/
|
|
@@ -138,7 +136,7 @@ export const makeScalarStoreCoordinator = (
|
|
|
138
136
|
|
|
139
137
|
const defaultStateStore = withGroundState(stateStore);
|
|
140
138
|
|
|
141
|
-
/** @type {import('./types').Coordinator} */
|
|
139
|
+
/** @type {import('./types.js').Coordinator} */
|
|
142
140
|
const coord = Far('store cache coordinator', {
|
|
143
141
|
getRecentValue: async key => {
|
|
144
142
|
const keyStr = await serializePassable(key);
|
|
@@ -171,7 +169,7 @@ export const makeScalarStoreCoordinator = (
|
|
|
171
169
|
/**
|
|
172
170
|
* Don't write any marshalled value that's older than what's already pushed
|
|
173
171
|
*
|
|
174
|
-
* @param {MapStore<string, import('./state').State>} stateStore
|
|
172
|
+
* @param {MapStore<string, import('./state.js').State>} stateStore
|
|
175
173
|
* @param {ERef<Marshaller>} marshaller
|
|
176
174
|
* @param {ERef<StorageNode>} storageNode
|
|
177
175
|
* @returns {<T>(storedValue: T) => Promise<T>}
|
|
@@ -218,7 +216,7 @@ export const makeChainStorageCoordinator = (storageNode, marshaller) => {
|
|
|
218
216
|
storageNode,
|
|
219
217
|
);
|
|
220
218
|
|
|
221
|
-
/** @type {import('./types').Coordinator} */
|
|
219
|
+
/** @type {import('./types.js').Coordinator} */
|
|
222
220
|
const coord = Far('store cache coordinator', {
|
|
223
221
|
getRecentValue: async key => {
|
|
224
222
|
const keyStr = await serializePassable(key);
|
package/test/test-storage.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
// Must be first to set up globals
|
|
2
|
-
|
|
3
|
-
// eslint-disable-next-line import/no-extraneous-dependencies -- XXX
|
|
4
|
-
import '@agoric/swingset-vat/tools/prepare-test-env.js';
|
|
2
|
+
import '@agoric/zoe/tools/prepare-test-env.js';
|
|
5
3
|
|
|
6
4
|
import test from 'ava';
|
|
7
5
|
import { makeChainStorageRoot } from '@agoric/internal/src/lib-chainStorage.js';
|