Skip to content

Commit

Permalink
chore: narrow types as needed by new Endo (#9617)
Browse files Browse the repository at this point in the history
Discovered by failures in [nightly Endo integration](https://github.com/Agoric/agoric-sdk/actions/runs/9721993347)

Narrows some types so that they work with the new `Passable` definition in Endo.
  • Loading branch information
mergify[bot] authored Jul 4, 2024
2 parents 3fc8884 + d886f3b commit 24fb1f5
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 49 deletions.
2 changes: 2 additions & 0 deletions packages/governance/src/electorateTools.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,14 @@ const startCounter = async (

/** @param {MapStore<Handle<'Question'>, QuestionRecord>} questionStore */
const getOpenQuestions = async questionStore => {
/** @type {[Promise<boolean>, Handle<'Question'>][]} */
const isOpenPQuestions = [...questionStore.entries()].map(
([key, { publicFacet }]) => {
return [E(publicFacet).isOpen(), key];
},
);

/** @type {[boolean, Handle<'Question'>][]} */
const isOpenQuestions = await deeplyFulfilled(harden(isOpenPQuestions));
return isOpenQuestions
.filter(([open, _key]) => open)
Expand Down
102 changes: 53 additions & 49 deletions packages/zoe/src/zoeService/zoe.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,58 +194,62 @@ const makeDurableZoeKit = ({
},
});

/** @type {ZoeService} */
const zoeService = prepareExo(zoeBaggage, 'ZoeService', ZoeServiceI, {
install(bundleId, bundleLabel) {
return dataAccess.installBundle(bundleId, bundleLabel);
},
installBundleID(bundleId, bundleLabel) {
return dataAccess.installBundleID(bundleId, bundleLabel);
},
startInstance,
offer,
const zoeService = prepareExo(
zoeBaggage,
'ZoeService',
ZoeServiceI,
/** @type {ZoeService} */ ({
install(bundleId, bundleLabel) {
return dataAccess.installBundle(bundleId, bundleLabel);
},
installBundleID(bundleId, bundleLabel) {
return dataAccess.installBundleID(bundleId, bundleLabel);
},
startInstance,
offer,

// The functions below are getters only and have no impact on
// state within Zoe
getOfferFilter(instance) {
return dataAccess.getOfferFilter(instance);
},
async getInvitationIssuer() {
return dataAccess.getInvitationIssuer();
},
async getFeeIssuer() {
return feeMintKit.feeMint.getFeeIssuer();
},
// The functions below are getters only and have no impact on
// state within Zoe
getOfferFilter(instance) {
return dataAccess.getOfferFilter(instance);
},
async getInvitationIssuer() {
return dataAccess.getInvitationIssuer();
},
async getFeeIssuer() {
return feeMintKit.feeMint.getFeeIssuer();
},

getBrands(instance) {
return dataAccess.getBrands(instance);
},
getIssuers(instance) {
return dataAccess.getIssuers(instance);
},
getPublicFacet(instance) {
return dataAccess.getPublicFacet(instance);
},
getTerms(instance) {
return dataAccess.getTerms(instance);
},
getInstallationForInstance(instance) {
return dataAccess.getInstallation(instance);
},
getBundleIDFromInstallation(installation) {
return dataAccess.getBundleIDFromInstallation(installation);
},
getInstallation,
getBrands(instance) {
return dataAccess.getBrands(instance);
},
getIssuers(instance) {
return dataAccess.getIssuers(instance);
},
getPublicFacet(instance) {
return dataAccess.getPublicFacet(instance);
},
getTerms(instance) {
return dataAccess.getTerms(instance);
},
getInstallationForInstance(instance) {
return dataAccess.getInstallation(instance);
},
getBundleIDFromInstallation(installation) {
return dataAccess.getBundleIDFromInstallation(installation);
},
getInstallation,

getInstance(invitation) {
return getInstance(invitation);
},
getConfiguration,
getInvitationDetails,
getProposalShapeForInvitation(invitation) {
return dataAccess.getProposalShapeForInvitation(invitation);
},
});
getInstance(invitation) {
return getInstance(invitation);
},
getConfiguration,
getInvitationDetails,
getProposalShapeForInvitation(invitation) {
return dataAccess.getProposalShapeForInvitation(invitation);
},
}),
);

return harden({
zoeService,
Expand Down

0 comments on commit 24fb1f5

Please sign in to comment.