Skip to content

QA-BitVMX: Added test scenarios to cover witness construction.#80

Merged
andrelo86 merged 2 commits intodevfrom
witness_coverage
Mar 3, 2026
Merged

QA-BitVMX: Added test scenarios to cover witness construction.#80
andrelo86 merged 2 commits intodevfrom
witness_coverage

Conversation

@andrelo86
Copy link
Collaborator

@andrelo86 andrelo86 commented Feb 23, 2026

Test Scenarios: Witness Construction & Leaf Selection
1.P2WSH Skip‑Signing Witness
Objective: Validate witness construction for SegWit script with no signature (SignMode::Skip).

2.Taproot Witness: Invalid Leaf Index
Objective: Ensure invalid leaf index is rejected during witness building.

  1. Taproot Mixed SignModes in Single Output

  2. Witness Stack Order and Correctness Validation

  3. Taproot Skip-Mode with Multiple Inputs
    Objective: Validate that Skip-mode leaves do not interfere with signature-requiring leaves when multiple inputs exist in same transaction.

https://github.com/orgs/FairgateLabs/projects/4/views/1?pane=issue&itemId=134592380

@andrelo86 andrelo86 merged commit d44d22b into dev Mar 3, 2026
1 check passed
@andrelo86 andrelo86 deleted the witness_coverage branch March 3, 2026 14:23
Comment on lines +1768 to +1772
// Verify the script is present in witness (second-to-last element for taproot)
assert!(
witness.len() >= 2,
"Witness must contain script and control block"
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this second assert does not make sense

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, redundant. Will be removed in following PR

.derive_keypair(BitcoinKeyType::P2tr, 0)
.unwrap();

let _ecdsa_key = tc
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the use of _ is for unused variables

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants