Skip to content

Commit

Permalink
hack(smart-wallet): use heapVowE to unwrap vows
Browse files Browse the repository at this point in the history
- smart wallet does not know the right thing to do when it receives a vow. happy paths may 'seem' ok since the offer result is Vow object. For failure paths, the smart wallet thinks a Vow object holding a Promise rejection is a successful offer result
- until #9308, this makes bootstrap tests pass
  • Loading branch information
0xpatrickdev committed Jun 27, 2024
1 parent 0fde082 commit b59ccfe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/smart-wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"@agoric/store": "^0.9.2",
"@agoric/vat-data": "^0.5.2",
"@agoric/vats": "^0.15.1",
"@agoric/vow": "^0.1.0",
"@agoric/zoe": "^0.26.2",
"@endo/eventual-send": "^1.2.2",
"@endo/far": "^1.1.2",
Expand Down
4 changes: 3 additions & 1 deletion packages/smart-wallet/src/offerWatcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
} from '@agoric/zoe/src/typeGuards.js';
import { AmountShape } from '@agoric/ertp/src/typeGuards.js';
import { deeplyFulfilledObject, objectMap } from '@agoric/internal';
import { heapVowE } from '@agoric/vow/vat.js';

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

Expand Down Expand Up @@ -37,7 +38,8 @@ import { UNPUBLISHED_RESULT } from './offers.js';
* @param {UserSeat} seat
*/
const watchForOfferResult = ({ resultWatcher }, seat) => {
const p = E(seat).getOfferResult();
// TODO NOT FOR PRODUCTION. See #9308
const p = heapVowE(seat).getOfferResult();
watchPromise(p, resultWatcher, seat);
return p;
};
Expand Down

0 comments on commit b59ccfe

Please sign in to comment.