1
0
mirror of https://github.com/bitcoin/bips.git synced 2026-07-27 18:13:38 +00:00

bip360 test vectors: non-standard leaf version should be allowed during construction of P2MR output (#46)

This commit is contained in:
jbride
2026-04-22 10:35:07 -06:00
committed by notmike
parent 35b9ffe21b
commit 907db20348
3 changed files with 7 additions and 1 deletions

View File

@@ -57,7 +57,7 @@
}, },
{ {
"id": "p2mr_different_version_leaves", "id": "p2mr_different_version_leaves",
"objective": "Tests P2MR with two script leaves of different versions. TO-DO: currently ignores given leaf version and over-rides. Probably better to throw error", "objective": "Tests P2MR with two script leaves of different versions. An unknown leaf version should be accepted and the P2MR output constructed successfully.",
"given": { "given": {
"scriptTree": [ "scriptTree": [
{ {

View File

@@ -65,6 +65,9 @@ fn test_p2mr_single_leaf_script_tree() {
process_test_vector_p2mr(test_vector).unwrap(); process_test_vector_p2mr(test_vector).unwrap();
} }
/// Verifies that P2MR construction succeeds when leaves carry non-standard leaf versions (e.g. 0xfa).
/// Unknown leaf versions are accepted: the TapLeaf hash is computed using the supplied version,
/// and the resulting merkle root and control blocks are valid.
#[test] #[test]
fn test_p2mr_different_version_leaves() { fn test_p2mr_different_version_leaves() {

View File

@@ -52,6 +52,9 @@ fn test_p2mr_pqc_single_leaf_script_tree() {
process_test_vector_p2mr(test_vector).unwrap(); process_test_vector_p2mr(test_vector).unwrap();
} }
/// Verifies that P2MR construction succeeds when leaves carry non-standard leaf versions (e.g. 0xfa).
/// Unknown leaf versions are accepted: the TapLeaf hash is computed using the supplied version,
/// and the resulting merkle root and control blocks are valid.
#[test] #[test]
fn test_p2mr_pqc_different_version_leaves() { fn test_p2mr_pqc_different_version_leaves() {