diff --git a/zcash_client_backend/src/data_api.rs b/zcash_client_backend/src/data_api.rs index 2fd0b5b2d..7be3321c5 100644 --- a/zcash_client_backend/src/data_api.rs +++ b/zcash_client_backend/src/data_api.rs @@ -2,7 +2,7 @@ use std::{ collections::{BTreeMap, HashMap}, - fmt::Debug, + fmt::{self, Debug}, io, num::{NonZeroU32, TryFromIntError}, }; @@ -604,6 +604,16 @@ pub enum PoolType { Shielded(ShieldedProtocol), } +impl fmt::Display for PoolType { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + PoolType::Transparent => f.write_str("Transparent"), + PoolType::Shielded(ShieldedProtocol::Sapling) => f.write_str("Sapling"), + PoolType::Shielded(ShieldedProtocol::Orchard) => f.write_str("Orchard"), + } + } +} + /// A type that represents the recipient of a transaction output; a recipient address (and, for /// unified addresses, the pool to which the payment is sent) in the case of outgoing output, or an /// internal account ID and the pool to which funds were sent in the case of a wallet-internal diff --git a/zcash_client_sqlite/src/error.rs b/zcash_client_sqlite/src/error.rs index 177026e5e..4d9977d76 100644 --- a/zcash_client_sqlite/src/error.rs +++ b/zcash_client_sqlite/src/error.rs @@ -149,7 +149,7 @@ impl fmt::Display for SqliteClientError { SqliteClientError::CommitmentTree(err) => write!(f, "An error occurred accessing or updating note commitment tree data: {}.", err), SqliteClientError::CacheMiss(height) => write!(f, "Requested height {} does not exist in the block cache.", height), SqliteClientError::ChainHeightUnknown => write!(f, "Chain height unknown; please call `update_chain_tip`"), - SqliteClientError::UnsupportedPoolType(t) => write!(f, "Pool type is not currently supported: {:?}", t) + SqliteClientError::UnsupportedPoolType(t) => write!(f, "Pool type is not currently supported: {}", t) } } }