Skip to content

Commit

Permalink
first pass addition of serializeBodyFormat: smallcaps
Browse files Browse the repository at this point in the history
refs #6822
  • Loading branch information
warner committed May 1, 2023
1 parent ab38bde commit 180f61f
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/cache/src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const makeKeyToString = (sanitize = obj => obj) => {
return slot;
};

const { serialize: keyToJsonable } = makeMarshal(valToSlot);
const { serialize: keyToJsonable } = makeMarshal(valToSlot, undefined, { serializeBodyFormat: 'smallcaps' });
const keyToString = async keyP => {
const key = await sanitize(keyP);
const obj = keyToJsonable(key);
Expand Down
2 changes: 1 addition & 1 deletion packages/casting/src/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,6 @@ export const MAKE_DEFAULT_UNSERIALIZER = () => {
return obj;
};
return Far('marshal unserializer', {
unserialize: makeMarshal(undefined, slotToVal).unserialize,
unserialize: makeMarshal(undefined, slotToVal, { serializeBodyFormat: 'smallcaps' }).unserialize,
});
};
2 changes: 1 addition & 1 deletion packages/cosmic-swingset/src/chain-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ export default async function main(progname, args, { env, homedir, agcc }) {
STORAGE_PATH.BUNDLES,
{ sequence: true },
);
const marshaller = makeMarshal();
const marshaller = makeMarshal(undefined, undefined, { serializeBodyFormat: 'smallcaps' });
const publish = makeSerializeToStorage(
installationStorageNode,
marshaller,
Expand Down
2 changes: 1 addition & 1 deletion packages/deploy-script-support/src/code-gen.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const defangAndTrim = code => {
return trimmed;
};

const { serialize } = makeMarshal();
const { serialize } = makeMarshal(undefined, undefined, { serializeBodyFormat: 'smallcaps' });
export const stringify = (x, pretty = false) =>
decodeToJustin(JSON.parse(serialize(harden(x)).body), pretty);

Expand Down
1 change: 1 addition & 0 deletions packages/notifier/src/storesub.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export const makeStoredSubscription = (
storageNode,
marshaller = makeMarshal(undefined, undefined, {
marshalSaveError: () => {},
serializeBodyFormat: 'smallcaps',
}),
) => {
/** @type {Unserializer} */
Expand Down
4 changes: 3 additions & 1 deletion packages/smart-wallet/src/marshal-contexts.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export const makeExportContext = () => {
}
initSlotVal(boardObjects, id, val);
},
...makeMarshal(valToSlot, slotToVal),
...makeMarshal(valToSlot, slotToVal, { serializeBodyFormat: 'smallcaps' }),
});
};
/** @typedef {ReturnType<typeof makeExportContext>} ExportContext */
Expand Down Expand Up @@ -323,9 +323,11 @@ export const makeImportContext = (makePresence = defaultMakePresence) => {
const marshal = {
fromBoard: makeMarshal(valToSlot.fromBoard, slotToVal.fromBoard, {
marshalName: 'fromBoard',
serializeBodyFormat: 'smallcaps',
}),
fromMyWallet: makeMarshal(valToSlot.fromMyWallet, slotToVal.fromMyWallet, {
marshalName: 'fromMyWallet',
serializeBodyFormat: 'smallcaps',
}),
};

Expand Down
4 changes: 2 additions & 2 deletions packages/vats/src/lib-board.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ const makeReadonlyMarshaller = state => {
// Published value.
return valToId.get(val);
};
return makeMarshal(valToSlot, slotToVal);
return makeMarshal(valToSlot, slotToVal, { serializeBodyFormat: 'smallcaps' });
};

/**
Expand All @@ -229,7 +229,7 @@ const makePublishingMarshaller = state => {
const slotToVal = makeSlotToVal(state);
// Always put the value in the board.
const valToSlot = val => getId(val, state);
return makeMarshal(valToSlot, slotToVal);
return makeMarshal(valToSlot, slotToVal, { serializeBodyFormat: 'smallcaps' });
};
//#endregion

Expand Down
1 change: 1 addition & 0 deletions packages/wallet/api/src/lib-dehydrate.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ export const makeDehydrator = (initialUnnamedCount = 0) => {
// TODO Temporary hack.
// See https://github.com/Agoric/agoric-sdk/issues/2780
errorIdNum: 30000,
serializeBodyFormat: 'smallcaps',
},
);
return harden({
Expand Down
1 change: 1 addition & 0 deletions packages/wallet/api/src/lib-wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ export function makeWalletRoot({
// TODO Temporary hack.
// See https://github.com/Agoric/agoric-sdk/issues/2780
errorIdNum: 40000,
serializeBodyFormat: 'smallcaps',
});

/** @type {NotifierRecord<OfferState[]>} */
Expand Down

0 comments on commit 180f61f

Please sign in to comment.