Skip to content

Commit

Permalink
docs(board-aux): move refine type to callee; punt core-types
Browse files Browse the repository at this point in the history
  • Loading branch information
dckc committed Mar 8, 2024
1 parent 8ac0fb3 commit 07e4b58
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions contract/src/platform-goals/board-aux.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const BOARD_AUX = 'boardAux';
* @param {import('@agoric/zone').Zone} zone
* @param {Marshaller} marshalData
* @param {{
* board: ERef<import('./core-types').Board>;
* board: ERef<import('@agoric/vats').Board>;
* chainStorage: ERef<StorageNode>;
* }} powers
*/
Expand Down Expand Up @@ -70,7 +70,7 @@ export const makeBoardAuxManager = (zone, marshalData, powers) => {
/** @typedef {BoardAuxManager['boardAuxAdmin']} BoardAuxAdmin */

/**
* @typedef {import('./core-types').PromiseSpaceOf<{
* @typedef {PromiseSpaceOf<{
* brandAuxPublisher: BrandAuxPublisher;
* boardAuxTOFU: BoardAuxTOFU;
* boardAuxAdmin: BoardAuxAdmin;
Expand All @@ -85,22 +85,25 @@ const marshalData = harden({
unserialize: () => Fail`not implemented`,
});

/**
* @param {import('./core-types').BootstrapPowers
* & BoardAuxPowers
* } powers
*/
/** @param {BootstrapPowers} powers */
export const produceBoardAuxManager = async powers => {
const { zone } = powers;
const { board, chainStorage } = powers.consume;
const { board } = powers.consume;
/** @type {import('../types').NonNullChainStorage['consume']} */
// @ts-expect-error cast
const { chainStorage } = powers.consume;

/** @type {BoardAuxPowers['produce']} */
// @ts-expect-error cast
const produce = powers;

const mgr = makeBoardAuxManager(zone, marshalData, { board, chainStorage });
powers.produce.brandAuxPublisher.reset();
produce.brandAuxPublisher.reset();
// TODO: powers.produce.boardAuxTOFU.reset();
powers.produce.boardAuxAdmin.reset();
powers.produce.brandAuxPublisher.resolve(mgr.brandAuxPublisher);
produce.boardAuxAdmin.reset();
produce.brandAuxPublisher.resolve(mgr.brandAuxPublisher);
// TODO: powers.produce.boardAuxTOFU.resolve(mgr.boardAuxTOFU);
powers.produce.boardAuxAdmin.resolve(mgr.boardAuxAdmin);
produce.boardAuxAdmin.resolve(mgr.boardAuxAdmin);
};

export const permit = {
Expand Down

0 comments on commit 07e4b58

Please sign in to comment.