Removed public accessor on htlc policy creation
This commit is contained in:
@@ -33,16 +33,6 @@ impl Htlc {
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn to_miniscript_policy(&self) -> Concrete<bdk::bitcoin::PublicKey> {
|
||||
Concrete::<bdk::bitcoin::PublicKey>::from_str(&format!(
|
||||
"or(10@and(sha256({secret_hash}),pk({redeem_identity})),1@and(older({expiry}),pk({refund_identity})))",
|
||||
secret_hash = self.hashlock,
|
||||
redeem_identity = self.redeem_identity,
|
||||
refund_identity = self.refund_indentiy,
|
||||
expiry = self.refund_timelock
|
||||
)).expect("Policy compilation only fails on resource limits or mixed timelocks")
|
||||
}
|
||||
|
||||
pub(crate) fn to_miniscript_descriptor(&self) -> Wsh<bdk::bitcoin::PublicKey> {
|
||||
let htlc_descriptor = Wsh::new(
|
||||
self.to_miniscript_policy()
|
||||
@@ -55,4 +45,14 @@ impl Htlc {
|
||||
|
||||
htlc_descriptor
|
||||
}
|
||||
|
||||
fn to_miniscript_policy(&self) -> Concrete<bdk::bitcoin::PublicKey> {
|
||||
Concrete::<bdk::bitcoin::PublicKey>::from_str(&format!(
|
||||
"or(10@and(sha256({secret_hash}),pk({redeem_identity})),1@and(older({expiry}),pk({refund_identity})))",
|
||||
secret_hash = self.hashlock,
|
||||
redeem_identity = self.redeem_identity,
|
||||
refund_identity = self.refund_indentiy,
|
||||
expiry = self.refund_timelock
|
||||
)).expect("Policy compilation only fails on resource limits or mixed timelocks")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user