Skip to content

Commit ede114f

Browse files
committed
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.
1 parent fbc64c7 commit ede114f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/key.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,7 @@ impl XOnlyPublicKey {
867867
}
868868
}
869869

870-
/// Verify that a tweak produced by `tweak_add_assign` was computed correctly
870+
/// Verify that a tweak produced by `tweak_add_assign` was computed correctly.
871871
///
872872
/// Should be called on the original untweaked key. Takes the tweaked key and
873873
/// output parity from `tweak_add_assign` as input.
@@ -876,6 +876,9 @@ impl XOnlyPublicKey {
876876
/// and checking equality. However, in future this API will support batch
877877
/// verification, which is significantly faster, so it is wise to design
878878
/// protocols with this in mind.
879+
///
880+
/// # Return
881+
/// True if tweak and check is successful, false otherwise.
879882
pub fn tweak_add_check<V: Verification>(
880883
&self,
881884
secp: &Secp256k1<V>,

0 commit comments

Comments
 (0)