mirror of
https://github.com/Qortal/pirate-librustzcash.git
synced 2025-11-14 01:57:03 +00:00
impl Display for BlockHash and TxId
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt};
|
||||
use hex;
|
||||
use sapling_crypto::redjubjub::Signature;
|
||||
use std::fmt;
|
||||
use std::io::{self, Read, Write};
|
||||
use std::ops::Deref;
|
||||
|
||||
@@ -23,6 +25,14 @@ const SAPLING_TX_VERSION: u32 = 4;
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
|
||||
pub struct TxId(pub [u8; 32]);
|
||||
|
||||
impl fmt::Display for TxId {
|
||||
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
|
||||
let mut data = self.0.to_vec();
|
||||
data.reverse();
|
||||
formatter.write_str(&hex::encode(data))
|
||||
}
|
||||
}
|
||||
|
||||
/// A Zcash transaction.
|
||||
#[derive(Debug)]
|
||||
pub struct Transaction(TransactionData);
|
||||
|
||||
Reference in New Issue
Block a user