@@ -23,9 +23,8 @@ impl Translator<String, XOnlyPublicKey, ()> for StrPkTranslator {
23
23
self . pk_map . get ( pk) . copied ( ) . ok_or ( ( ) )
24
24
}
25
25
26
- // We don't need to implement these methods as we are not using them in the policy
27
- // Fail if we encounter any hash fragments.
28
- // See also translate_hash_clone! macro
26
+ // We don't need to implement these methods as we are not using them in the policy.
27
+ // Fail if we encounter any hash fragments. See also translate_hash_clone! macro.
29
28
translate_hash_fail ! ( String , XOnlyPublicKey , ( ) ) ;
30
29
}
31
30
@@ -54,7 +53,7 @@ fn main() {
54
53
// Check whether the descriptors are safe.
55
54
assert ! ( desc. sanity_check( ) . is_ok( ) ) ;
56
55
57
- // Descriptor Type and Version should match respectively for Taproot
56
+ // Descriptor type and version should match respectively for taproot
58
57
let desc_type = desc. desc_type ( ) ;
59
58
assert_eq ! ( desc_type, DescriptorType :: Tr ) ;
60
59
assert_eq ! ( desc_type. segwit_version( ) . unwrap( ) , WitnessVersion :: V1 ) ;
@@ -101,11 +100,12 @@ fn main() {
101
100
102
101
let real_desc = desc. translate_pk ( & mut t) . unwrap ( ) ;
103
102
104
- // Max Satisfaction Weight for compilation, corresponding to the script-path spend
105
- // `multi_a(2,PUBKEY_1,PUBKEY_2) at taptree depth 1, having
106
- // Max Witness Size = varint(control_block_size) + control_block size +
107
- // varint(script_size) + script_size + max_satisfaction_size
108
- // = 1 + 65 + 1 + 70 + 132 = 269
103
+ // Max satisfaction weight for compilation, corresponding to the script-path spend
104
+ // `multi_a(2,PUBKEY_1,PUBKEY_2) at taptree depth 1, having:
105
+ //
106
+ // max_witness_size = varint(control_block_size) + control_block size +
107
+ // varint(script_size) + script_size + max_satisfaction_size
108
+ // = 1 + 65 + 1 + 70 + 132 = 269
109
109
let max_sat_wt = real_desc. max_weight_to_satisfy ( ) . unwrap ( ) ;
110
110
assert_eq ! ( max_sat_wt, 269 ) ;
111
111
0 commit comments