Skip to content

Commit

Permalink
fix(cosmic-swingset): annotate Far/Data as necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
warner committed Mar 4, 2021
1 parent a1e341c commit 4335679
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion packages/cosmic-swingset/lib/ag-solo/vats/captp.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// in its own makeHardener, etc.
import { makeCapTP } from '@agoric/captp/lib/captp';
import { E } from '@agoric/eventual-send';
import { Data } from '@agoric/marshal';

export const getCapTPHandler = (
send,
Expand All @@ -11,7 +12,7 @@ export const getCapTPHandler = (
const chans = new Map();
const doFallback = async (method, ...args) => {
if (!fallback) {
return {};
return Data({});
}
return E(fallback)[method](...args);
};
Expand Down
3 changes: 2 additions & 1 deletion packages/cosmic-swingset/test/test-home.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import '@agoric/install-ses';
import test from 'ava';
import bundleSource from '@agoric/bundle-source';
import { Far } from '@agoric/marshal';

import { makeFixture, E } from './captp-fixture';

Expand Down Expand Up @@ -43,7 +44,7 @@ test.serial('home.board', async t => {
`using a non-verified id throws`,
);

const myValue = {};
const myValue = Far('myValue', {});
const myId = await E(board).getId(myValue);
t.is(typeof myId, 'string', `board key is string`);

Expand Down
5 changes: 3 additions & 2 deletions packages/cosmic-swingset/test/unitTests/test-lib-board.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
import '@agoric/install-ses';
import test from 'ava';

import { Far } from '@agoric/marshal';
import { makeBoard } from '../../lib/ag-solo/vats/lib-board';

test('makeBoard', async t => {
const board = makeBoard();

const obj1 = harden({});
const obj2 = harden({});
const obj1 = Far('obj1', {});
const obj2 = Far('obj2', {});

t.deepEqual(board.ids(), [], `board is empty to start`);

Expand Down

0 comments on commit 4335679

Please sign in to comment.