Merge pull request #95 from alekseysidorov/impl-standard-traits

Added Ord and Hash implementations for the Address type
This commit is contained in:
Andrew Poelstra 2018-08-20 14:10:05 +00:00 committed by GitHub
commit dca4cb4d54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -49,7 +49,7 @@ pub const USER_AGENT: &'static str = "bitcoin-rust v0.1";
user_enum! { user_enum! {
/// The cryptocurrency to act on /// The cryptocurrency to act on
#[derive(Copy, PartialEq, Eq, Clone, Hash)] #[derive(Copy, PartialEq, Eq, PartialOrd, Ord, Clone, Hash)]
pub enum Network { pub enum Network {
/// Classic Bitcoin /// Classic Bitcoin
Bitcoin <-> "bitcoin", Bitcoin <-> "bitcoin",

View File

@ -30,7 +30,7 @@ use util::base58;
use util::Error; use util::Error;
/// The method used to produce an address /// The method used to produce an address
#[derive(Clone, PartialEq, Debug)] #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub enum Payload { pub enum Payload {
/// pay-to-pubkey /// pay-to-pubkey
Pubkey(PublicKey), Pubkey(PublicKey),
@ -42,7 +42,7 @@ pub enum Payload {
WitnessProgram(WitnessProgram), WitnessProgram(WitnessProgram),
} }
#[derive(Clone, PartialEq)] #[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
/// A Bitcoin address /// A Bitcoin address
pub struct Address { pub struct Address {
/// The type of the address /// The type of the address