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

feat: sign and broadcast accept-withdrawal contract call #1403

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions signer/src/storage/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,14 @@ impl SweptWithdrawalRequest {
vout: 2, // TODO: This field will be stored in the database
}
}
/// Return the identifier for the withdrawal request.
pub fn qualified_id(&self) -> QualifiedRequestId {
QualifiedRequestId {
request_id: self.request_id,
txid: self.txid,
block_hash: self.block_hash,
}
}
}

/// Persisted DKG shares
Expand Down Expand Up @@ -688,6 +696,12 @@ pub struct QualifiedRequestId {
pub block_hash: StacksBlockHash,
}

impl std::fmt::Display for QualifiedRequestId {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}:{}", self.request_id, self.block_hash)
}
}

/// This trait adds a function for converting a type into bytes to
/// little-endian byte order. This is because stacks-core expects
/// bitcoin block hashes to be in little-endian byte order when evaluating
Expand Down
Loading
Loading