Skip to content

Commit

Permalink
fixup! feat: combined serialize + stringify on board marshaller
Browse files Browse the repository at this point in the history
  • Loading branch information
dckc committed May 6, 2023
1 parent 391c091 commit d01b447
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/internal/src/lib-chainStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const { Fail } = assert;
*/

const ChainStorageNodeI = M.interface('StorageNode', {
setValue: M.callWhen(M.string()).returns(),
setValue: M.callWhen(M.await(M.string())).returns(),
getPath: M.call().returns(M.string()),
getStoreKey: M.callWhen().returns(M.record()),
makeChildNode: M.call(M.string())
Expand Down Expand Up @@ -228,8 +228,7 @@ harden(makeStorageNodeChild);
*/
export const makeSerializeToStorage = (storageNode, marshaller) => {
return async value => {
const serializedP = E(marshaller).serializeAndStringify(value);
// @ts-expect-error M.callWhen
return E(storageNode).setValue(serializedP);
const serialized = await E(marshaller).serializeAndStringify(value);
return E(storageNode).setValue(serialized);
};
};

0 comments on commit d01b447

Please sign in to comment.