From 4f0eafa2b14e7013213cd2dc4a232687bc746645 Mon Sep 17 00:00:00 2001 From: Jose Storopoli Date: Sat, 11 May 2024 15:27:33 +0000 Subject: [PATCH] psbt: documentation examples for PsbtSighashType --- bitcoin/src/psbt/map/input.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bitcoin/src/psbt/map/input.rs b/bitcoin/src/psbt/map/input.rs index 152c6f5b4..cfe778111 100644 --- a/bitcoin/src/psbt/map/input.rs +++ b/bitcoin/src/psbt/map/input.rs @@ -136,6 +136,16 @@ pub struct Input { /// type can be either [`EcdsaSighashType`] or [`TapSighashType`] but it is not possible to know /// directly which signature hash type the user is dealing with. Therefore, the user is responsible /// for converting to/from [`PsbtSighashType`] from/to the desired signature hash type they need. +/// +/// # Examples +/// +/// ``` +/// use bitcoin::{EcdsaSighashType, TapSighashType}; +/// use bitcoin::psbt::PsbtSighashType; +/// +/// let ecdsa_sighash_all: PsbtSighashType = EcdsaSighashType::All.into(); +/// let tap_sighash_all: PsbtSighashType = TapSighashType::All.into(); +/// ``` #[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", serde(crate = "actual_serde"))]