From d01b447bdd4dbb7defd7719c1e784a0aa300d484 Mon Sep 17 00:00:00 2001 From: Dan Connolly Date: Sat, 6 May 2023 18:18:06 -0500 Subject: [PATCH] fixup! feat: combined serialize + stringify on board marshaller --- packages/internal/src/lib-chainStorage.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/internal/src/lib-chainStorage.js b/packages/internal/src/lib-chainStorage.js index ccc27bbe402..23fc3cd65e1 100644 --- a/packages/internal/src/lib-chainStorage.js +++ b/packages/internal/src/lib-chainStorage.js @@ -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()) @@ -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); }; };