Skip to content

Commit

Permalink
fix: fix typedef for makeInstance (was erroring incorrectly) and give…
Browse files Browse the repository at this point in the history
… better error message for an invalid installationHandle (#1109)
  • Loading branch information
katelynsills authored May 14, 2020
1 parent 5e1945c commit 4b352fc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/zoe/src/zoe.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ import { makeTables } from './state';
*
* @property {(installationHandle: InstallationHandle,
* issuerKeywordRecord: IssuerKeywordRecord,
* terms: object?)
* => Invite} makeInstance
* terms?: object)
* => Promise<Invite>} makeInstance
* Zoe is long-lived. We can use Zoe to create smart contract
* instances by specifying a particular contract installation to
* use, as well as the `issuerKeywordRecord` and `terms` of the contract. The
Expand Down Expand Up @@ -669,6 +669,10 @@ const makeZoe = (additionalEndowments = {}) => {
issuerKeywordRecord = harden({}),
terms = harden({}),
) => {
assert(
installationTable.has(installationHandle),
details`${installationHandle} was not a valid installationHandle`,
);
const { installation } = installationTable.get(installationHandle);
const instanceHandle = harden({});
const contractFacet = makeContractFacet(instanceHandle);
Expand Down

0 comments on commit 4b352fc

Please sign in to comment.