diff --git a/packages/vats/tools/fake-bridge.js b/packages/vats/tools/fake-bridge.js index d8e1585d6a7..8f548418aa4 100644 --- a/packages/vats/tools/fake-bridge.js +++ b/packages/vats/tools/fake-bridge.js @@ -291,9 +291,14 @@ export const fakeLocalChainBridgeQueryHandler = message => { /** * @param {import('@agoric/zone').Zone} zone * @param {(obj) => void} [onToBridge] + * @param {(number) => string} [makeAddressFn] * @returns {ScopedBridgeManager<'vlocalchain'>} */ -export const makeFakeLocalchainBridge = (zone, onToBridge = () => {}) => { +export const makeFakeLocalchainBridge = ( + zone, + onToBridge = () => {}, + makeAddressFn, +) => { /** @type {Remote} */ let hndlr; let lcaExecuteTxSequence = 0; @@ -306,7 +311,9 @@ export const makeFakeLocalchainBridge = (zone, onToBridge = () => {}) => { trace('toBridge', type, method, params); switch (type) { case 'VLOCALCHAIN_ALLOCATE_ADDRESS': { - const address = `${LOCALCHAIN_DEFAULT_ADDRESS}${accountsCreated || ''}`; + const address = makeAddressFn + ? makeAddressFn(accountsCreated) + : `${LOCALCHAIN_DEFAULT_ADDRESS}${accountsCreated || ''}`; accountsCreated += 1; return address; }