Skip to content

Commit

Permalink
Merge #759: fix: fix typo for MaxWitnessItemsExceeded
Browse files Browse the repository at this point in the history
3b7be4e fix: fix typo for MaxWitnessItemsExceeded (ChrisCho-H)

Pull request description:

  Just fix the typo. Rename `MaxWitnessItemssExceeded` to `MaxWitnessItemsExceeded`.

ACKs for top commit:
  apoelstra:
    ACK 3b7be4e; successfully ran local tests

Tree-SHA512: 2cba995233793a4017791f5be24e3c1ae8d17292d5a97a5b79d8df79f70ff93870c113ca6677b92b6d66b7a8450e175d8456f886d79dc013e3a0e45f462f92b6
  • Loading branch information
apoelstra committed Oct 18, 2024
2 parents 33b417b + 3b7be4e commit 59506c6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/miniscript/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub enum ScriptContextError {
UncompressedKeysNotAllowed,
/// At least one satisfaction path in the Miniscript fragment has more than
/// `MAX_STANDARD_P2WSH_STACK_ITEMS` (100) witness elements.
MaxWitnessItemssExceeded { actual: usize, limit: usize },
MaxWitnessItemsExceeded { actual: usize, limit: usize },
/// At least one satisfaction path in the Miniscript fragment contains more
/// than `MAX_OPS_PER_SCRIPT`(201) opcodes.
MaxOpCountExceeded,
Expand Down Expand Up @@ -79,7 +79,7 @@ impl error::Error for ScriptContextError {
| CompressedOnly(_)
| XOnlyKeysNotAllowed(_, _)
| UncompressedKeysNotAllowed
| MaxWitnessItemssExceeded { .. }
| MaxWitnessItemsExceeded { .. }
| MaxOpCountExceeded
| MaxWitnessScriptSizeExceeded
| MaxRedeemScriptSizeExceeded
Expand Down Expand Up @@ -110,7 +110,7 @@ impl fmt::Display for ScriptContextError {
ScriptContextError::UncompressedKeysNotAllowed => {
write!(f, "uncompressed keys cannot be used in Taproot descriptors.")
}
ScriptContextError::MaxWitnessItemssExceeded { actual, limit } => write!(
ScriptContextError::MaxWitnessItemsExceeded { actual, limit } => write!(
f,
"At least one spending path in the Miniscript fragment has {} more \
witness items than limit {}.",
Expand Down Expand Up @@ -498,7 +498,7 @@ impl ScriptContext for Segwitv0 {

fn check_witness(witness: &[Vec<u8>]) -> Result<(), ScriptContextError> {
if witness.len() > MAX_STANDARD_P2WSH_STACK_ITEMS {
return Err(ScriptContextError::MaxWitnessItemssExceeded {
return Err(ScriptContextError::MaxWitnessItemsExceeded {
actual: witness.len(),
limit: MAX_STANDARD_P2WSH_STACK_ITEMS,
});
Expand Down Expand Up @@ -565,7 +565,7 @@ impl ScriptContext for Segwitv0 {
// No possible satisfactions
Err(_e) => Err(ScriptContextError::ImpossibleSatisfaction),
Ok(max_witness_items) if max_witness_items > MAX_STANDARD_P2WSH_STACK_ITEMS => {
Err(ScriptContextError::MaxWitnessItemssExceeded {
Err(ScriptContextError::MaxWitnessItemsExceeded {
actual: max_witness_items,
limit: MAX_STANDARD_P2WSH_STACK_ITEMS,
})
Expand Down Expand Up @@ -612,7 +612,7 @@ impl ScriptContext for Tap {
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 {
return Err(ScriptContextError::MaxWitnessItemsExceeded {
actual: witness.len(),
limit: MAX_STACK_SIZE,
});
Expand Down

0 comments on commit 59506c6

Please sign in to comment.