-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test(boot): simulate incoming vtransfer bridge events #10132
Conversation
105cdba
to
4698c1c
Compare
Deploying agoric-sdk with Cloudflare Pages
|
4698c1c
to
9097d7f
Compare
t.is(await flushInboundQueue(), 0); | ||
t.deepEqual(wallet.getLatestUpdateRecord(), beforeFlush); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why remove these assurances?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are not sending or recieving any DIBC bridge messages in send-anywhere
, so flushing the queue (which only has DIBC messages) seemed unnecessary
packages/boot/tools/supports.ts
Outdated
async inboundVTransferEvent(params: BuildVTransferEventParams) { | ||
await runUtils.queueAndRun( | ||
() => inbound(BridgeId.VTRANSFER, buildVTransferEvent(params)), | ||
true, | ||
); | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this strikes me as too high level for bridgeUtils
. The name also doesn't convey how it's different from simply inbound(BridgeId.VTRANSFER, buildVTransferEvent(params)),
WDYT of,
async inboundVTransferEvent(params: BuildVTransferEventParams) { | |
await runUtils.queueAndRun( | |
() => inbound(BridgeId.VTRANSFER, buildVTransferEvent(params)), | |
true, | |
); | |
}, | |
async runInbound(...args: Parameters<typeof inbound>>) { | |
await runUtils.queueAndRun( | |
() => inbound(...args), | |
true, | |
); | |
}, |
If we want better autocomplete we could improve the underlying inbound
type to look at the first arg to narrow the rest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, Parameters<typeof inbound>
is just ...any[]
, so I narrowed to ask for BridgeId
for the first argument.
await inboundVTransferEvent({ | ||
sourceChannel: 'channel-5', | ||
sequence: '1', | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is too abstract for BridgeUtils. (see comment below)
Putting a suggestion here to see how it looks:
await inboundVTransferEvent({ | |
sourceChannel: 'channel-5', | |
sequence: '1', | |
}); | |
await runInbound(BridgeId.VTRANSFER, buildVTransferEvent({ | |
sourceChannel: 'channel-5', | |
sequence: '1', | |
}); |
(and drop the export for BuildVTransferEventParams
)
If that's too clunky, ibc-mocks.ts
could have a helper like,
const makeRunIbcTransfer = (queueInbound) =>
(event: Parameters<typeof buildVTransferEvent>[0]) => queueInbound(BridgeId.VTRANSFER, buildVTransferEvent(event);
and this could be,
await inboundVTransferEvent({ | |
sourceChannel: 'channel-5', | |
sequence: '1', | |
}); | |
await runIbcTransfer({ | |
sourceChannel: 'channel-5', | |
sequence: '1', | |
}); |
9097d7f
to
5e72710
Compare
5e72710
to
7508618
Compare
closes: #10131
Description
runInbound
tobridgeUtils
in bootstrap test support to simulate an incoming bridge events, like a packet acknowledgementsend-anywhere
boot test so it's no longer failingSecurity Considerations
n/a
Scaling Considerations
n/a
Documentation Considerations
n/a
Testing Considerations
Addreses a
test.failing
checked inUpgrade Considerations
n/a, example contract and test support tools