Skip to content

Commit

Permalink
chore(smart-wallet): use asPromise instead of when
Browse files Browse the repository at this point in the history
  • Loading branch information
0xpatrickdev committed Jun 30, 2024
1 parent 0ca0087 commit 34565c4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/smart-wallet/src/offerWatcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { heapVowTools } from '@agoric/vow/vat.js';

import { UNPUBLISHED_RESULT } from './offers.js';

const { when, allVows } = heapVowTools;
const { allVows, asPromise } = heapVowTools;

/**
* @import {OfferSpec} from "./offers.js";
Expand Down Expand Up @@ -41,7 +41,7 @@ const { when, allVows } = heapVowTools;
*/
const watchForOfferResult = ({ resultWatcher }, seat) => {
// NOTE: this enables upgrade of the contract, NOT upgrade of the smart-wallet. See #9308
const p = when(E(seat).getOfferResult());
const p = asPromise(E(seat).getOfferResult());
watchPromise(p, resultWatcher, seat);
return p;
};
Expand Down Expand Up @@ -72,7 +72,7 @@ const watchForPayout = ({ paymentWatcher }, seat) => {
*/
export const watchOfferOutcomes = (watchers, seat) => {
// NOTE: this enables upgrade of the contract, NOT upgrade of the smart-wallet. See #9308
return when(
return asPromise(
allVows([
watchForOfferResult(watchers, seat),
watchForNumWants(watchers, seat),
Expand Down

0 comments on commit 34565c4

Please sign in to comment.