Skip to content

Commit

Permalink
test: add BridgeManager.fromBridge
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Nov 30, 2022
1 parent bd6f5bb commit 12ba2c6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/smart-wallet/test/supports.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ const makeFakeBridgeManager = () => {
register(srcID, handler) {
handlers[srcID] = handler;
},
fromBridge(_dstID, _obj) {
assert.fail('expected fromBridge');
},
toBridge(dstID, obj) {
const handler = handlers[dstID];
assert(handler, `No handler for ${dstID}`);
Expand Down
1 change: 1 addition & 0 deletions packages/vats/src/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export {};
*
* @typedef {object} BridgeManager The object to manage this bridge
* @property {(dstID: string, obj: any) => any} toBridge
* @property {(dstID: string, obj: any) => any} fromBridge
* @property {(srcID: string, handler: ERef<BridgeHandler>) => void} register
* @property {(srcID: string, handler: ERef<BridgeHandler>) => void} unregister
*/
3 changes: 3 additions & 0 deletions packages/vats/test/test-vat-bank.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ test('communication', async t => {
t.assert(handler);
bankHandler = handler;
},
fromBridge(_dstID, _obj) {
t.fail('unexpected fromBridge');
},
toBridge(dstID, obj) {
t.is(dstID, 'bank');
let ret;
Expand Down

0 comments on commit 12ba2c6

Please sign in to comment.