@agoric/internal 0.3.3-other-dev-d15096d.0.d15096d → 0.3.3-other-dev-ecf44df.0.ecf44df
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 +32 -36
- package/src/action-types.d.ts +47 -20
- package/src/action-types.d.ts.map +1 -1
- package/src/action-types.js +21 -21
- package/src/ava-force-exit.d.mts +2 -0
- package/src/ava-force-exit.d.mts.map +1 -0
- package/src/ava-force-exit.mjs +7 -0
- package/src/batched-deliver.d.ts +2 -2
- package/src/batched-deliver.d.ts.map +1 -1
- package/src/batched-deliver.js +2 -3
- package/src/build-cache-types.d.ts +33 -0
- package/src/build-cache-types.d.ts.map +1 -0
- package/src/build-cache-types.js +42 -0
- package/src/build-cache.d.ts +12 -0
- package/src/build-cache.d.ts.map +1 -0
- package/src/build-cache.js +184 -0
- package/src/callback.d.ts +1 -1
- package/src/callback.d.ts.map +1 -1
- package/src/callback.js +1 -0
- package/src/chain-storage-paths.d.ts.map +1 -1
- package/src/chain-storage-paths.js +0 -2
- package/src/config.d.ts +3 -3
- package/src/config.d.ts.map +1 -1
- package/src/config.js +6 -5
- package/src/debug.d.ts +2 -2
- package/src/debug.d.ts.map +1 -1
- package/src/debug.js +19 -5
- package/src/hex.d.ts.map +1 -1
- package/src/hex.js +18 -22
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -2
- package/src/js-utils.d.ts +17 -2
- package/src/js-utils.d.ts.map +1 -1
- package/src/js-utils.js +49 -3
- package/src/keyMirror.d.ts +3 -0
- package/src/keyMirror.d.ts.map +1 -0
- package/src/keyMirror.js +45 -0
- package/src/kv-store.d.ts +33 -0
- package/src/kv-store.d.ts.map +1 -0
- package/src/kv-store.js +265 -0
- package/src/lib-chainStorage.d.ts +25 -42
- package/src/lib-chainStorage.d.ts.map +1 -1
- package/src/lib-chainStorage.js +38 -14
- package/src/lib-nodejs/ava-unhandled-rejection.d.ts +18 -3
- package/src/lib-nodejs/ava-unhandled-rejection.d.ts.map +1 -1
- package/src/lib-nodejs/ava-unhandled-rejection.js +217 -20
- package/src/lib-nodejs/engine-gc.js +2 -2
- package/src/lib-nodejs/gc-and-finalize.d.ts +2 -1
- package/src/lib-nodejs/gc-and-finalize.d.ts.map +1 -1
- package/src/lib-nodejs/gc-and-finalize.js +1 -0
- package/src/lib-nodejs/spawnSubprocessWorker.d.ts +11 -4
- package/src/lib-nodejs/spawnSubprocessWorker.d.ts.map +1 -1
- package/src/lib-nodejs/spawnSubprocessWorker.js +14 -4
- package/src/lib-nodejs/worker-protocol.d.ts +1 -1
- package/src/lib-nodejs/worker-protocol.d.ts.map +1 -1
- package/src/lib-nodejs/worker-protocol.js +5 -6
- package/src/magic-cookie-test-only.d.ts.map +1 -1
- package/src/magic-cookie-test-only.js +0 -2
- package/src/marshal/board-client-utils.d.ts.map +1 -1
- package/src/marshal/board-client-utils.js +4 -1
- package/src/marshal/cap-data.d.ts +9 -1
- package/src/marshal/cap-data.d.ts.map +1 -1
- package/src/marshal/cap-data.js +1 -2
- package/src/marshal/wrap-marshaller.d.ts +34 -7
- package/src/marshal/wrap-marshaller.d.ts.map +1 -1
- package/src/marshal/wrap-marshaller.js +64 -68
- package/src/metrics.d.ts +1 -4
- package/src/metrics.d.ts.map +1 -1
- package/src/metrics.js +7 -2
- package/src/module-utils.d.ts +1 -0
- package/src/module-utils.d.ts.map +1 -1
- package/src/module-utils.js +17 -0
- package/src/natural-sort.d.ts.map +1 -1
- package/src/natural-sort.js +7 -3
- package/src/netstring.d.ts +1 -1
- package/src/netstring.d.ts.map +1 -1
- package/src/netstring.js +5 -6
- package/src/node/buffer-line-transform.d.ts.map +1 -1
- package/src/node/buffer-line-transform.js +0 -1
- package/src/node/createBundles.d.ts +7 -3
- package/src/node/createBundles.d.ts.map +1 -1
- package/src/node/createBundles.js +31 -10
- package/src/node/fs-stream.d.ts +8 -5
- package/src/node/fs-stream.d.ts.map +1 -1
- package/src/node/fs-stream.js +120 -8
- package/src/node/read-json.d.ts +2 -0
- package/src/node/read-json.d.ts.map +1 -0
- package/src/node/read-json.js +16 -0
- package/src/node/shutdown.d.ts +6 -2
- package/src/node/shutdown.d.ts.map +1 -1
- package/src/node/shutdown.js +9 -3
- package/src/priority-senders.d.ts.map +1 -1
- package/src/priority-senders.js +1 -0
- package/src/queue.d.ts.map +1 -1
- package/src/queue.js +10 -2
- package/src/scratch.d.ts +32 -10
- package/src/scratch.d.ts.map +1 -1
- package/src/scratch.js +11 -0
- package/src/ses-utils.d.ts +14 -3
- package/src/ses-utils.d.ts.map +1 -1
- package/src/ses-utils.js +13 -15
- package/src/storage-test-utils.d.ts +4 -11
- package/src/storage-test-utils.d.ts.map +1 -1
- package/src/storage-test-utils.js +16 -14
- package/src/tagged.d.ts +18 -1
- package/src/testing-utils.d.ts +22 -1
- package/src/testing-utils.d.ts.map +1 -1
- package/src/testing-utils.js +131 -6
- package/src/tmpDir.d.ts.map +1 -1
- package/src/tmpDir.js +1 -1
- package/src/typeCheck.d.ts +4 -8
- package/src/typeCheck.d.ts.map +1 -1
- package/src/typeCheck.js +13 -6
- package/src/typeGuards.d.ts +5 -5
- package/src/typeGuards.d.ts.map +1 -1
- package/src/typeGuards.js +4 -5
- package/src/types-index.d.ts +1 -0
- package/src/types.d.ts +41 -14
- package/src/types.d.ts.map +1 -1
- package/src/types.js +161 -0
- package/src/upgrade-api.d.ts +2 -2
- package/src/upgrade-api.d.ts.map +1 -1
- package/src/upgrade-api.js +4 -3
- package/src/work-pool.d.ts.map +1 -1
- package/src/work-pool.js +9 -2
- package/vendor/anylogger.d.ts +98 -0
- package/vendor/anylogger.d.ts.map +1 -0
- package/vendor/anylogger.js +60 -0
- package/vendor/anylogger.ts +160 -0
- package/vendor/tsconfig.anylogger.json +15 -0
- package/exported.js +0 -2
- package/src/types.ts +0 -133
package/src/tagged.d.ts
CHANGED
|
@@ -3,7 +3,24 @@
|
|
|
3
3
|
// different name to avoid confusion with pass-style "tagged"
|
|
4
4
|
export { Tagged as TypeTag };
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* CAVEAT: We use a constant string here to avoid exposing a `unique symbol`
|
|
8
|
+
* type publicly, such as with:
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* declare const mySymbol: unique symbol;
|
|
12
|
+
*
|
|
13
|
+
* Without this workaround, we've observed errors when using at least
|
|
14
|
+
* `typescript@5.9.3`'s `tsc` to generate declaration files (.d.ts) for
|
|
15
|
+
* consumers of modules that in turn import the declaration:
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* error TS9006: Declaration emit for this file requires using private name
|
|
19
|
+
* 'tag' from module '.../internal/src/tagged"'. An explicit
|
|
20
|
+
* type annotation may unblock declaration emit.
|
|
21
|
+
*/
|
|
22
|
+
// declare const tag: unique symbol;
|
|
23
|
+
declare const tag: 'Symbol(tag)';
|
|
7
24
|
|
|
8
25
|
export type TagContainer<Token> = {
|
|
9
26
|
readonly [tag]: Token;
|
package/src/testing-utils.d.ts
CHANGED
|
@@ -1,4 +1,25 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @import {MapStore} from '@agoric/store';
|
|
3
|
+
* @import {ExecutionContext as AvaT} from 'ava';
|
|
4
|
+
* @import {ERef} from '@endo/eventual-send';
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* A workaround for some issues with fake time in tests.
|
|
8
|
+
*
|
|
9
|
+
* Lines of test code can depend on async promises outside the test resolving
|
|
10
|
+
* before they run. Awaiting this function result ensures that all promises that
|
|
11
|
+
* can do resolve. Note that this doesn't mean all outstanding promises.
|
|
12
|
+
*
|
|
13
|
+
* @type {() => Promise<void>}
|
|
14
|
+
*/
|
|
15
|
+
export const eventLoopIteration: () => Promise<void>;
|
|
2
16
|
export function inspectMapStore(store: MapStore): object;
|
|
17
|
+
export function testInterruptedSteps<Input = any, Context = unknown>(t: AvaT<Context>, allSteps: readonly TestStep<Input>[], doInterrupt?: (t: AvaT<Context>) => ERef<void>, { setup, postcondition }?: {
|
|
18
|
+
setup?: ((t: AvaT<Context>) => Partial<Input> | PromiseLike<Partial<Input>>) | undefined;
|
|
19
|
+
postcondition?: ((t: AvaT<Context>, accum: Partial<Input>, label: string) => ERef<void>) | undefined;
|
|
20
|
+
}): Promise<void>;
|
|
21
|
+
export type TestStep<Input = any> = readonly [stepName: string, fn: (input: Partial<Input>, label: string) => Partial<Input> | PromiseLike<Partial<Input>>];
|
|
3
22
|
import type { MapStore } from '@agoric/store';
|
|
23
|
+
import type { ExecutionContext as AvaT } from 'ava';
|
|
24
|
+
import type { ERef } from '@endo/eventual-send';
|
|
4
25
|
//# sourceMappingURL=testing-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing-utils.d.ts","sourceRoot":"","sources":["testing-utils.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"testing-utils.d.ts","sourceRoot":"","sources":["testing-utils.js"],"names":[],"mappings":"AACA;;;;GAIG;AAEH;;;;;;;;GAQG;AACH,iCAFU,MAAM,OAAO,CAAC,IAAI,CAAC,CAGmB;AAgBzC,uCAHI,QAAQ,GACN,MAAM,CAsBlB;AAwCM,qCAjBO,KAAK,QACL,OAAO,eACV,KAAK,OAAO,CAAC,YACb,SAAS,QAAQ,CAAC,KAAK,CAAC,EAAE,gBAC1B,CAAC,CAAC,EAAE,KAAK,OAAO,CAAC,KAAK,KAAK,IAAI,CAAC,6BAExC;IAAqF,KAAK,QAA9E,KAAK,OAAO,CAAC,KAAK,OAAO,CAAC,KAAK,CAAC,GAAG,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAMe,aAAa,QAA1F,KAAK,OAAO,CAAC,SAAS,OAAO,CAAC,KAAK,CAAC,SAAS,MAAM,KAAK,KAAK,IAAI,CAAC;CAIhF,iBAoFA;qBAvHa,KAAK,UACN,SAAS,CACjB,QAAQ,EAAE,MAAM,EAChB,EAAE,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,KAAK,CAAC,GAAG,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAC3F;8BA3DuB,eAAe;8CACC,KAAK;0BACzB,qBAAqB"}
|
package/src/testing-utils.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/* global setImmediate */
|
|
2
2
|
/**
|
|
3
|
-
* @
|
|
4
|
-
*
|
|
3
|
+
* @import {MapStore} from '@agoric/store';
|
|
4
|
+
* @import {ExecutionContext as AvaT} from 'ava';
|
|
5
|
+
* @import {ERef} from '@endo/eventual-send';
|
|
5
6
|
*/
|
|
6
|
-
/* global setImmediate */
|
|
7
|
-
/** @import {MapStore} from '@agoric/store'; */
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* A workaround for some issues with fake time in tests.
|
|
@@ -12,6 +11,8 @@
|
|
|
12
11
|
* Lines of test code can depend on async promises outside the test resolving
|
|
13
12
|
* before they run. Awaiting this function result ensures that all promises that
|
|
14
13
|
* can do resolve. Note that this doesn't mean all outstanding promises.
|
|
14
|
+
*
|
|
15
|
+
* @type {() => Promise<void>}
|
|
15
16
|
*/
|
|
16
17
|
export const eventLoopIteration = async () =>
|
|
17
18
|
new Promise(resolve => setImmediate(resolve));
|
|
@@ -35,7 +36,8 @@ export const inspectMapStore = store => {
|
|
|
35
36
|
const obj = {};
|
|
36
37
|
for (const key of store.keys()) {
|
|
37
38
|
const value = store.get(key);
|
|
38
|
-
const hasKeys =
|
|
39
|
+
const hasKeys =
|
|
40
|
+
typeof value === 'object' && value != null && 'keys' in value;
|
|
39
41
|
const index = stringOrTag(key);
|
|
40
42
|
if (hasKeys && 'get' in value) {
|
|
41
43
|
obj[index] = inspectMapStore(value);
|
|
@@ -51,3 +53,126 @@ export const inspectMapStore = store => {
|
|
|
51
53
|
return obj;
|
|
52
54
|
};
|
|
53
55
|
harden(inspectMapStore);
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @template [Input=any]
|
|
59
|
+
* @typedef {readonly [
|
|
60
|
+
* stepName: string,
|
|
61
|
+
* fn: (input: Partial<Input>, label: string) => Partial<Input> | PromiseLike<Partial<Input>>,
|
|
62
|
+
* ]} TestStep
|
|
63
|
+
*/
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* For each step, run to just before that point and pause for continuation after
|
|
67
|
+
* interrupt.
|
|
68
|
+
*
|
|
69
|
+
* `allSteps` should contain only steps that are meaningful interruption
|
|
70
|
+
* boundaries — i.e. that leave durable in-flight state whose recovery across an
|
|
71
|
+
* interrupt is worth asserting. Each step in `allSteps` runs `allSteps.length +
|
|
72
|
+
* 2` times, so the total work is quadratic in the number of steps; keep the
|
|
73
|
+
* list to the genuinely mutating steps. Use `options.setup` for non-mutating
|
|
74
|
+
* fixtures and `options.postcondition` for non-mutating outcome assertions so
|
|
75
|
+
* they don't inflate the boundary count.
|
|
76
|
+
*
|
|
77
|
+
* @template [Input=any]
|
|
78
|
+
* @template [Context=unknown]
|
|
79
|
+
* @param {AvaT<Context>} t
|
|
80
|
+
* @param {readonly TestStep<Input>[]} allSteps
|
|
81
|
+
* @param {(t: AvaT<Context>) => ERef<void>} [doInterrupt]
|
|
82
|
+
* @param {object} [options]
|
|
83
|
+
* @param {(t: AvaT<Context>) => Partial<Input> | PromiseLike<Partial<Input>>} [options.setup]
|
|
84
|
+
* Produce the initial accumulator at the start of each run. Runs are never
|
|
85
|
+
* interrupted around setup, so use it for fixtures (e.g. funding a wallet)
|
|
86
|
+
* that are not themselves part of the interruption-resilience contract. It is
|
|
87
|
+
* invoked once per run, so it may create per-run state (e.g. a single-use
|
|
88
|
+
* actor) safely.
|
|
89
|
+
* @param {(t: AvaT<Context>, accum: Partial<Input>, label: string) => ERef<void>} [options.postcondition]
|
|
90
|
+
* Assert the outcome after each run that completes all of its steps (the
|
|
91
|
+
* pre-interrupt run, the post-interrupt run, and each resumed run). Use for
|
|
92
|
+
* non-mutating outcome checks that need not be interruption boundaries.
|
|
93
|
+
*/
|
|
94
|
+
export const testInterruptedSteps = async (
|
|
95
|
+
t,
|
|
96
|
+
allSteps,
|
|
97
|
+
doInterrupt,
|
|
98
|
+
{ setup, postcondition } = {},
|
|
99
|
+
) => {
|
|
100
|
+
/**
|
|
101
|
+
* @typedef {{
|
|
102
|
+
* label: string;
|
|
103
|
+
* accum: Partial<Input>;
|
|
104
|
+
* }} RunState
|
|
105
|
+
*/
|
|
106
|
+
|
|
107
|
+
/** @returns {Promise<Partial<Input>>} */
|
|
108
|
+
const freshAccum = async () => (setup ? setup(t) : {});
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* @param {string} label
|
|
112
|
+
* @param {readonly TestStep<Input>[]} steps
|
|
113
|
+
* @param {RunState} [runState] when omitted, a fresh run is started, seeding
|
|
114
|
+
* the accumulator from `setup`.
|
|
115
|
+
* @returns {Promise<RunState>}
|
|
116
|
+
*/
|
|
117
|
+
const runSteps = async (label, steps, runState) => {
|
|
118
|
+
await null;
|
|
119
|
+
let accum = runState ? runState.accum : await freshAccum();
|
|
120
|
+
const runLabel = runState ? runState.label : label;
|
|
121
|
+
for (const [stepName, fn] of steps) {
|
|
122
|
+
await t.notThrowsAsync(async () => {
|
|
123
|
+
accum = await fn(accum, runLabel);
|
|
124
|
+
}, `${label} ${stepName} must complete successfully`);
|
|
125
|
+
}
|
|
126
|
+
return { label: runLabel, accum };
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* @param {RunState} runState
|
|
131
|
+
* @returns {Promise<RunState>}
|
|
132
|
+
*/
|
|
133
|
+
const complete = async runState => {
|
|
134
|
+
await null;
|
|
135
|
+
if (postcondition) {
|
|
136
|
+
await postcondition(t, runState.accum, runState.label);
|
|
137
|
+
}
|
|
138
|
+
return runState;
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
// Sanity check
|
|
142
|
+
await complete(await runSteps('pre-interrupt', allSteps));
|
|
143
|
+
if (!doInterrupt) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* @type {{
|
|
149
|
+
* runState: RunState;
|
|
150
|
+
* remainingSteps: readonly TestStep<Input>[];
|
|
151
|
+
* }[]}
|
|
152
|
+
*/
|
|
153
|
+
const pausedRuns = [];
|
|
154
|
+
for (let i = 0; i < allSteps.length; i += 1) {
|
|
155
|
+
const [beforeStepName] = allSteps[i];
|
|
156
|
+
const runState = await runSteps(
|
|
157
|
+
`pre-${beforeStepName}`,
|
|
158
|
+
allSteps.slice(0, i),
|
|
159
|
+
{ label: `pause-before-${beforeStepName}`, accum: await freshAccum() },
|
|
160
|
+
);
|
|
161
|
+
pausedRuns.push({ runState, remainingSteps: allSteps.slice(i) });
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// Run the user code that interrupts the steps.
|
|
165
|
+
await doInterrupt(t);
|
|
166
|
+
|
|
167
|
+
// Verify a complete run post-interrupt.
|
|
168
|
+
await complete(await runSteps('post-interrupt', allSteps));
|
|
169
|
+
|
|
170
|
+
// Verify completion of each paused step.
|
|
171
|
+
for (const { runState, remainingSteps } of pausedRuns) {
|
|
172
|
+
const [beforeStepName] = remainingSteps[0];
|
|
173
|
+
await complete(
|
|
174
|
+
await runSteps(`resumed-${beforeStepName}`, remainingSteps, runState),
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
harden(testInterruptedSteps);
|
package/src/tmpDir.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tmpDir.d.ts","sourceRoot":"","sources":["tmpDir.js"],"names":[],"mappings":"AAMO,wCAFI,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"tmpDir.d.ts","sourceRoot":"","sources":["tmpDir.js"],"names":[],"mappings":"AAMO,wCAFI,IAAI,CAAC,cAAc,KAAK,CAAC,EAAE,SAAS,CAAC,aAGzB,MAAM,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,CASvE"}
|
package/src/tmpDir.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Create a `tmpDir` function that synchronously creates a temporary directory
|
|
3
3
|
* and a function for deleting it along with any added contents.
|
|
4
4
|
*
|
|
5
|
-
* @param {Pick<import('tmp'), 'dirSync'>} tmp
|
|
5
|
+
* @param {Pick<typeof import('tmp'), 'dirSync'>} tmp
|
|
6
6
|
*/
|
|
7
7
|
export const makeTempDirFactory = tmp => {
|
|
8
8
|
/** @type {(prefix?: string) => [dirName: string, cleanup: () => void]} */
|
package/src/typeCheck.d.ts
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export const mustMatch: MustMatch;
|
|
6
|
-
export function cast<M>(specimen: unknown, patt: TypedPattern<M>): M;
|
|
7
|
-
import type { MustMatch } from './types.js';
|
|
8
|
-
import type { TypedPattern } from './types.js';
|
|
1
|
+
export { mustMatch };
|
|
2
|
+
export function cast<M>(specimen: unknown, patt: CastedPattern<M>): M;
|
|
3
|
+
import { mustMatch } from '@endo/patterns';
|
|
4
|
+
import type { CastedPattern } from '@endo/patterns';
|
|
9
5
|
//# sourceMappingURL=typeCheck.d.ts.map
|
package/src/typeCheck.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeCheck.d.ts","sourceRoot":"","sources":["typeCheck.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"typeCheck.d.ts","sourceRoot":"","sources":["typeCheck.js"],"names":[],"mappings":";AAqBO,qBALM,CAAC,YACH,OAAO,QACP,cAAc,CAAC,CAAC,GACd,CAAC,CAUb;0BA5ByB,gBAAgB;mCAGV,gBAAgB"}
|
package/src/typeCheck.js
CHANGED
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
// @ts-check
|
|
2
|
-
import { mustMatch
|
|
2
|
+
import { mustMatch } from '@endo/patterns';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* @import {
|
|
5
|
+
* @import {CastedPattern} from '@endo/patterns';
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
/**
|
|
9
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Re-exported from `@endo/patterns`, which now narrows `specimen` to the
|
|
10
|
+
* pattern's type. Prefer importing `mustMatch` from `@endo/patterns` directly.
|
|
11
|
+
*
|
|
12
|
+
* @deprecated import from `@endo/patterns` instead
|
|
13
|
+
*/
|
|
14
|
+
export { mustMatch };
|
|
10
15
|
|
|
11
16
|
/**
|
|
12
17
|
* @template M
|
|
13
18
|
* @param {unknown} specimen
|
|
14
|
-
* @param {
|
|
19
|
+
* @param {CastedPattern<M>} patt
|
|
15
20
|
* @returns {M}
|
|
16
21
|
*/
|
|
17
22
|
export const cast = (specimen, patt) => {
|
|
@@ -19,5 +24,7 @@ export const cast = (specimen, patt) => {
|
|
|
19
24
|
// type but a function can't both narrow and return a type. That is by design:
|
|
20
25
|
// https://github.com/microsoft/TypeScript/issues/34636#issuecomment-545025916
|
|
21
26
|
mustMatch(specimen, patt);
|
|
22
|
-
|
|
27
|
+
// The assertion narrows `specimen`, but inside this generic body TS keeps an
|
|
28
|
+
// `unknown extends M` conditional that doesn't collapse to `M`, so re-assert.
|
|
29
|
+
return /** @type {M} */ (specimen);
|
|
23
30
|
};
|
package/src/typeGuards.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @import {
|
|
2
|
+
* @import {CastedPattern} from '@endo/patterns';
|
|
3
3
|
*/
|
|
4
|
-
export const StorageNodeShape: import("@endo/patterns").
|
|
4
|
+
export const StorageNodeShape: import("@endo/patterns").MatcherOf<"remotable", any>;
|
|
5
5
|
/** To be used only for 'helper' facets where the calls are from trusted code. */
|
|
6
6
|
export const UnguardedHelperI: import("@endo/patterns").InterfaceGuard<any>;
|
|
7
7
|
/**
|
|
@@ -10,14 +10,14 @@ export const UnguardedHelperI: import("@endo/patterns").InterfaceGuard<any>;
|
|
|
10
10
|
* either a JS number or a stringified JS bigint.
|
|
11
11
|
*/
|
|
12
12
|
/**
|
|
13
|
-
* @type {
|
|
13
|
+
* @type {CastedPattern<BridgeBigInt>}
|
|
14
14
|
*/
|
|
15
|
-
export const BridgeBigIntShape:
|
|
15
|
+
export const BridgeBigIntShape: CastedPattern<BridgeBigInt>;
|
|
16
16
|
/**
|
|
17
17
|
* Ensure that callees passed a
|
|
18
18
|
* bridge message that was serialised from a Golang int64 or uint64 accept
|
|
19
19
|
* either a JS number or a stringified JS bigint.
|
|
20
20
|
*/
|
|
21
21
|
export type BridgeBigInt = number | `${bigint}`;
|
|
22
|
-
import type {
|
|
22
|
+
import type { CastedPattern } from '@endo/patterns';
|
|
23
23
|
//# sourceMappingURL=typeGuards.d.ts.map
|
package/src/typeGuards.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeGuards.d.ts","sourceRoot":"","sources":["typeGuards.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"typeGuards.d.ts","sourceRoot":"","sources":["typeGuards.js"],"names":[],"mappings":"AAIA;;GAEG;AAEH,oFAA2D;AAE3D,iFAAiF;AACjF,4EAKE;AAEF;;;;GAIG;AAEH;;GAEG;AACH,gCAFU,cAAc,YAAY,CAAC,CAEyB;;;;;;2BARjD,MAAM,GAAG,GAAG,MAAM,EAAE;mCAdD,gBAAgB"}
|
package/src/typeGuards.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
// @jessie-check
|
|
2
1
|
// @ts-check
|
|
3
2
|
|
|
4
3
|
import { M } from '@endo/patterns';
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
|
-
* @import {
|
|
6
|
+
* @import {CastedPattern} from '@endo/patterns';
|
|
8
7
|
*/
|
|
9
8
|
|
|
10
9
|
export const StorageNodeShape = M.remotable('StorageNode');
|
|
@@ -13,8 +12,8 @@ export const StorageNodeShape = M.remotable('StorageNode');
|
|
|
13
12
|
export const UnguardedHelperI = M.interface(
|
|
14
13
|
'helper',
|
|
15
14
|
{},
|
|
16
|
-
// not exposed so
|
|
17
|
-
{
|
|
15
|
+
// not exposed so using `defaultGuards` is fine.
|
|
16
|
+
{ defaultGuards: 'passable' },
|
|
18
17
|
);
|
|
19
18
|
|
|
20
19
|
/**
|
|
@@ -24,6 +23,6 @@ export const UnguardedHelperI = M.interface(
|
|
|
24
23
|
*/
|
|
25
24
|
|
|
26
25
|
/**
|
|
27
|
-
* @type {
|
|
26
|
+
* @type {CastedPattern<BridgeBigInt>}
|
|
28
27
|
*/
|
|
29
28
|
export const BridgeBigIntShape = M.or(M.number(), M.string());
|
package/src/types-index.d.ts
CHANGED
package/src/types.d.ts
CHANGED
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
import type { ERef, RemotableBrand } from '@endo/eventual-send';
|
|
2
|
-
import type { Primitive } from '@endo/pass-style';
|
|
3
|
-
import type {
|
|
2
|
+
import type { Primitive, RemotableObject } from '@endo/pass-style';
|
|
3
|
+
import type { CastedPattern } from '@endo/patterns';
|
|
4
4
|
import type { Callable } from './ses-utils.js';
|
|
5
|
+
import type { VStorageKey } from './lib-chainStorage.js';
|
|
6
|
+
export type AnyIterable<T, TReturn = any, TNext = any> = Iterable<T, TReturn, TNext> | AsyncIterable<T, TReturn, TNext>;
|
|
7
|
+
/**
|
|
8
|
+
* A mapping of a tuple type (as from `Parameters<...>`) into a corresponding
|
|
9
|
+
* object type with named fields.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```
|
|
13
|
+
* RecordFromTuple<[string, bigint], ['denom', 'amount']>
|
|
14
|
+
* //=> { denom: string, amount: bigint }
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export type RecordFromTuple<Types extends readonly unknown[], Names extends Record<Exclude<keyof Types, keyof unknown[]>, string>> = {
|
|
18
|
+
[K in Exclude<keyof Types, keyof any[]> as Names[K]]: Types[K];
|
|
19
|
+
};
|
|
5
20
|
/**
|
|
6
21
|
* A map corresponding with a total function such that `get(key)` is assumed to
|
|
7
22
|
* always succeed.
|
|
@@ -50,6 +65,7 @@ export declare class SyncCallback<I extends (...args: unknown[]) => any> extends
|
|
|
50
65
|
* //=> false
|
|
51
66
|
*/
|
|
52
67
|
export type IsPrimitive<T> = [T] extends [Primitive] ? true : false;
|
|
68
|
+
export type IsRemotable<T> = T extends RemotableObject ? true : T extends RemotableBrand<any, any> ? true : false;
|
|
53
69
|
/** Recursively extract the non-callable properties of T */
|
|
54
70
|
export type DataOnly<T> = IsPrimitive<T> extends true ? T : T extends Callable ? never : {
|
|
55
71
|
[P in keyof T as T[P] extends Callable ? never : P]: DataOnly<T[P]>;
|
|
@@ -65,22 +81,33 @@ export type Remote<Primary, Local = DataOnly<Primary>> = Primary | RemotableBran
|
|
|
65
81
|
* near or marshalled. @see {ERef} and @see {Remote}.
|
|
66
82
|
*/
|
|
67
83
|
export type ERemote<Primary, Local = DataOnly<Primary>> = ERef<Remote<Primary, Local>>;
|
|
68
|
-
declare const validatedType: unique symbol;
|
|
69
84
|
/**
|
|
70
|
-
* Tag a pattern with the static type it represents.
|
|
85
|
+
* Tag a pattern with the static type it represents. Endo's `mustMatch` and
|
|
86
|
+
* `matches` narrow a specimen to this type.
|
|
87
|
+
*
|
|
88
|
+
* @deprecated Use {@link CastedPattern} from `@endo/patterns` directly.
|
|
71
89
|
*/
|
|
72
|
-
export type TypedPattern<T> =
|
|
73
|
-
|
|
74
|
-
};
|
|
75
|
-
export declare type PatternType<TM extends TypedPattern<any>> = TM extends TypedPattern<infer T> ? T : never;
|
|
90
|
+
export type TypedPattern<T> = CastedPattern<T>;
|
|
91
|
+
export type { TraceLogger } from './debug.js';
|
|
76
92
|
/**
|
|
77
|
-
*
|
|
78
|
-
* throwing.
|
|
93
|
+
* This represents a node in an IAVL tree.
|
|
79
94
|
*
|
|
80
|
-
*
|
|
95
|
+
* The active implementation is x/vstorage, an Agoric extension of the Cosmos
|
|
96
|
+
* SDK.
|
|
81
97
|
*
|
|
82
|
-
*
|
|
98
|
+
* Vstorage is a hierarchical externally-reachable storage structure that
|
|
99
|
+
* identifies children by restricted ASCII name and is associated with arbitrary
|
|
100
|
+
* string-valued data for each node, defaulting to the empty string.
|
|
83
101
|
*/
|
|
84
|
-
export
|
|
85
|
-
|
|
102
|
+
export interface StorageNode extends RemotableObject {
|
|
103
|
+
/** publishes some data */
|
|
104
|
+
setValue: (data: string) => Promise<void>;
|
|
105
|
+
/** the chain storage path at which the node was constructed */
|
|
106
|
+
getPath: () => string;
|
|
107
|
+
/** @deprecated use getPath */
|
|
108
|
+
getStoreKey: () => Promise<VStorageKey>;
|
|
109
|
+
makeChildNode: (subPath: string, options?: {
|
|
110
|
+
sequence?: boolean;
|
|
111
|
+
}) => StorageNode;
|
|
112
|
+
}
|
|
86
113
|
//# sourceMappingURL=types.d.ts.map
|
package/src/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,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|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* A mapping of a tuple type (as from `Parameters<...>`) into a corresponding
|
|
15
|
+
* object type with named fields.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```
|
|
19
|
+
* RecordFromTuple<[string, bigint], ['denom', 'amount']>
|
|
20
|
+
* //=> { denom: string, amount: bigint }
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* A map corresponding with a total function such that `get(key)` is assumed to
|
|
30
|
+
* always succeed.
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* A permit is either `true` or a string (both meaning no attenuation, with a
|
|
41
|
+
* string serving as a grouping label for convenience and/or diagram
|
|
42
|
+
* generation), or an object whose keys identify child properties and whose
|
|
43
|
+
* corresponding values are theirselves (recursive) Permits.
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Returns a boolean for whether the given type is a primitive value or
|
|
82
|
+
* primitive type.
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```
|
|
86
|
+
* IsPrimitive<'string'>
|
|
87
|
+
* //=> true
|
|
88
|
+
*
|
|
89
|
+
* IsPrimitive<string>
|
|
90
|
+
* //=> true
|
|
91
|
+
*
|
|
92
|
+
* IsPrimitive<Object>
|
|
93
|
+
* //=> false
|
|
94
|
+
*/
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
// XXX https://github.com/endojs/endo/issues/2979
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
/** Recursively extract the non-callable properties of T */
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* A type that doesn't assume its parameter is local, but is satisfied with both
|
|
114
|
+
* local and remote references. It accepts both near and marshalled references
|
|
115
|
+
* that were returned from `Remotable` or `Far`.
|
|
116
|
+
*/
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
// TODO: Add type tests for Remote and ERemote.
|
|
122
|
+
/**
|
|
123
|
+
* A type that accepts either resolved or promised references that may be either
|
|
124
|
+
* near or marshalled. @see {ERef} and @see {Remote}.
|
|
125
|
+
*/
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Tag a pattern with the static type it represents. Endo's `mustMatch` and
|
|
132
|
+
* `matches` narrow a specimen to this type.
|
|
133
|
+
*
|
|
134
|
+
* @deprecated Use {@link CastedPattern} from `@endo/patterns` directly.
|
|
135
|
+
*/
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* This represents a node in an IAVL tree.
|
|
142
|
+
*
|
|
143
|
+
* The active implementation is x/vstorage, an Agoric extension of the Cosmos
|
|
144
|
+
* SDK.
|
|
145
|
+
*
|
|
146
|
+
* Vstorage is a hierarchical externally-reachable storage structure that
|
|
147
|
+
* identifies children by restricted ASCII name and is associated with arbitrary
|
|
148
|
+
* string-valued data for each node, defaulting to the empty string.
|
|
149
|
+
*/
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
package/src/upgrade-api.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export namespace UpgradeDisconnectionShape {
|
|
2
2
|
let name: string;
|
|
3
|
-
let upgradeMessage: import("@endo/patterns").
|
|
4
|
-
let incarnationNumber: import("@endo/patterns").
|
|
3
|
+
let upgradeMessage: import("@endo/patterns").MatcherOf<"string", string>;
|
|
4
|
+
let incarnationNumber: import("@endo/patterns").MatcherOf<"number", number>;
|
|
5
5
|
}
|
|
6
6
|
export function makeUpgradeDisconnection(upgradeMessage: string, toIncarnationNumber: number): UpgradeDisconnection;
|
|
7
7
|
export function isUpgradeDisconnection(reason: any): reason is UpgradeDisconnection;
|
package/src/upgrade-api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upgrade-api.d.ts","sourceRoot":"","sources":["upgrade-api.js"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"upgrade-api.d.ts","sourceRoot":"","sources":["upgrade-api.js"],"names":[],"mappings":";;;;;AA+BO,yDAJI,MAAM,uBACN,MAAM,GACJ,oBAAoB,CAO7B;AASG,+CALI,GAAG,GAGD,MAAM,IAAI,oBAAoB,CAMC;AAgBrC,yCAHI,GAAG,GACD,MAAM,IAAI,KAAK,CASS;;;;;mCA9DxB;IACR,IAAI,EAAE,aAAa,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;CAC3B"}
|
package/src/upgrade-api.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
// @ts-check
|
|
2
|
-
// @jessie-check
|
|
3
2
|
|
|
4
3
|
import { M, matches } from '@endo/patterns';
|
|
5
4
|
|
|
@@ -45,7 +44,8 @@ harden(makeUpgradeDisconnection);
|
|
|
45
44
|
* @returns {reason is UpgradeDisconnection}
|
|
46
45
|
*/
|
|
47
46
|
export const isUpgradeDisconnection = reason =>
|
|
48
|
-
reason
|
|
47
|
+
reason !== null &&
|
|
48
|
+
reason !== undefined &&
|
|
49
49
|
isFrozen(reason) &&
|
|
50
50
|
matches(reason, UpgradeDisconnectionShape);
|
|
51
51
|
harden(isUpgradeDisconnection);
|
|
@@ -64,7 +64,8 @@ harden(isUpgradeDisconnection);
|
|
|
64
64
|
* @returns {reason is Error}
|
|
65
65
|
*/
|
|
66
66
|
export const isAbandonedError = reason =>
|
|
67
|
-
reason
|
|
67
|
+
reason !== null &&
|
|
68
|
+
reason !== undefined &&
|
|
68
69
|
isFrozen(reason) &&
|
|
69
70
|
matches(reason, M.error()) &&
|
|
70
71
|
// We're not using a constant here since this special value is already
|