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 d01b447 commit 241e85b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/zoe/src/contractSupport/recorder.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,8 @@ export const prepareRecorder = (baggage, marshaller) => {
const { closed, publisher, storageNode, valueShape } = this.state;
!closed || Fail`cannot write to closed recorder`;
mustMatch(value, valueShape);
const encoded = await E(marshaller).toCapData(value);
const serialized = JSON.stringify(encoded);
await E(storageNode).setValue(serialized);
const serializedP = await E(marshaller).serializeAndStringify(value);
await E(storageNode).setValue(serializedP);

// below here differs from writeFinal()
return publisher.publish(value);
Expand All @@ -118,9 +117,8 @@ export const prepareRecorder = (baggage, marshaller) => {
const { closed, publisher, storageNode, valueShape } = this.state;
!closed || Fail`cannot write to closed recorder`;
mustMatch(value, valueShape);
const encoded = await E(marshaller).toCapData(value);
const serialized = JSON.stringify(encoded);
await E(storageNode).setValue(serialized);
const serializedP = await E(marshaller).serializeAndStringify(value);
await E(storageNode).setValue(serializedP);

// below here differs from writeFinal()
this.state.closed = true;
Expand Down

0 comments on commit 241e85b

Please sign in to comment.