doc: Use add_tweak in example code

In preparation for removing the deprecated `tweak_add_check` use the new
version `add_tweak` instead.
This commit is contained in:
Tobin C. Harding 2022-11-10 11:26:26 +11:00
parent eedbd0b7e4
commit e779e5dc05
1 changed files with 2 additions and 2 deletions

View File

@ -1380,8 +1380,8 @@ impl XOnlyPublicKey {
/// let mut key_pair = KeyPair::new(&secp, &mut thread_rng());
/// let (mut public_key, _) = key_pair.x_only_public_key();
/// let original = public_key;
/// let parity = public_key.tweak_add_assign(&secp, &tweak).expect("Improbable to fail with a randomly generated tweak");
/// assert!(original.tweak_add_check(&secp, &public_key, parity, tweak));
/// let (tweaked, parity) = public_key.add_tweak(&secp, &tweak).expect("Improbable to fail with a randomly generated tweak");
/// assert!(original.tweak_add_check(&secp, &tweaked, parity, tweak));
/// # }
/// ```
pub fn tweak_add_check<V: Verification>(