Skip to content

Commit

Permalink
fix(swingset): we no longer need bigintJSONStringify for transcripts
Browse files Browse the repository at this point in the history
because #2429 changed transcripts stop including `crankNumber`, which is a
Nat (and therefore now a BigInt).
  • Loading branch information
warner committed Feb 16, 2021
1 parent daacd59 commit fecb32c
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions packages/SwingSet/src/kernel/state/vatKeeper.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,16 +234,6 @@ export function makeVatKeeper(
}
}

// TODO: use marshal or some other library for handling the
// stringification of BigInts
function bigintJSONStringify(x) {
return JSON.stringify(
x,
(_key, value) => (typeof value === 'bigint' ? value.toString() : value),
// return everything else unchanged
);
}

/**
* Append a message to the vat's transcript.
*
Expand All @@ -252,7 +242,7 @@ export function makeVatKeeper(
function addToTranscript(msg) {
const id = Nat(BigInt(storage.get(`${vatID}.t.nextID`)));
storage.set(`${vatID}.t.nextID`, `${id + 1n}`);
storage.set(`${vatID}.t.${id}`, bigintJSONStringify(msg));
storage.set(`${vatID}.t.${id}`, JSON.stringify(msg));
}

function vatStats() {
Expand Down

0 comments on commit fecb32c

Please sign in to comment.