From c8e0529a1bc87bb4c73c7ba3d90652f46d3e5403 Mon Sep 17 00:00:00 2001 From: 0xPatrick Date: Tue, 17 Dec 2024 18:29:49 -0500 Subject: [PATCH] chore: `advancer` validates `settlementAddress` --- .../boot/test/fast-usdc/fast-usdc.test.ts | 9 ++- packages/fast-usdc/src/exos/advancer.js | 22 +++++- packages/fast-usdc/src/fast-usdc.contract.js | 1 + packages/fast-usdc/test/cli/transfer.test.ts | 7 +- packages/fast-usdc/test/exos/advancer.test.ts | 75 +++++++++++++++++-- .../fast-usdc/test/fast-usdc.contract.test.ts | 68 ++++++++++++----- packages/fast-usdc/test/fixtures.ts | 31 ++++---- packages/fast-usdc/test/supports.ts | 7 +- 8 files changed, 170 insertions(+), 50 deletions(-) diff --git a/packages/boot/test/fast-usdc/fast-usdc.test.ts b/packages/boot/test/fast-usdc/fast-usdc.test.ts index 3c17e8b6f55..d3a2e83fd77 100644 --- a/packages/boot/test/fast-usdc/fast-usdc.test.ts +++ b/packages/boot/test/fast-usdc/fast-usdc.test.ts @@ -1,6 +1,7 @@ import { test as anyTest } from '@agoric/zoe/tools/prepare-test-env-ava.js'; import type { TestFn } from 'ava'; +import { encodeAddressHook } from '@agoric/cosmic-proto/address-hooks.js'; import { configurations } from '@agoric/fast-usdc/src/utils/deploy-config.js'; import { MockCctpTxEvidences } from '@agoric/fast-usdc/test/fixtures.js'; import { documentStorageSchema } from '@agoric/governance/tools/storageDoc.js'; @@ -233,7 +234,13 @@ test.serial('makes usdc advance', async t => { }); await eventLoopIteration(); - const evidence = MockCctpTxEvidences.AGORIC_PLUS_OSMO(); + const accountsData = storage.data.get('published.fastUsdc'); + const { settlementAccount } = JSON.parse(JSON.parse(accountsData!).values[0]); + const evidence = MockCctpTxEvidences.AGORIC_PLUS_OSMO( + encodeAddressHook(settlementAccount, { + EUD: 'osmo183dejcnmkka5dzcu9xw6mywq0p2m5peks28men', + }), + ); harness?.useRunPolicy(true); await Promise.all( diff --git a/packages/fast-usdc/src/exos/advancer.js b/packages/fast-usdc/src/exos/advancer.js index f63c2b7474c..65afb222af7 100644 --- a/packages/fast-usdc/src/exos/advancer.js +++ b/packages/fast-usdc/src/exos/advancer.js @@ -6,6 +6,7 @@ import { pickFacet } from '@agoric/vat-data'; import { VowShape } from '@agoric/vow'; import { E } from '@endo/far'; import { M, mustMatch } from '@endo/patterns'; +import { Fail, q } from '@endo/errors'; import { CctpTxEvidenceShape, AddressHookShape, @@ -56,6 +57,7 @@ const AdvancerKitI = harden({ advancer: M.interface('AdvancerI', { handleTransactionEvent: M.callWhen(CctpTxEvidenceShape).returns(), setIntermediateRecipient: M.call(ChainAddressShape).returns(), + setSettlementAddress: M.call(ChainAddressShape).returns(), }), depositHandler: M.interface('DepositHandlerI', { onFulfilled: M.call(M.undefined(), AdvancerVowCtxShape).returns(VowShape), @@ -117,13 +119,15 @@ export const prepareAdvancerKit = ( * borrowerFacet: LiquidityPoolKit['borrower']; * poolAccount: HostInterface>; * intermediateRecipient?: ChainAddress; + * settlementAddress?: ChainAddress; * }} config */ config => harden({ ...config, - // make sure the state record has this property, perhaps with an undefined value + // make sure the state record has these properties, perhaps with an undefined value intermediateRecipient: config.intermediateRecipient, + settlementAddress: config.settlementAddress, }), { advancer: { @@ -145,10 +149,17 @@ export const prepareAdvancerKit = ( return; } - const { borrowerFacet, poolAccount } = this.state; + const { borrowerFacet, poolAccount, settlementAddress } = + this.state; const { recipientAddress } = evidence.aux; const decoded = decodeAddressHook(recipientAddress); mustMatch(decoded, AddressHookShape); + if (!settlementAddress?.value) { + throw Fail`⚠️ No 'settlementAddress'. must call 'publishAddresses' first.`; + } + if (decoded.baseAddress !== settlementAddress.value) { + throw Fail`⚠️ baseAddress of address hook ${q(decoded.baseAddress)} does not match the expected address ${q(settlementAddress.value)}`; + } const { EUD } = /** @type {AddressHook['query']} */ (decoded.query); log(`decoded EUD: ${EUD}`); // throws if the bech32 prefix is not found @@ -172,10 +183,10 @@ export const prepareAdvancerKit = ( harden({ USDC: advanceAmount }), ); void watch(depositV, this.facets.depositHandler, { - fullAmount, advanceAmount, destination, forwardingAddress: evidence.tx.forwardingAddress, + fullAmount, tmpSeat, txHash: evidence.txHash, }); @@ -188,6 +199,10 @@ export const prepareAdvancerKit = ( setIntermediateRecipient(intermediateRecipient) { this.state.intermediateRecipient = intermediateRecipient; }, + /** @param {ChainAddress} settlementAddress */ + setSettlementAddress(settlementAddress) { + this.state.settlementAddress = settlementAddress; + }, }, depositHandler: { /** @@ -271,6 +286,7 @@ export const prepareAdvancerKit = ( borrowerFacet: M.remotable(), poolAccount: M.remotable(), intermediateRecipient: M.opt(ChainAddressShape), + settlementAddress: M.opt(ChainAddressShape), }), }, ); diff --git a/packages/fast-usdc/src/fast-usdc.contract.js b/packages/fast-usdc/src/fast-usdc.contract.js index b9629bb05c3..fae082f9dd7 100644 --- a/packages/fast-usdc/src/fast-usdc.contract.js +++ b/packages/fast-usdc/src/fast-usdc.contract.js @@ -186,6 +186,7 @@ export const contract = async (zcf, privateArgs, zone, tools) => { E(settlementAccount).getAddress(), ]), ); + advancer.setSettlementAddress(settlementAccountAddress); const addresses = harden({ poolAccount: poolAccountAddress.value, settlementAccount: settlementAccountAddress.value, diff --git a/packages/fast-usdc/test/cli/transfer.test.ts b/packages/fast-usdc/test/cli/transfer.test.ts index 1f75734d5ae..bdac4d4117a 100644 --- a/packages/fast-usdc/test/cli/transfer.test.ts +++ b/packages/fast-usdc/test/cli/transfer.test.ts @@ -8,6 +8,7 @@ import { makeFetchMock, makeMockSigner, } from '../../testing/mocks.js'; +import { settlementAddress } from '../fixtures.js'; test('Errors if config missing', async t => { const path = 'config/dir/.fast-usdc/config.json'; @@ -73,8 +74,7 @@ test('Transfer registers the noble forwarding account if it does not exist', asy }; const out = mockOut(); const file = mockFile(path, JSON.stringify(config)); - const agoricSettlementAccount = - 'agoric16kv2g7snfc4q24vg3pjdlnnqgngtjpwtetd2h689nz09lcklvh5s8u37ek'; + const agoricSettlementAccount = settlementAddress.value; const settlementAccountVstoragePath = 'published.fastUsdc.settlementAccount'; const vstorageMock = makeVstorageMock({ [settlementAccountVstoragePath]: agoricSettlementAccount, @@ -150,8 +150,7 @@ test('Transfer signs and broadcasts the depositForBurn message on Ethereum', asy }; const out = mockOut(); const file = mockFile(path, JSON.stringify(config)); - const agoricSettlementAccount = - 'agoric16kv2g7snfc4q24vg3pjdlnnqgngtjpwtetd2h689nz09lcklvh5s8u37ek'; + const agoricSettlementAccount = settlementAddress.value; const settlementAccountVstoragePath = 'published.fastUsdc.settlementAccount'; const vstorageMock = makeVstorageMock({ [settlementAccountVstoragePath]: agoricSettlementAccount, diff --git a/packages/fast-usdc/test/exos/advancer.test.ts b/packages/fast-usdc/test/exos/advancer.test.ts index 4bb122220df..f070031f938 100644 --- a/packages/fast-usdc/test/exos/advancer.test.ts +++ b/packages/fast-usdc/test/exos/advancer.test.ts @@ -19,7 +19,11 @@ import type { SettlerKit } from '../../src/exos/settler.js'; import { prepareStatusManager } from '../../src/exos/status-manager.js'; import type { LiquidityPoolKit } from '../../src/types.js'; import { makeFeeTools } from '../../src/utils/fees.js'; -import { MockCctpTxEvidences, intermediateRecipient } from '../fixtures.js'; +import { + MockCctpTxEvidences, + settlementAddress, + intermediateRecipient, +} from '../fixtures.js'; import { makeTestFeeConfig, makeTestLogger, @@ -127,6 +131,7 @@ const createTestExtensions = (t, common: CommonSetup) => { notifyFacet: mockNotifyF, poolAccount: mockAccounts.mockPoolAccount.account, intermediateRecipient, + settlementAddress, }); return { @@ -141,6 +146,7 @@ const createTestExtensions = (t, common: CommonSetup) => { }, mocks: { ...mockAccounts, + mockBorrowerF, mockNotifyF, resolveLocalTransferV, rejectLocalTransfeferV, @@ -260,6 +266,7 @@ test('updates status to OBSERVED on insufficient pool funds', async t => { notifyFacet: mockNotifyF, poolAccount: mockPoolAccount.account, intermediateRecipient, + settlementAddress, }); const evidence = MockCctpTxEvidences.AGORIC_PLUS_DYDX(); @@ -393,10 +400,10 @@ test('updates status to OBSERVED if pre-condition checks fail', async t => { await advancer.handleTransactionEvent({ ...MockCctpTxEvidences.AGORIC_NO_PARAMS( - encodeAddressHook( - 'agoric16kv2g7snfc4q24vg3pjdlnnqgngtjpwtetd2h689nz09lcklvh5s8u37ek', - { EUD: 'osmo1234', extra: 'value' }, - ), + encodeAddressHook(settlementAddress.value, { + EUD: 'osmo1234', + extra: 'value', + }), ), txHash: '0xc81bc6105b60a234c7c50ac17816ebcd5561d366df8bf3be59ff387552761799', @@ -550,6 +557,7 @@ test('alerts if `returnToPool` fallback fails', async t => { notifyFacet: mockNotifyF, poolAccount: mockPoolAccount.account, intermediateRecipient, + settlementAddress, }); const mockEvidence = MockCctpTxEvidences.AGORIC_PLUS_OSMO(); @@ -588,3 +596,60 @@ test('alerts if `returnToPool` fallback fails', async t => { 'Advancing tx is recorded as AdvanceFailed', ); }); + +test('rejects advances to unknown settlementAccount', async t => { + const { + extensions: { + services: { advancer }, + helpers: { inspectLogs }, + }, + } = t.context; + + const invalidSettlementAcct = + 'agoric1ax7hmw49tmqrdld7emc5xw3wf43a49rtkacr9d5nfpqa0y7k6n0sl8v94h'; + t.not(settlementAddress.value, invalidSettlementAcct); + const mockEvidence = MockCctpTxEvidences.AGORIC_PLUS_OSMO( + encodeAddressHook(invalidSettlementAcct, { + EUD: 'osmo183dejcnmkka5dzcu9xw6mywq0p2m5peks28men', + }), + ); + + void advancer.handleTransactionEvent(mockEvidence); + await eventLoopIteration(); + t.deepEqual(inspectLogs(), [ + [ + 'Advancer error:', + Error( + '⚠️ baseAddress of address hook "agoric1ax7hmw49tmqrdld7emc5xw3wf43a49rtkacr9d5nfpqa0y7k6n0sl8v94h" does not match the expected address "agoric16kv2g7snfc4q24vg3pjdlnnqgngtjpwtetd2h689nz09lcklvh5s8u37ek"', + ), + ], + ]); +}); + +test('does not advance without settlementAddress set', async t => { + const { + extensions: { + services: { makeAdvancer }, + helpers: { inspectLogs }, + mocks: { mockPoolAccount, mockNotifyF, mockBorrowerF }, + }, + } = t.context; + + // make a new advancer without setting `settlementAddress` + const advancer = makeAdvancer({ + borrowerFacet: mockBorrowerF, + notifyFacet: mockNotifyF, + poolAccount: mockPoolAccount.account, + intermediateRecipient, + }); + const mockEvidence = MockCctpTxEvidences.AGORIC_PLUS_OSMO(); + + void advancer.handleTransactionEvent(mockEvidence); + await eventLoopIteration(); + t.deepEqual(inspectLogs(), [ + [ + 'Advancer error:', + Error("⚠️ No 'settlementAddress'. must call 'publishAddresses' first."), + ], + ]); +}); diff --git a/packages/fast-usdc/test/fast-usdc.contract.test.ts b/packages/fast-usdc/test/fast-usdc.contract.test.ts index bc73389a5b9..0ee43d0e3cb 100644 --- a/packages/fast-usdc/test/fast-usdc.contract.test.ts +++ b/packages/fast-usdc/test/fast-usdc.contract.test.ts @@ -6,6 +6,7 @@ import { encodeAddressHook, } from '@agoric/cosmic-proto/address-hooks.js'; import { AmountMath } from '@agoric/ertp/src/amountMath.js'; +import type { makeFakeStorageKit } from '@agoric/internal/src/storage-test-utils.js'; import { eventLoopIteration, inspectMapStore, @@ -18,6 +19,7 @@ import { } from '@agoric/notifier'; import fetchedChainInfo from '@agoric/orchestration/src/fetched-chain-info.js'; import { buildVTransferEvent } from '@agoric/orchestration/tools/ibc-mocks.js'; +import { makeTestAddress } from '@agoric/orchestration/tools/make-test-address.js'; import { heapVowE as VE } from '@agoric/vow/vat.js'; import { divideBy, @@ -136,12 +138,15 @@ const makeTestContext = async (t: ExecutionContext) => { }; const mint = async (e: CctpTxEvidence) => { - const settlerAddr = 'agoric1fakeLCAAddress1'; // TODO: get from contract - const rxd = await receiveUSDCAt(settlerAddr, e.tx.amount); + const accountsData = common.bootstrap.storage.data.get('fun'); + const { settlementAccount } = JSON.parse( + JSON.parse(accountsData!).values[0], + ); + const rxd = await receiveUSDCAt(settlementAccount, e.tx.amount); await VE(transferBridge).fromBridge( buildVTransferEvent({ receiver: e.aux.recipientAddress, - target: settlerAddr, + target: settlementAccount, sourceChannel: agToNoble.transferChannel.counterPartyChannelId, denom: 'uusdc', amount: e.tx.amount, @@ -190,8 +195,8 @@ test('getStaticInfo', async t => { t.deepEqual(await E(publicFacet).getStaticInfo(), { addresses: { - poolAccount: 'agoric1fakeLCAAddress', - settlementAccount: 'agoric1fakeLCAAddress1', + poolAccount: makeTestAddress(), + settlementAccount: makeTestAddress(1), }, }); }); @@ -346,7 +351,6 @@ const makeLP = async ( }; const makeEVM = (template = MockCctpTxEvidences.AGORIC_PLUS_OSMO()) => { - const [settleAddr] = template.aux.recipientAddress.split('?'); let nonce = 0; const makeTx = (amount: bigint, recipientAddress: string): CctpTxEvidence => { @@ -373,15 +377,12 @@ const makeCustomer = ( cctp: ReturnType['cctp'], txPublisher: Publisher, feeConfig: FeeConfig, // TODO: get from vstorage (or at least: a subscriber) + storage: ReturnType, ) => { const USDC = feeConfig.flat.brand; const feeTools = makeFeeTools(feeConfig); const sent = [] as CctpTxEvidence[]; - // TODO: get settlerAddr from vstorage - const [settleAddr] = - MockCctpTxEvidences.AGORIC_PLUS_OSMO().aux.recipientAddress.split('?'); - const me = harden({ checkPoolAvailable: async ( t: ExecutionContext, @@ -395,7 +396,11 @@ const makeCustomer = ( return enough; }, sendFast: async (t: ExecutionContext, amount: bigint, EUD: string) => { - const recipientAddress = encodeAddressHook(settleAddr, { EUD }); + const accountsData = storage.data.get('fun'); + const { settlementAccount } = JSON.parse( + JSON.parse(accountsData!).values[0], + ); + const recipientAddress = encodeAddressHook(settlementAccount, { EUD }); // KLUDGE: UI would ask noble for a forwardingAddress // "cctp" here has some noble stuff mixed in. const tx = cctp.makeTx(amount, recipientAddress); @@ -534,6 +539,7 @@ test.serial('C25 - LPs can deposit USDC', async t => { test.serial('STORY01: advancing happy path for 100 USDC', async t => { const { common: { + bootstrap: { storage }, brands: { usdc }, commonPrivateArgs: { feeConfig }, utils: { inspectBankBridge, transmitTransferAck }, @@ -543,7 +549,7 @@ test.serial('STORY01: advancing happy path for 100 USDC', async t => { bridges: { snapshot, since }, mint, } = t.context; - const cust1 = makeCustomer('Carl', cctp, txPub.publisher, feeConfig); + const cust1 = makeCustomer('Carl', cctp, txPub.publisher, feeConfig, storage); const bridgePos = snapshot(); const sent1 = await cust1.sendFast(t, 108_000_000n, 'osmo1234advanceHappy'); @@ -559,7 +565,7 @@ test.serial('STORY01: advancing happy path for 100 USDC', async t => { t.deepEqual(inspectBankBridge().at(-1), { amount: String(expectedAdvance.value), denom: uusdcOnAgoric, - recipient: 'agoric1fakeLCAAddress', + recipient: makeTestAddress(), type: 'VBANK_GIVE', }); @@ -664,6 +670,7 @@ test.serial('With 250 available, 3 race to get ~100', async t => { bridges: { snapshot, since }, evm: { cctp, txPub }, common: { + bootstrap: { storage }, commonPrivateArgs: { feeConfig }, utils: { transmitTransferAck }, }, @@ -672,9 +679,9 @@ test.serial('With 250 available, 3 race to get ~100', async t => { } = t.context; const cust = { - racer1: makeCustomer('Racer1', cctp, txPub.publisher, feeConfig), - racer2: makeCustomer('Racer2', cctp, txPub.publisher, feeConfig), - racer3: makeCustomer('Racer3', cctp, txPub.publisher, feeConfig), + racer1: makeCustomer('Racer1', cctp, txPub.publisher, feeConfig, storage), + racer2: makeCustomer('Racer2', cctp, txPub.publisher, feeConfig, storage), + racer3: makeCustomer('Racer3', cctp, txPub.publisher, feeConfig, storage), }; await cust.racer3.checkPoolAvailable(t, 125_000_000n, metricsSub); @@ -719,12 +726,19 @@ test.serial('STORY09: insufficient liquidity: no FastUSDC option', async t => { // MarketMaker’s account const { common: { + bootstrap: { storage }, commonPrivateArgs: { feeConfig }, }, evm: { cctp, txPub }, startKit: { metricsSub }, } = t.context; - const early = makeCustomer('Unice', cctp, txPub.publisher, feeConfig); + const early = makeCustomer( + 'Unice', + cctp, + txPub.publisher, + feeConfig, + storage, + ); const available = await early.checkPoolAvailable(t, 5_000_000n, metricsSub); t.false(available); }); @@ -732,6 +746,7 @@ test.serial('STORY09: insufficient liquidity: no FastUSDC option', async t => { test.serial('C20 - Contract MUST function with an empty pool', async t => { const { common: { + bootstrap: { storage }, commonPrivateArgs: { feeConfig }, utils: { transmitTransferAck }, }, @@ -740,7 +755,13 @@ test.serial('C20 - Contract MUST function with an empty pool', async t => { bridges: { snapshot, since }, mint, } = t.context; - const custEmpty = makeCustomer('Earl', cctp, txPub.publisher, feeConfig); + const custEmpty = makeCustomer( + 'Earl', + cctp, + txPub.publisher, + feeConfig, + storage, + ); const bridgePos = snapshot(); const sent = await custEmpty.sendFast(t, 150_000_000n, 'osmo123'); const bridgeTraffic = since(bridgePos); @@ -763,6 +784,7 @@ test.serial('Settlement for unknown transaction (operator down)', async t => { bridges: { snapshot, since }, evm: { cctp, txPub }, common: { + bootstrap: { storage }, commonPrivateArgs: { feeConfig }, utils: { transmitTransferAck }, }, @@ -774,7 +796,13 @@ test.serial('Settlement for unknown transaction (operator down)', async t => { operators[0].setActive(false); operators[1].setActive(false); - const opDown = makeCustomer('Otto', cctp, txPub.publisher, feeConfig); + const opDown = makeCustomer( + 'Otto', + cctp, + txPub.publisher, + feeConfig, + storage, + ); const bridgePos = snapshot(); const sent = await opDown.sendFast(t, 20_000_000n, 'osmo12345'); @@ -791,7 +819,7 @@ test.serial('Settlement for unknown transaction (operator down)', async t => { }, { amount: '20000000', - recipient: 'agoric1fakeLCAAddress1', + recipient: 'agoric1qyqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqc09z0g', type: 'VBANK_GIVE', }, ], diff --git a/packages/fast-usdc/test/fixtures.ts b/packages/fast-usdc/test/fixtures.ts index 35ec0c231e2..bc5ff0874c7 100644 --- a/packages/fast-usdc/test/fixtures.ts +++ b/packages/fast-usdc/test/fixtures.ts @@ -37,10 +37,9 @@ export const MockCctpTxEvidences: Record< forwardingChannel: 'channel-21', recipientAddress: receiverAddress || - encodeAddressHook( - 'agoric16kv2g7snfc4q24vg3pjdlnnqgngtjpwtetd2h689nz09lcklvh5s8u37ek', - { EUD: 'osmo183dejcnmkka5dzcu9xw6mywq0p2m5peks28men' }, - ), + encodeAddressHook(settlementAddress.value, { + EUD: 'osmo183dejcnmkka5dzcu9xw6mywq0p2m5peks28men', + }), }, chainId: 1, }), @@ -59,10 +58,9 @@ export const MockCctpTxEvidences: Record< forwardingChannel: 'channel-21', recipientAddress: receiverAddress || - encodeAddressHook( - 'agoric16kv2g7snfc4q24vg3pjdlnnqgngtjpwtetd2h689nz09lcklvh5s8u37ek', - { EUD: 'dydx183dejcnmkka5dzcu9xw6mywq0p2m5peks28men' }, - ), + encodeAddressHook(settlementAddress.value, { + EUD: 'dydx183dejcnmkka5dzcu9xw6mywq0p2m5peks28men', + }), }, chainId: 1, }), @@ -79,9 +77,7 @@ export const MockCctpTxEvidences: Record< }, aux: { forwardingChannel: 'channel-21', - recipientAddress: - receiverAddress || - 'agoric16kv2g7snfc4q24vg3pjdlnnqgngtjpwtetd2h689nz09lcklvh5s8u37ek', + recipientAddress: receiverAddress || settlementAddress.value, }, chainId: 1, }), @@ -100,10 +96,9 @@ export const MockCctpTxEvidences: Record< forwardingChannel: 'channel-21', recipientAddress: receiverAddress || - encodeAddressHook( - 'agoric16kv2g7snfc4q24vg3pjdlnnqgngtjpwtetd2h689nz09lcklvh5s8u37ek', - { EUD: 'random1addr' }, - ), + encodeAddressHook(settlementAddress.value, { + EUD: 'random1addr', + }), }, chainId: 1, }), @@ -166,3 +161,9 @@ export const intermediateRecipient: ChainAddress = harden({ value: 'noble1test', encoding: 'bech32', }); + +export const settlementAddress: ChainAddress = harden({ + chainId: 'agoric-3', + encoding: 'bech32' as const, + value: 'agoric16kv2g7snfc4q24vg3pjdlnnqgngtjpwtetd2h689nz09lcklvh5s8u37ek', +}); diff --git a/packages/fast-usdc/test/supports.ts b/packages/fast-usdc/test/supports.ts index 984352b3c07..6a4608a0cf5 100644 --- a/packages/fast-usdc/test/supports.ts +++ b/packages/fast-usdc/test/supports.ts @@ -20,6 +20,7 @@ import { prepareCosmosInterchainService } from '@agoric/orchestration/src/exos/c import fetchedChainInfo from '@agoric/orchestration/src/fetched-chain-info.js'; import { setupFakeNetwork } from '@agoric/orchestration/test/network-fakes.js'; import { buildVTransferEvent } from '@agoric/orchestration/tools/ibc-mocks.js'; +import { makeTestAddress } from '@agoric/orchestration/tools/make-test-address.js'; import { reincarnate } from '@agoric/swingset-liveslots/tools/setup-vat-data.js'; import { makeNameHubKit } from '@agoric/vats'; import { prepareBridgeTargetModule } from '@agoric/vats/src/bridge-target.js'; @@ -139,8 +140,10 @@ export const commonSetup = async (t: ExecutionContext) => { await E(transferBridge).initHandler(bridgeTargetKit.bridgeHandler); const localBridgeMessages = [] as any[]; - const localchainBridge = makeFakeLocalchainBridge(rootZone, obj => - localBridgeMessages.push(obj), + const localchainBridge = makeFakeLocalchainBridge( + rootZone, + obj => localBridgeMessages.push(obj), + makeTestAddress, ); const localchain = prepareLocalChainTools( rootZone.subZone('localchain'),