@agoric/internal 0.2.2-dev-2f08018.0 → 0.2.2-dev-f699658.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.2.2-dev-
|
|
3
|
+
"version": "0.2.2-dev-f699658.0+f699658",
|
|
4
4
|
"description": "Externally unsupported utilities internal to agoric-sdk",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "f6996583c94e4b1d61160a102f1e92f81cc27bb0"
|
|
41
41
|
}
|
|
@@ -27,7 +27,7 @@ export function makeChainStorageRoot(handleStorageMessage: (message: StorageMess
|
|
|
27
27
|
export function makeStorageNodeChild(storageNodeRef: import('@endo/far').ERef<StorageNode | null>, childName: string): Promise<StorageNode>;
|
|
28
28
|
/** @type {(name: string) => void} */
|
|
29
29
|
export const assertPathSegment: (name: string) => void;
|
|
30
|
-
export function
|
|
30
|
+
export function makeSerializeToStorage(storageNode: import('@endo/far').ERef<StorageNode>, marshaller: import('@endo/far').ERef<Marshaller>): (value: unknown) => Promise<void>;
|
|
31
31
|
/**
|
|
32
32
|
* Must match the switch in vstorage.go using `vstorageMessage` type
|
|
33
33
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib-chainStorage.d.ts","sourceRoot":"","sources":["lib-chainStorage.js"],"names":[],"mappings":"AAuDA;;;;;GAKG;AAEH;;;;;;;GAOG;AACH,qEALqB,cAAc,KAAK,GAAG,YAChC,MAAM;;4BA+DhB;AAUD;;;;;;;;GAQG;AACH,qDAJW,OAAO,WAAW,EAAE,IAAI,CAAC,WAAW,QAAE,aACtC,M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ainStorage.js
CHANGED
|
@@ -153,18 +153,17 @@ export async function makeStorageNodeChild(storageNodeRef, childName) {
|
|
|
153
153
|
}
|
|
154
154
|
harden(makeStorageNodeChild);
|
|
155
155
|
|
|
156
|
+
// TODO find a better module for this
|
|
156
157
|
/**
|
|
157
158
|
*
|
|
158
159
|
* @param {import('@endo/far').ERef<StorageNode>} storageNode
|
|
159
160
|
* @param {import('@endo/far').ERef<Marshaller>} marshaller
|
|
160
161
|
* @returns {(value: unknown) => Promise<void>}
|
|
161
162
|
*/
|
|
162
|
-
export const
|
|
163
|
-
return value =>
|
|
164
|
-
E(marshaller)
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
return E(storageNode).setValue(encoded);
|
|
169
|
-
});
|
|
163
|
+
export const makeSerializeToStorage = (storageNode, marshaller) => {
|
|
164
|
+
return async value => {
|
|
165
|
+
const marshalled = await E(marshaller).serialize(value);
|
|
166
|
+
const serialized = JSON.stringify(marshalled);
|
|
167
|
+
return E(storageNode).setValue(serialized);
|
|
168
|
+
};
|
|
170
169
|
};
|