Skip to content
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

[feature]: sign and broadcast accept-withdrawal contract call #1403

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

MCJOHN974
Copy link
Collaborator

Description

Closes: #1385

WIP

Changes

Testing Information

Checklist:

  • I have performed a self-review of my code
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@MCJOHN974 MCJOHN974 requested a review from djordon February 20, 2025 11:50
@MCJOHN974
Copy link
Collaborator Author

@djordon can you please take a brief look? It is not ready, just to double-check that I'm working in correct direction

@djordon
Copy link
Collaborator

djordon commented Feb 21, 2025

So far so good! Now for the most fun part, the tests!

@djordon djordon added the withdrawal The withdrawal sBTC operation. label Feb 21, 2025
// Await for tenure completion
let tenure_completed_signal = TxCoordinatorEvent::TenureCompleted.into();

println!("Waiting for tenure completion");
context
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I'm getting stack overflow here and think it is weird...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, no, I found where it comes from

@@ -1034,7 +1034,7 @@ impl PartialOrd for StacksPrincipal {

/// A ScriptPubkey of a UTXO.
#[derive(Debug, Clone, Hash, PartialEq, Eq, PartialOrd, Ord)]
pub struct ScriptPubKey(bitcoin::ScriptBuf);
pub struct ScriptPubKey(pub bitcoin::ScriptBuf);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that we should make this public. We should have what we need with our Deref and From implementations.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeaaa, it is still dirty, but I was struggling a bit to extract inner from it, so temporarly did this =(

@MCJOHN974
Copy link
Collaborator Author

Well, if it passes also in CI I'd say that major part of work is done. There are a lot of cleanup to do, and some test cases to cover (for example when withdrawal request was far enough to be rejected). But I think it will be much less work than this base test cases, so if they are ok I think we will be able to merge it soon

@MCJOHN974
Copy link
Collaborator Author

Hey, @djordon ! I know that this PR still need some polishing, removing debug prints and some style improvements. But can you please confirm/refute that this test describes coordinator behaviour we expect?

Also maybe you see some important test cases I didn't add?

@djordon
Copy link
Collaborator

djordon commented Feb 22, 2025

Hey, @djordon ! I know that this PR still need some polishing, removing debug prints and some style improvements. But can you please confirm/refute that this test describes coordinator behaviour we expect?

Also maybe you see some important test cases I didn't add?

I think the test is confirms the behavior that we expect, specifically the #[test_case(false, false, false; "accept")] test case is the one that we care about. You can remove the other cases if you like and simplify things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
withdrawal The withdrawal sBTC operation.
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

[Feature]: Sign and broadcast accept-withdrawal-requests contract calls
2 participants