Skip to content

Commit

Permalink
test(sendAnywhere): verify traffic across localBridge
Browse files Browse the repository at this point in the history
  • Loading branch information
dckc committed Jun 6, 2024
1 parent f5e2b5b commit ab38074
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion packages/orchestration/test/examples/sendAnywhere.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ test('send using arbitrary chain info', async t => {
bootstrap,
commonPrivateArgs,
brands: { ist },
utils: { inspectLocalBridge },
} = await commonSetup(t);

const { rootZone: zone, board, marshaller } = bootstrap;
Expand Down Expand Up @@ -77,7 +78,7 @@ test('send using arbitrary chain info', async t => {

const anAmt = ist.make(20n);
const Send = ist.mint.mintPayment(anAmt);
const dest = { destAddr: 'agoric1valopsfufu', chainKey };
const dest = { destAddr: 'hot1destAddr', chainKey };
const userSeat = await E(zoe).offer(
inv,
{ give: { Send: anAmt } },
Expand All @@ -86,4 +87,30 @@ test('send using arbitrary chain info', async t => {
);
const result = await E(userSeat).getOfferResult();
t.is(result, undefined);

const history = inspectLocalBridge();
t.like(history, [
{
type: 'VLOCALCHAIN_ALLOCATE_ADDRESS',
},
{
address: 'agoric1fakeLCAAddress',
type: 'VLOCALCHAIN_EXECUTE_TX',
},
]);
const [_alloc, { messages }] = history;
t.is(messages.length, 1);
const [txfr] = messages;
t.log('local bridge', txfr);
t.like(txfr, {
'@type': '/ibc.applications.transfer.v1.MsgTransfer',
receiver: 'hot1destAddr',
sender: 'agoric1fakeLCAAddress',
sourceChannel: 'channel-0',
sourcePort: 'transfer',
token: {
amount: '20',
denom: 'uist',
},
});
});

0 comments on commit ab38074

Please sign in to comment.