From f5f9c41b9eec519825c3b1940e3cc743f14056c5 Mon Sep 17 00:00:00 2001 From: Michael FIG Date: Sat, 5 Sep 2020 14:22:03 -0600 Subject: [PATCH] feat: allow Offer to accept a PaymentPKeywordRecord --- packages/zoe/src/zoeService/types.js | 4 ++-- packages/zoe/src/zoeService/zoe.js | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/zoe/src/zoeService/types.js b/packages/zoe/src/zoeService/types.js index fcf365d6d22..e809d4f07bf 100644 --- a/packages/zoe/src/zoeService/types.js +++ b/packages/zoe/src/zoeService/types.js @@ -92,7 +92,7 @@ * * @param {ERef} invitation * @param {Proposal=} proposal - * @param {PaymentKeywordRecord=} paymentKeywordRecord + * @param {PaymentPKeywordRecord=} paymentKeywordRecord * @returns {Promise} seat */ @@ -181,7 +181,7 @@ */ /** - * @typedef {Record>} PaymentPKeywordRecord + * @typedef {Record>} PaymentPKeywordRecord * @typedef {Record} PaymentKeywordRecord */ diff --git a/packages/zoe/src/zoeService/zoe.js b/packages/zoe/src/zoeService/zoe.js index 754cdf905c9..a9f6fe62f44 100644 --- a/packages/zoe/src/zoeService/zoe.js +++ b/packages/zoe/src/zoeService/zoe.js @@ -380,7 +380,9 @@ function makeZoe(vatAdminSvc, zcfBundleName = undefined) { // cleaned proposal's amount that should be the same. const giveAmount = proposal.give[keyword]; const purse = brandToPurse.get(giveAmount.brand); - return E(purse).deposit(paymentKeywordRecord[keyword], giveAmount); + return E.when(paymentKeywordRecord[keyword], payment => + E(purse).deposit(payment, giveAmount), + ); // eslint-disable-next-line no-else-return } else { // payments outside the give: clause are ignored.