diff --git a/packages/smart-wallet/src/walletFactory.js b/packages/smart-wallet/src/walletFactory.js index b7ad6709bd6..bc9cb0c8c48 100644 --- a/packages/smart-wallet/src/walletFactory.js +++ b/packages/smart-wallet/src/walletFactory.js @@ -142,6 +142,7 @@ export const makeAssetRegistry = assetPublisher => { * @param {import('@agoric/vat-data').Baggage} baggage */ export const prepare = async (zcf, privateArgs, baggage) => { + const upgrading = baggage.has('walletsByAddress'); const { agoricNames, board, assetPublisher } = zcf.getTerms(); const zoe = zcf.getZoeService(); @@ -292,7 +293,6 @@ export const prepare = async (zcf, privateArgs, baggage) => { if (walletBridgeManager) { // NB: may not be in service when creatorFacet is used, or ever // It can't be awaited because that fails vat restart - const upgrading = baggage.has('walletsByAddress'); if (upgrading) { void E(walletBridgeManager).setHandler(handleWalletAction); } else { diff --git a/packages/smart-wallet/test/supports.js b/packages/smart-wallet/test/supports.js index dd51dc9c75e..6c8e7a8d03c 100644 --- a/packages/smart-wallet/test/supports.js +++ b/packages/smart-wallet/test/supports.js @@ -76,9 +76,11 @@ const makeFakeBridgeManager = () => return E(handler).fromBridge(obj); }, initHandler(newHandler) { + !handler || Fail`Handler already set`; handler = newHandler; }, setHandler(newHandler) { + !!handler || Fail`Handler not set`; handler = newHandler; }, });