Skip to content

Commit

Permalink
WIP(marshalTables): caller-supplied valToSlot in client marshal
Browse files Browse the repository at this point in the history
  • Loading branch information
dckc committed Feb 24, 2024
1 parent 1d96fc8 commit 73d3f9a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions contract/test/ui-kit-goals/marshalTables.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,14 @@ const makeTranslationTable = (makeSlot, makeVal) => {
const synthesizeRemotable = (slot, iface) =>
Far(`${(iface ?? '').replace(/^Alleged: /, '')}#${slot}`, {});

export const makeClientMarshaller = () => {
const { convertValToSlot, convertSlotToVal } = makeTranslationTable(val => {
export const makeClientMarshaller = valToSlot => {
const noNewSlots = val => {
throw new Error(`unknown value: ${val}`);
}, synthesizeRemotable);
};
const { convertValToSlot, convertSlotToVal } = makeTranslationTable(
valToSlot || noNewSlots,
synthesizeRemotable,
);

return makeMarshal(convertValToSlot, convertSlotToVal, {
serializeBodyFormat: 'smallcaps',
Expand Down

0 comments on commit 73d3f9a

Please sign in to comment.