@agoric/internal 0.3.3-dev-fd22e4a.0 → 0.3.3-dev-fe66674.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agoric/internal",
3
- "version": "0.3.3-dev-fd22e4a.0+fd22e4a",
3
+ "version": "0.3.3-dev-fe66674.0+fe66674",
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": "tsc"
21
21
  },
22
22
  "dependencies": {
23
- "@agoric/base-zone": "0.1.1-dev-fd22e4a.0+fd22e4a",
23
+ "@agoric/base-zone": "0.1.1-dev-fe66674.0+fe66674",
24
24
  "@endo/common": "^1.2.9",
25
25
  "@endo/errors": "^1.2.9",
26
26
  "@endo/far": "^1.1.10",
@@ -34,7 +34,7 @@
34
34
  "jessie.js": "^0.3.4"
35
35
  },
36
36
  "devDependencies": {
37
- "@agoric/cosmic-proto": "0.4.1-dev-fd22e4a.0+fd22e4a",
37
+ "@agoric/cosmic-proto": "0.4.1-dev-fe66674.0+fe66674",
38
38
  "@endo/exo": "^1.5.8",
39
39
  "@endo/init": "^1.1.8",
40
40
  "ava": "^5.3.0",
@@ -60,5 +60,5 @@
60
60
  "typeCoverage": {
61
61
  "atLeast": 93.04
62
62
  },
63
- "gitHead": "fd22e4a8df77c14efdb448db797773ffdfab4ea2"
63
+ "gitHead": "fe666748e6b4ff8f8152eb77740fb6dd0cef5b83"
64
64
  }
@@ -27,13 +27,13 @@ export function makeFakeStorageKit(rootPath: string, rootOptions?: Parameters<ty
27
27
  updateNewCellBlockHeight: (blockHeight?: number) => void;
28
28
  getValues: (path: string) => string[];
29
29
  messages: StorageMessage[];
30
- toStorage: ((message: StorageMessage) => string | number | any[] | {
30
+ toStorage: ((message: StorageMessage) => string | number | true | any[] | {
31
31
  storeName: string;
32
32
  storeSubkey: string;
33
- } | null | undefined) & import("@endo/pass-style").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, (message: StorageMessage) => string | number | any[] | {
33
+ } | null) & import("@endo/pass-style").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, (message: StorageMessage) => string | number | true | any[] | {
34
34
  storeName: string;
35
35
  storeSubkey: string;
36
- } | null | undefined>;
36
+ } | null>;
37
37
  };
38
38
  export function makeMockChainStorageRoot(): MockChainStorageRoot;
39
39
  export function documentStorageSchema(t: import("ava").ExecutionContext<unknown>, storage: MockChainStorageRoot | FakeStorageKit, opts: ({
@@ -1 +1 @@
1
- {"version":3,"file":"storage-test-utils.d.ts","sourceRoot":"","sources":["storage-test-utils.js"],"names":[],"mappings":"AAyBO,yCAHI,MAAM,UACN,MAAM,6GAGC;AAElB;;;GAGG;AACH;;;;;EAEG;;eAMU,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO;mBAEzB,CAAC,GAAG,EAAE,GAAG,KAAK,MAAM;;AA8CjC,8CAtBuB,GAAG,KAAK,GAAG,CAsB+B;AAU1D,6CAHI,MAAM,gBACN,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAAC;;;;;oBA+FvC,CAAH;;;;UAwCU,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;;sBAd3B,MAAM,KACJ,MAAM,EAAE;;0BAtFP,cAAc;;;0JAAd,cAAc;;;;EAyG7B;AAoBM,4CADO,oBAAoB,CA6BjC;AAUM,yCAPI,OAAO,KAAK,EAAE,gBAAgB,CAAC,OAAO,CAAC,WACvC,oBAAoB,GAAG,cAAc,QACrC,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,GAC9D,CAAK;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,C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IAChD,SAAS,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC;CACpC,iBAkDL;6BAxGa,UAAU,CAAC,OAAO,kBAAkB,CAAC;;;;;;;;aAIrC,CACT,IAAI,EAAE,MAAM,EACZ,UAAU,CAAC,EAAE,UAAU,EACvB,KAAK,CAAC,EAAE,MAAM,KACX,OAAO;UAKD,MAAM,MAAM,EAAE;;mCAEd,WAAW,GAAG,2BAA2B;qCAhQJ,uBAAuB;iCAOU,uBAAuB;oCAAvB,uBAAuB;gCAAvB,uBAAuB"}
@@ -11,7 +11,7 @@ import { eventLoopIteration } from './testing-utils.js';
11
11
 
12
12
  /**
13
13
  * @import {TotalMap} from './types.js';
14
- * @import {Marshaller, StorageEntry, StorageMessage, StorageNode} from './lib-chainStorage.js';
14
+ * @import {Marshaller, StorageEntry, StorageMessage, StorageNode, StreamCell} from './lib-chainStorage.js';
15
15
  */
16
16
 
17
17
  const trace = makeTracer('StorTU', false);
@@ -166,7 +166,7 @@ export const makeFakeStorageKit = (rootPath, rootOptions) => {
166
166
  data.delete(key);
167
167
  }
168
168
  }
169
- break;
169
+ return true;
170
170
  }
171
171
  case 'append': {
172
172
  trace('toStorage append', message);
@@ -174,8 +174,10 @@ export const makeFakeStorageKit = (rootPath, rootOptions) => {
174
174
  const newEntries = message.args;
175
175
  for (const [key, value] of newEntries) {
176
176
  value != null || Fail`attempt to append with no value`;
177
- // In the absence of block boundaries, everything goes in a single StreamCell.
178
- const oldVal = data.get(key);
177
+
178
+ /** @type {string | undefined} */
179
+ let oldVal = data.get(key);
180
+ /** @type {StreamCell | undefined} */
179
181
  let streamCell;
180
182
  if (oldVal != null) {
181
183
  try {
@@ -184,20 +186,26 @@ export const makeFakeStorageKit = (rootPath, rootOptions) => {
184
186
  } catch (_err) {
185
187
  streamCell = undefined;
186
188
  }
189
+ // StreamCells reset at block boundaries.
190
+ if (
191
+ streamCell &&
192
+ Number(streamCell.blockHeight) !== currentBlockHeight
193
+ ) {
194
+ streamCell = undefined;
195
+ oldVal = undefined;
196
+ }
187
197
  }
188
- if (
189
- streamCell === undefined ||
190
- Number(streamCell.blockHeight) !== currentBlockHeight
191
- ) {
198
+
199
+ if (streamCell === undefined) {
192
200
  streamCell = {
193
201
  blockHeight: String(currentBlockHeight),
194
- values: !streamCell && oldVal != null ? [oldVal] : [],
202
+ values: oldVal != null ? [oldVal] : [],
195
203
  };
196
204
  }
197
205
  streamCell.values.push(value);
198
206
  data.set(key, JSON.stringify(streamCell));
199
207
  }
200
- break;
208
+ return true;
201
209
  }
202
210
  case 'size':
203
211
  // Intentionally incorrect because it counts non-child descendants,