Skip to content

Commit d981a95

Browse files
committed
examples: taproot: Do minor docs cleanup
1 parent b1ce6cd commit d981a95

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

examples/taproot.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ impl Translator<String, XOnlyPublicKey, ()> for StrPkTranslator {
2323
self.pk_map.get(pk).copied().ok_or(())
2424
}
2525

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.
2928
translate_hash_fail!(String, XOnlyPublicKey, ());
3029
}
3130

@@ -54,7 +53,7 @@ fn main() {
5453
// Check whether the descriptors are safe.
5554
assert!(desc.sanity_check().is_ok());
5655

57-
// Descriptor Type and Version should match respectively for Taproot
56+
// Descriptor type and version should match respectively for taproot
5857
let desc_type = desc.desc_type();
5958
assert_eq!(desc_type, DescriptorType::Tr);
6059
assert_eq!(desc_type.segwit_version().unwrap(), WitnessVersion::V1);
@@ -101,11 +100,12 @@ fn main() {
101100

102101
let real_desc = desc.translate_pk(&mut t).unwrap();
103102

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
109109
let max_sat_wt = real_desc.max_weight_to_satisfy().unwrap();
110110
assert_eq!(max_sat_wt, 269);
111111

0 commit comments

Comments
 (0)