Improve rusntdocs for *_hash_ty methods
Improve the docs by doing: - Use markdown heading for `Errors` section - Use 100 character lines
This commit is contained in:
parent
f733dc0bbf
commit
7638d59fa6
|
@ -191,22 +191,24 @@ impl PsbtSigHashType {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Input {
|
impl Input {
|
||||||
/// Obtains the [`EcdsaSigHashType`] for this input if one is specified.
|
/// Obtains the [`EcdsaSigHashType`] for this input if one is specified. If no sighash type is
|
||||||
/// If no sighash type is specified, returns ['EcdsaSigHashType::All']
|
/// specified, returns [`EcdsaSigHashType::All`].
|
||||||
///
|
///
|
||||||
/// Errors:
|
/// # Errors
|
||||||
/// If the sighash type is not a standard ecdsa sighash type
|
///
|
||||||
|
/// If the `sighash_type` field is set to a non-standard ECDSA sighash value.
|
||||||
pub fn ecdsa_hash_ty(&self) -> Result<EcdsaSigHashType, NonStandardSigHashType> {
|
pub fn ecdsa_hash_ty(&self) -> Result<EcdsaSigHashType, NonStandardSigHashType> {
|
||||||
self.sighash_type
|
self.sighash_type
|
||||||
.map(|sighash_type| sighash_type.ecdsa_hash_ty())
|
.map(|sighash_type| sighash_type.ecdsa_hash_ty())
|
||||||
.unwrap_or(Ok(EcdsaSigHashType::All))
|
.unwrap_or(Ok(EcdsaSigHashType::All))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Obtains the [`SchnorrSigHashType`] for this input if one is specified.
|
/// Obtains the [`SchnorrSigHashType`] for this input if one is specified. If no sighash type is
|
||||||
/// If no sighash type is specified, returns ['SchnorrSigHashType::Default']
|
/// specified, returns [`SchnorrSigHashType::Default`].
|
||||||
///
|
///
|
||||||
/// Errors:
|
/// # Errors
|
||||||
/// If the sighash type is an invalid schnorr sighash type
|
///
|
||||||
|
/// If the `sighash_type` field is set to a invalid Schnorr sighash value.
|
||||||
pub fn schnorr_hash_ty(&self) -> Result<SchnorrSigHashType, sighash::Error> {
|
pub fn schnorr_hash_ty(&self) -> Result<SchnorrSigHashType, sighash::Error> {
|
||||||
self.sighash_type
|
self.sighash_type
|
||||||
.map(|sighash_type| sighash_type.schnorr_hash_ty())
|
.map(|sighash_type| sighash_type.schnorr_hash_ty())
|
||||||
|
|
Loading…
Reference in New Issue