From 8e15c16b425aa5dfe751be726bfa65b788c4c57f Mon Sep 17 00:00:00 2001 From: Henry de Valence Date: Mon, 17 Aug 2020 02:28:55 -0700 Subject: [PATCH] chain: TransparentAddress -> transparent::Address --- zebra-chain/src/transparent.rs | 2 +- zebra-chain/src/transparent/address.rs | 54 +++++++++++++------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/zebra-chain/src/transparent.rs b/zebra-chain/src/transparent.rs index f2245e2ca..a87136327 100644 --- a/zebra-chain/src/transparent.rs +++ b/zebra-chain/src/transparent.rs @@ -6,7 +6,7 @@ mod keys; mod script; mod serialize; -pub use address::TransparentAddress; +pub use address::Address; pub use script::Script; #[cfg(test)] diff --git a/zebra-chain/src/transparent/address.rs b/zebra-chain/src/transparent/address.rs index 2593b2b4b..29e0213f8 100644 --- a/zebra-chain/src/transparent/address.rs +++ b/zebra-chain/src/transparent/address.rs @@ -42,7 +42,7 @@ mod magics { /// /// https://zips.z.cash/protocol/protocol.pdf#transparentaddrencoding #[derive(Copy, Clone, Eq, PartialEq)] -pub enum TransparentAddress { +pub enum Address { /// P2SH (Pay to Script Hash) addresses PayToScriptHash { /// Production, test, or other network @@ -60,19 +60,19 @@ pub enum TransparentAddress { }, } -impl fmt::Debug for TransparentAddress { +impl fmt::Debug for Address { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let mut debug_struct = f.debug_struct("TransparentAddress"); match self { - TransparentAddress::PayToScriptHash { + Address::PayToScriptHash { network, script_hash, } => debug_struct .field("network", network) .field("script_hash", &hex::encode(script_hash)) .finish(), - TransparentAddress::PayToPublicKeyHash { + Address::PayToPublicKeyHash { network, pub_key_hash, } => debug_struct @@ -83,7 +83,7 @@ impl fmt::Debug for TransparentAddress { } } -impl fmt::Display for TransparentAddress { +impl fmt::Display for Address { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let mut bytes = io::Cursor::new(Vec::new()); let _ = self.zcash_serialize(&mut bytes); @@ -92,25 +92,25 @@ impl fmt::Display for TransparentAddress { } } -impl From