Skip to content

Commit d501a13

Browse files
committed
use max_weight_to_satisfy instead of deprecated max_satisfaction_weight
1 parent d3f638d commit d501a13

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/descriptor/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -347,12 +347,12 @@ impl<Pk: MiniscriptKey> Descriptor<Pk> {
347347
)]
348348
pub fn max_satisfaction_weight(&self) -> Result<usize, Error> {
349349
let weight = match *self {
350-
Descriptor::Bare(ref bare) => bare.max_satisfaction_weight()?,
351-
Descriptor::Pkh(ref pkh) => pkh.max_satisfaction_weight(),
352-
Descriptor::Wpkh(ref wpkh) => wpkh.max_satisfaction_weight(),
353-
Descriptor::Wsh(ref wsh) => wsh.max_satisfaction_weight()?,
354-
Descriptor::Sh(ref sh) => sh.max_satisfaction_weight()?,
355-
Descriptor::Tr(ref tr) => tr.max_satisfaction_weight()?,
350+
Descriptor::Bare(ref bare) => bare.max_weight_to_satisfy()?,
351+
Descriptor::Pkh(ref pkh) => pkh.max_weight_to_satisfy(),
352+
Descriptor::Wpkh(ref wpkh) => wpkh.max_weight_to_satisfy(),
353+
Descriptor::Wsh(ref wsh) => wsh.max_weight_to_satisfy()?,
354+
Descriptor::Sh(ref sh) => sh.max_weight_to_satisfy()?,
355+
Descriptor::Tr(ref tr) => tr.max_weight_to_satisfy()?,
356356
};
357357
Ok(weight)
358358
}

src/descriptor/sh.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,15 +239,15 @@ impl<Pk: MiniscriptKey> Sh<Pk> {
239239
pub fn max_satisfaction_weight(&self) -> Result<usize, Error> {
240240
Ok(match self.inner {
241241
// add weighted script sig, len byte stays the same
242-
ShInner::Wsh(ref wsh) => 4 * 35 + wsh.max_satisfaction_weight()?,
242+
ShInner::Wsh(ref wsh) => 4 * 35 + wsh.max_weight_to_satisfy()?,
243243
ShInner::SortedMulti(ref smv) => {
244244
let ss = smv.script_size();
245245
let ps = push_opcode_size(ss);
246246
let scriptsig_len = ps + ss + smv.max_satisfaction_size();
247247
4 * (varint_len(scriptsig_len) + scriptsig_len)
248248
}
249249
// add weighted script sig, len byte stays the same
250-
ShInner::Wpkh(ref wpkh) => 4 * 23 + wpkh.max_satisfaction_weight(),
250+
ShInner::Wpkh(ref wpkh) => 4 * 23 + wpkh.max_weight_to_satisfy(),
251251
ShInner::Ms(ref ms) => {
252252
let ss = ms.script_size();
253253
let ps = push_opcode_size(ss);

0 commit comments

Comments
 (0)