Skip to content

Commit

Permalink
chore(types): new coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Apr 26, 2024
1 parent 51715b9 commit dad9559
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
1 change: 0 additions & 1 deletion packages/smart-wallet/test/contexts.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ export const makeDefaultTestContext = async (t, makeSpace) => {
};

const anchor = withAmountUtils(
// @ts-expect-error incomplete typedef
await deeplyFulfilledObject(consume.testFirstAnchorKit),
);

Expand Down
12 changes: 8 additions & 4 deletions packages/smart-wallet/test/test-marshal-contexts.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,13 @@ test('makeImportContext preserves identity across AMM and wallet', t => {
slots: ['board011'],
});

/** @type {Brand[]} */
const [b1] = context.fromBoard.fromCapData(ammMetricsCapData);
/** @type {Brand[]} */
const [b2] = context.fromBoard.fromCapData(amm.getMetrics());
const [b1] = /** @type {Brand[]} */ (
context.fromBoard.fromCapData(ammMetricsCapData)
);

const [b2] = /** @type {Brand[]} */ (
context.fromBoard.fromCapData(amm.getMetrics())
);
t.is(b1, b2, 'unserialization twice from same source');

const myWallet = makeOnChainWallet(board);
Expand All @@ -85,6 +88,7 @@ test('makeImportContext preserves identity across AMM and wallet', t => {
slots: ['board011', 'purse:ATOM'],
});

/** @type {any} */
const walletState = context.fromMyWallet.fromCapData(walletCapData);
t.is(walletState[0].brand, b1, 'unserialization across sources');

Expand Down
5 changes: 4 additions & 1 deletion packages/telemetry/src/slog-to-otel.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,10 @@ export const makeSlogToOtelKit = (tracer, overrideAttrs = {}) => {
serializeBodyFormat: 'smallcaps',
});

/** @param {import('@agoric/swingset-vat').SwingSetCapData} data */
/**
* @param {import('@agoric/swingset-vat').SwingSetCapData} data
* @returns {any}
*/
const unserialize = data => {
try {
const body = rawUnserialize(data);
Expand Down
1 change: 1 addition & 0 deletions packages/vats/test/test-lib-board.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ test('makeBoard', async t => {
test('board values must be scalar keys', async t => {
const board = makeFakeBoard();
const nonKey = harden({ a: 1 });
// @ts-expect-error intentional error
await t.throwsAsync(() => E(board).getId(nonKey), {
message: /arg 0: A "copyRecord" cannot be a scalar key: {"a":1}/,
});
Expand Down

0 comments on commit dad9559

Please sign in to comment.