Skip to content

Commit ef3abb6

Browse files
committed
Merge #644: remove unused generic on check_witness
d958d21 remove unused generic on check_witness (Riccardo Casatta) Pull request description: ACKs for top commit: apoelstra: ACK d958d21 Tree-SHA512: ec9c828e75949cceef165bfb195ea105c41bad9058aa24b787f6a034ac2e53215f4a62f4405361be9fd4aa4b5bdd77f6521e38887c7c13debaae94c853f1c909
2 parents 666918f + d958d21 commit ef3abb6

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/miniscript/context.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ where
188188
/// Check whether the given satisfaction is valid under the ScriptContext
189189
/// For example, segwit satisfactions may fail if the witness len is more
190190
/// 3600 or number of stack elements are more than 100.
191-
fn check_witness<Pk: MiniscriptKey>(_witness: &[Vec<u8>]) -> Result<(), ScriptContextError> {
191+
fn check_witness(_witness: &[Vec<u8>]) -> Result<(), ScriptContextError> {
192192
// Only really need to do this for segwitv0 and legacy
193193
// Bare is already restrcited by standardness rules
194194
// and would reach these limits.
@@ -387,7 +387,7 @@ impl ScriptContext for Legacy {
387387
}
388388
}
389389

390-
fn check_witness<Pk: MiniscriptKey>(witness: &[Vec<u8>]) -> Result<(), ScriptContextError> {
390+
fn check_witness(witness: &[Vec<u8>]) -> Result<(), ScriptContextError> {
391391
// In future, we could avoid by having a function to count only
392392
// len of script instead of converting it.
393393
if witness_to_scriptsig(witness).len() > MAX_SCRIPTSIG_SIZE {
@@ -487,7 +487,7 @@ impl ScriptContext for Segwitv0 {
487487
}
488488
}
489489

490-
fn check_witness<Pk: MiniscriptKey>(witness: &[Vec<u8>]) -> Result<(), ScriptContextError> {
490+
fn check_witness(witness: &[Vec<u8>]) -> Result<(), ScriptContextError> {
491491
if witness.len() > MAX_STANDARD_P2WSH_STACK_ITEMS {
492492
return Err(ScriptContextError::MaxWitnessItemssExceeded {
493493
actual: witness.len(),
@@ -595,7 +595,7 @@ impl ScriptContext for Tap {
595595
}
596596
}
597597

598-
fn check_witness<Pk: MiniscriptKey>(witness: &[Vec<u8>]) -> Result<(), ScriptContextError> {
598+
fn check_witness(witness: &[Vec<u8>]) -> Result<(), ScriptContextError> {
599599
// Note that tapscript has a 1000 limit compared to 100 of segwitv0
600600
if witness.len() > MAX_STACK_SIZE {
601601
return Err(ScriptContextError::MaxWitnessItemssExceeded {
@@ -828,7 +828,7 @@ impl ScriptContext for NoChecks {
828828
"NochecksEcdsa"
829829
}
830830

831-
fn check_witness<Pk: MiniscriptKey>(_witness: &[Vec<u8>]) -> Result<(), ScriptContextError> {
831+
fn check_witness(_witness: &[Vec<u8>]) -> Result<(), ScriptContextError> {
832832
// Only really need to do this for segwitv0 and legacy
833833
// Bare is already restrcited by standardness rules
834834
// and would reach these limits.

src/miniscript/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ impl<Pk: MiniscriptKey, Ctx: ScriptContext> Miniscript<Pk, Ctx> {
224224
{
225225
match satisfaction.stack {
226226
satisfy::Witness::Stack(stack) => {
227-
Ctx::check_witness::<Pk>(&stack)?;
227+
Ctx::check_witness(&stack)?;
228228
Ok(stack)
229229
}
230230
satisfy::Witness::Unavailable | satisfy::Witness::Impossible => {

0 commit comments

Comments
 (0)