Non-API breaking derives for error types

This commit is contained in:
Dr Maxim Orlovsky 2021-01-30 14:17:14 +01:00
parent 1326f7d2a8
commit 7fe3c4a605
No known key found for this signature in database
GPG Key ID: FFC0250947E5C6F7
3 changed files with 4 additions and 6 deletions

View File

@ -173,7 +173,7 @@ impl ::std::str::FromStr for OutPoint {
} }
/// A transaction input, which defines old coins to be consumed /// A transaction input, which defines old coins to be consumed
#[derive(Clone, PartialEq, Eq, Debug, Hash)] #[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct TxIn { pub struct TxIn {
/// The reference to the previous output that is being used an an input /// The reference to the previous output that is being used an an input
@ -206,7 +206,7 @@ impl Default for TxIn {
} }
/// A transaction output, which defines new coins to be created from old ones. /// A transaction output, which defines new coins to be created from old ones.
#[derive(Clone, PartialEq, Eq, Debug, Hash)] #[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct TxOut { pub struct TxOut {
/// The value of the output, in satoshis /// The value of the output, in satoshis
@ -252,7 +252,7 @@ impl Default for TxOut {
/// ///
/// We therefore deviate from the spec by always using the Segwit witness encoding /// We therefore deviate from the spec by always using the Segwit witness encoding
/// for 0-input transactions, which results in unambiguously parseable transactions. /// for 0-input transactions, which results in unambiguously parseable transactions.
#[derive(Clone, PartialEq, Eq, Debug, Hash)] #[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct Transaction { pub struct Transaction {
/// The protocol version, is currently expected to be 1 or 2 (BIP 68). /// The protocol version, is currently expected to be 1 or 2 (BIP 68).

View File

@ -118,8 +118,6 @@ impl error::Error for Error {
} }
} }
#[doc(hidden)]
#[doc(hidden)] #[doc(hidden)]
impl From<io::Error> for Error { impl From<io::Error> for Error {
fn from(error: io::Error) -> Self { fn from(error: io::Error) -> Self {

View File

@ -21,7 +21,7 @@ use hashes::{sha256d, Hash};
use util::endian; use util::endian;
/// An error that might occur during base58 decoding /// An error that might occur during base58 decoding
#[derive(Debug, PartialEq, Eq, Clone)] #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone)]
pub enum Error { pub enum Error {
/// Invalid character encountered /// Invalid character encountered
BadByte(u8), BadByte(u8),