Skip to content

Commit

Permalink
test: queue startChannelOpenInit inbound
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Jul 24, 2024
1 parent bb0683a commit ab55ea5
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 7 deletions.
32 changes: 26 additions & 6 deletions packages/boot/test/bootstrapTests/orchestration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ test.serial('stakeAtom - smart wallet', async t => {
'agoric1testStakAtom',
);

await wd.executeOffer({
await wd.sendOffer({
id: 'request-account',
invitationSpec: {
source: 'agoricContract',
Expand All @@ -157,6 +157,7 @@ test.serial('stakeAtom - smart wallet', async t => {
},
proposal: {},
});
await flushInboundQueue();
t.like(wd.getCurrentWalletRecord(), {
offerToPublicSubscriberPaths: [
[
Expand Down Expand Up @@ -254,8 +255,13 @@ test.serial('revise chain info', async t => {
});

test('basic-flows', async t => {
const { buildProposal, evalProposal, agoricNamesRemotes, readLatest } =
t.context;
const {
buildProposal,
evalProposal,
agoricNamesRemotes,
readLatest,
flushInboundQueue,
} = t.context;

await evalProposal(
buildProposal('@agoric/builders/scripts/orchestration/init-basic-flows.js'),
Expand All @@ -265,7 +271,7 @@ test('basic-flows', async t => {
await t.context.walletFactoryDriver.provideSmartWallet('agoric1test');

// create a cosmos orchestration account
await wd.executeOffer({
await wd.sendOffer({
id: 'request-coa',
invitationSpec: {
source: 'agoricContract',
Expand All @@ -277,6 +283,7 @@ test('basic-flows', async t => {
},
proposal: {},
});
await flushInboundQueue();
t.like(wd.getCurrentWalletRecord(), {
offerToPublicSubscriberPaths: [
[
Expand Down Expand Up @@ -329,8 +336,13 @@ test.serial('auto-stake-it - proposal', async t => {
});

test.serial('basic-flows - portfolio holder', async t => {
const { buildProposal, evalProposal, readLatest, agoricNamesRemotes } =
t.context;
const {
buildProposal,
evalProposal,
readLatest,
agoricNamesRemotes,
flushInboundQueue,
} = t.context;

await evalProposal(
buildProposal('@agoric/builders/scripts/orchestration/init-basic-flows.js'),
Expand All @@ -352,6 +364,14 @@ test.serial('basic-flows - portfolio holder', async t => {
},
proposal: {},
});
t.like(
wd.getLatestUpdateRecord(),
{
status: { id: 'request-portfolio-acct', numWantsSatisfied: 1 },
},
'trivially satisfied',
);
await flushInboundQueue();
t.like(wd.getCurrentWalletRecord(), {
offerToPublicSubscriberPaths: [
[
Expand Down
8 changes: 7 additions & 1 deletion packages/boot/tools/supports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,13 @@ export const makeSwingsetTestKit = async (
case 'IBC_METHOD':
switch (obj.method) {
case 'startChannelOpenInit':
inbound!(BridgeId.DIBC, icaMocks.channelOpenAck(obj));
// This is what it used to do but that's not valid because bridge responses
// aren't instantaneous.
// inbound(BridgeId.DIBC, icaMocks.channelOpenAck(obj));
inboundQueue.push([
BridgeId.DIBC,
icaMocks.channelOpenAck(obj),
]);
return undefined;
case 'sendPacket':
switch (obj.packet.data) {
Expand Down

0 comments on commit ab55ea5

Please sign in to comment.