@agoric/internal 0.3.3-dev-5a8edb1.0.5a8edb1 → 0.3.3-dev-0c7a293.0.0c7a293

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agoric/internal",
3
- "version": "0.3.3-dev-5a8edb1.0.5a8edb1",
3
+ "version": "0.3.3-dev-0c7a293.0.0c7a293",
4
4
  "description": "Externally unsupported utilities internal to agoric-sdk",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -20,7 +20,7 @@
20
20
  "lint:types": "yarn run -T tsc"
21
21
  },
22
22
  "dependencies": {
23
- "@agoric/base-zone": "0.1.1-dev-5a8edb1.0.5a8edb1",
23
+ "@agoric/base-zone": "0.1.1-dev-0c7a293.0.0c7a293",
24
24
  "@endo/cache-map": "^1.1.0",
25
25
  "@endo/common": "^1.2.13",
26
26
  "@endo/compartment-mapper": "^1.6.3",
@@ -38,7 +38,7 @@
38
38
  "jessie.js": "^0.3.4"
39
39
  },
40
40
  "devDependencies": {
41
- "@agoric/cosmic-proto": "0.4.1-dev-5a8edb1.0.5a8edb1",
41
+ "@agoric/cosmic-proto": "0.4.1-dev-0c7a293.0.0c7a293",
42
42
  "@endo/exo": "^1.5.12",
43
43
  "@endo/init": "^1.1.12",
44
44
  "@endo/ses-ava": "^1.3.2",
@@ -66,5 +66,5 @@
66
66
  "typeCoverage": {
67
67
  "atLeast": 92.84
68
68
  },
69
- "gitHead": "5a8edb184f030e99361f27d4c7ff81d16b3b1f6e"
69
+ "gitHead": "0c7a29375b83d052b4e0353a588a84d9f6a06138"
70
70
  }
@@ -1 +1 @@
1
- {"version":3,"file":"storage-test-utils.d.ts","sourceRoot":"","sources":["storage-test-utils.js"],"names":[],"mappings":"AA0BO,yCAHI,MAAM,UACN,MAAM,0GAGC;AAElB;;;GAGG;AACH;;;;;EAEG;;eAMU,CAAC,IAAI,EAAE,MAAM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@ export const documentStorageSchema = async (t, storage, opts) => {
378
378
  ? opts
379
379
  : { pattern: 'mockChainStorageRoot.', replacement: 'published.' };
380
380
 
381
- const pruned = [...keys]
382
- .sort()
383
- .filter(
384
- 'node' in opts
385
- ? key =>
386
- key
387
- .replace(pattern, replacement)
388
- .startsWith(`published.${opts.node}`)
389
- : _entry => true,
390
- );
381
+ const nodePrefix = 'node' in opts ? `published.${opts.node}` : undefined;
382
+ /** @type {[key: string, publishedKey: string][]} */
383
+ const normalized = [];
384
+ for (const key of keys) {
385
+ const publishedKey = key.replace(pattern, replacement);
386
+ if (!nodePrefix || publishedKey.startsWith(nodePrefix)) {
387
+ normalized.push([key, publishedKey]);
388
+ }
389
+ }
390
+ normalized.sort(([left], [right]) =>
391
+ left < right ? -1 : left > right ? 1 : 0,
392
+ );
391
393
 
392
- const illustration = pruned.map(
393
- /** @type {(k: string) => [string, unknown]} */
394
- key => [key.replace(pattern, replacement), getBody(key)],
394
+ const illustration = normalized.map(
395
+ /** @type {(entry: [string, string]) => [string, unknown]} */
396
+ ([key, publishedKey]) => [publishedKey, getBody(key)],
395
397
  );
396
398
 
397
399
  const note =
@@ -1,4 +1,18 @@
1
- export function eventLoopIteration(): Promise<any>;
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;
3
17
  export function testInterruptedSteps<Input = any, Context = unknown>(t: AvaT<Context>, allSteps: readonly TestStep<Input>[], doInterrupt?: (t: AvaT<Context>) => ERef<void>): Promise<void>;
4
18
  export type TestStep<Input = any> = readonly [stepName: string, fn: (input: Partial<Input>, label: string) => Partial<Input> | PromiseLike<Partial<Input>>];
@@ -1 +1 @@
1
- {"version":3,"file":"testing-utils.d.ts","sourceRoot":"","sources":["testing-utils.js"],"names":[],"mappings":"AAmBO,mDACwC;AAgBxC,uCAHI,QAAQ,GACN,MAAM,CAsBlB;AAqBM,qCANO,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,iBA8D1C;qBA7Ea,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;8BAzDuB,eAAe;8CACC,KAAK;0BACzB,qBAAqB"}
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;AAqBM,qCANO,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,iBA8D1C;qBA7Ea,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"}
@@ -1,8 +1,3 @@
1
- // @ts-check
2
- /**
3
- * @file note this cannot be called test-utils.js due to
4
- * https://github.com/Agoric/agoric-sdk/issues/7503
5
- */
6
1
  /* global setImmediate */
7
2
  /**
8
3
  * @import {MapStore} from '@agoric/store';
@@ -16,6 +11,8 @@
16
11
  * Lines of test code can depend on async promises outside the test resolving
17
12
  * before they run. Awaiting this function result ensures that all promises that
18
13
  * can do resolve. Note that this doesn't mean all outstanding promises.
14
+ *
15
+ * @type {() => Promise<void>}
19
16
  */
20
17
  export const eventLoopIteration = async () =>
21
18
  new Promise(resolve => setImmediate(resolve));