From ede114fb1a82206824dc678c3ea1a19df718f41d Mon Sep 17 00:00:00 2001 From: Tobin Harding Date: Tue, 4 Jan 2022 08:52:56 +1100 Subject: [PATCH] Improve docs on tweak_add_check method It is not immediately apparent what 'err == 1' means, one must determine that the FFI function call returns 1 for success. We can help readers of the code by adding a 'Return' section to the method documentation. Add trailing full stop to method docs initial line also. --- src/key.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/key.rs b/src/key.rs index 791b63b..8415ac7 100644 --- a/src/key.rs +++ b/src/key.rs @@ -867,7 +867,7 @@ impl XOnlyPublicKey { } } - /// Verify that a tweak produced by `tweak_add_assign` was computed correctly + /// Verify that a tweak produced by `tweak_add_assign` was computed correctly. /// /// Should be called on the original untweaked key. Takes the tweaked key and /// output parity from `tweak_add_assign` as input. @@ -876,6 +876,9 @@ impl XOnlyPublicKey { /// and checking equality. However, in future this API will support batch /// verification, which is significantly faster, so it is wise to design /// protocols with this in mind. + /// + /// # Return + /// True if tweak and check is successful, false otherwise. pub fn tweak_add_check( &self, secp: &Secp256k1,