Add missing derives to newtypes.
This commit is contained in:
parent
32cf74db39
commit
733d090b9b
|
@ -16,11 +16,14 @@ impl<'a> From<&'a [u8]> for Sha256dChecksum {
|
|||
}
|
||||
|
||||
/// A u32 which represents a block height value.
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
||||
pub struct BlockHeight(pub u32);
|
||||
|
||||
/// InventoryType
|
||||
///
|
||||
/// [Bitcoin·reference](https://en.bitcoin.it/wiki/Protocol_documentation#Inventory_Vectors)
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
||||
#[repr(u8)]
|
||||
pub enum InventoryType {
|
||||
/// Any data of with this number may be ignored.
|
||||
Error = 0x00,
|
||||
|
@ -48,6 +51,7 @@ pub enum InventoryType {
|
|||
}
|
||||
|
||||
/// Inventory Vector
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
||||
pub struct InventoryVector(pub InventoryType, pub [u8; 32]);
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
|
@ -37,6 +37,7 @@ use crate::types::*;
|
|||
// the serialized message data and the internal representation. Note that this
|
||||
// is different from messages like GetAddr which have no data (and so have no
|
||||
// fields).
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub enum Message {
|
||||
/// A `version` message.
|
||||
///
|
||||
|
@ -245,6 +246,7 @@ pub enum Message {
|
|||
/// Reject Reason CCodes
|
||||
///
|
||||
/// [Bitcoin reference](https://en.bitcoin.it/wiki/Protocol_documentation#reject)
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
||||
#[repr(u8)]
|
||||
#[allow(missing_docs)]
|
||||
pub enum RejectReason {
|
||||
|
|
|
@ -8,6 +8,7 @@ use crate::types::Services;
|
|||
/// An address with metadata on its advertised services and last-seen time.
|
||||
///
|
||||
/// [Bitcoin reference](https://en.bitcoin.it/wiki/Protocol_documentation#Network_address)
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
||||
pub struct MetaAddr {
|
||||
/// The peer's address.
|
||||
pub addr: SocketAddr,
|
||||
|
|
Loading…
Reference in New Issue