-
Notifications
You must be signed in to change notification settings - Fork 15
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
feat: Btc vault swap bouncer test can open a private channel #5410
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5410 +/- ##
======================================
- Coverage 72% 71% -0%
======================================
Files 489 489
Lines 86644 86531 -113
Branches 86644 86531 -113
======================================
- Hits 61961 61771 -190
- Misses 21774 21851 +77
Partials 2909 2909 ☔ View full report in Codecov by Sentry. |
if let Some(state_chain_runtime::RuntimeEvent::Swapping( | ||
pallet_cf_swapping::Event::PrivateBrokerChannelOpened { channel_id, .. }, | ||
)) = events.iter().find(|event| { | ||
matches!( | ||
event, | ||
state_chain_runtime::RuntimeEvent::Swapping( | ||
pallet_cf_swapping::Event::PrivateBrokerChannelOpened { .. } | ||
) | ||
) |
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 use this pattern a lot here, seems like it should be a util
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 can't see a good way to make it a util. Same problem we hit in the LP api.
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.
api/lib/src/lib.rs
Outdated
|
||
async fn open_private_btc_channel(&self) -> Result<ChannelId> { | ||
let (_, events, ..) = self | ||
.submit_signed_extrinsic(RuntimeCall::from( |
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.
nit: we could use a dry run to avoid submitting the extrinsic if it won't succeed.
|
||
// TODO: use chainflip SDK to check if the channel is already open | ||
try { | ||
await jsonRpc('broker_open_private_btc_channel', [], 'http://127.0.0.1:10997'); |
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.
Does the jsonRpc util not have a constant (or similar) to avoid having to explicitly pass the api url/port??
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.
Didn't seem worth adding a broker constant when the code will be replaced later by the chainflip SDK.
Could add a brokerRPC
function, just like the LP does. Would be useful in the future.
7533846
to
303f28f
Compare
Pull Request
Closes: PRO-1752
Checklist
Please conduct a thorough self-review before opening the PR.
Summary