Skip to content

Commit

Permalink
remove unused generic on check_witness
Browse files Browse the repository at this point in the history
  • Loading branch information
RCasatta committed Feb 26, 2024
1 parent 18b1b30 commit d958d21
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/miniscript/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ where
/// Check whether the given satisfaction is valid under the ScriptContext
/// For example, segwit satisfactions may fail if the witness len is more
/// 3600 or number of stack elements are more than 100.
fn check_witness<Pk: MiniscriptKey>(_witness: &[Vec<u8>]) -> Result<(), ScriptContextError> {
fn check_witness(_witness: &[Vec<u8>]) -> Result<(), ScriptContextError> {
// Only really need to do this for segwitv0 and legacy
// Bare is already restrcited by standardness rules
// and would reach these limits.
Expand Down Expand Up @@ -387,7 +387,7 @@ impl ScriptContext for Legacy {
}
}

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

fn check_witness<Pk: MiniscriptKey>(witness: &[Vec<u8>]) -> Result<(), ScriptContextError> {
fn check_witness(witness: &[Vec<u8>]) -> Result<(), ScriptContextError> {
if witness.len() > MAX_STANDARD_P2WSH_STACK_ITEMS {
return Err(ScriptContextError::MaxWitnessItemssExceeded {
actual: witness.len(),
Expand Down Expand Up @@ -595,7 +595,7 @@ impl ScriptContext for Tap {
}
}

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

fn check_witness<Pk: MiniscriptKey>(_witness: &[Vec<u8>]) -> Result<(), ScriptContextError> {
fn check_witness(_witness: &[Vec<u8>]) -> Result<(), ScriptContextError> {
// Only really need to do this for segwitv0 and legacy
// Bare is already restrcited by standardness rules
// and would reach these limits.
Expand Down
2 changes: 1 addition & 1 deletion src/miniscript/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ impl<Pk: MiniscriptKey, Ctx: ScriptContext> Miniscript<Pk, Ctx> {
{
match satisfaction.stack {
satisfy::Witness::Stack(stack) => {
Ctx::check_witness::<Pk>(&stack)?;
Ctx::check_witness(&stack)?;
Ok(stack)
}
satisfy::Witness::Unavailable | satisfy::Witness::Impossible => {
Expand Down

0 comments on commit d958d21

Please sign in to comment.