Skip to content

Commit 056eca0

Browse files
committed
chore: invitation name and tests updated, tests use dynamic xcs address
Refs: #8863
1 parent 10f25dd commit 056eca0

File tree

3 files changed

+18
-14
lines changed

3 files changed

+18
-14
lines changed

multichain-testing/test/xcs-swap-anything/swap-anything.test.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ test.serial('BLD for OSMO, receiver on Agoric', async t => {
128128
invitationSpec: {
129129
source: 'agoricContract',
130130
instancePath: [contractName],
131-
callPipe: [['makeSendInvitation']],
131+
callPipe: [['makeSwapInvitation']],
132132
},
133133
offerArgs: {
134134
// TODO: get the contract address dynamically
@@ -220,7 +220,7 @@ test.serial('OSMO for BLD, receiver on Agoric', async t => {
220220
invitationSpec: {
221221
source: 'agoricContract',
222222
instancePath: [contractName],
223-
callPipe: [['makeSendInvitation']],
223+
callPipe: [['makeSwapInvitation']],
224224
},
225225
offerArgs: {
226226
// TODO: get the contract address dynamically
@@ -299,7 +299,7 @@ test.serial('BLD for OSMO, receiver on CosmosHub', async t => {
299299
invitationSpec: {
300300
source: 'agoricContract',
301301
instancePath: [contractName],
302-
callPipe: [['makeSendInvitation']],
302+
callPipe: [['makeSwapInvitation']],
303303
},
304304
offerArgs: {
305305
// TODO: get the contract address dynamically
@@ -374,20 +374,20 @@ test.serial(
374374
'ubld',
375375
);
376376

377+
const { swapAddress } = await getXcsContractsAddress();
378+
377379
// Send swap offer
378380
const makeAccountOfferId = `swap-ubld-uosmo-${Date.now()}`;
379381
const updates = wdUser.offers.executeOffer({
380382
id: makeAccountOfferId,
381383
invitationSpec: {
382384
source: 'agoricContract',
383385
instancePath: [contractName],
384-
callPipe: [['makeSendInvitation']],
386+
callPipe: [['makeSwapInvitation']],
385387
},
386388
offerArgs: {
387-
// TODO: get the contract address dynamically
388-
destAddr:
389-
'osmo17p9rzwnnfxcjp32un9ug7yhhzgtkhvl9jfksztgw5uh69wac2pgs5yczr8',
390-
receiverAddr: 'noble/noble1foo',
389+
destAddr: swapAddress,
390+
receiverAddr: 'noble/noble1foo', // bad swap receiver
391391
outDenom: 'uosmo',
392392
slippage: { slippagePercentage: '20', windowSeconds: 10 },
393393
onFailedDelivery: 'do_nothing',

packages/orchestration/src/examples/swap-anything.contract.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ export const contract = async (
8383
});
8484

8585
const publicFacet = zone.exo(
86-
'Send PF',
87-
M.interface('Send PF', {
88-
makeSendInvitation: M.callWhen().returns(InvitationShape),
86+
'Swap Anything PF',
87+
M.interface('Swap Anything PF', {
88+
makeSwapInvitation: M.callWhen().returns(InvitationShape),
8989
}),
9090
{
91-
makeSendInvitation() {
91+
makeSwapInvitation() {
9292
return zcf.makeInvitation(
9393
swapAnythingOffer,
9494
'swap',

packages/orchestration/test/examples/swap-anything.test.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ test('swap BLD for Osmo, receiver on Agoric', async t => {
108108
} = await bootstrapOrchestration(t);
109109

110110
const publicFacet = await E(zoe).getPublicFacet(swapKit.instance);
111-
const inv = E(publicFacet).makeSendInvitation();
111+
const inv = E(publicFacet).makeSwapInvitation();
112112
const amt = await E(zoe).getInvitationDetails(inv);
113113
t.is(amt.description, 'swap');
114114

@@ -144,7 +144,11 @@ test('swap BLD for Osmo, receiver on Agoric', async t => {
144144
);
145145
});
146146

147-
test('trigger osmosis swap from an address hook', async t => {
147+
/**
148+
* UNTIL https://github.com/Agoric/BytePitchPartnerEng/issues/51, we are skipping this
149+
* until the ticket above is done
150+
*/
151+
test.skip('trigger osmosis swap from an address hook', async t => {
148152
const {
149153
bootstrap: { storage },
150154
transferBridge,

0 commit comments

Comments
 (0)