From b5e24751d65b322e3e2911cc1334f503e8174c52 Mon Sep 17 00:00:00 2001 From: zancas Date: Fri, 29 Sep 2023 12:55:06 -0600 Subject: [PATCH] add Debug to transaction builder-reported types --- zcash_client_backend/src/fees.rs | 1 + .../src/transaction/components/transparent/builder.rs | 1 + .../src/transaction/components/transparent/fees.rs | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/zcash_client_backend/src/fees.rs b/zcash_client_backend/src/fees.rs index b83477159..050f3dbfa 100644 --- a/zcash_client_backend/src/fees.rs +++ b/zcash_client_backend/src/fees.rs @@ -219,6 +219,7 @@ pub(crate) mod tests { transparent::{fees as transparent, OutPoint, TxOut}, }; + #[derive(Debug)] pub(crate) struct TestTransparentInput { pub outpoint: OutPoint, pub coin: TxOut, diff --git a/zcash_primitives/src/transaction/components/transparent/builder.rs b/zcash_primitives/src/transaction/components/transparent/builder.rs index a65645fc9..95a8b8949 100644 --- a/zcash_primitives/src/transaction/components/transparent/builder.rs +++ b/zcash_primitives/src/transaction/components/transparent/builder.rs @@ -43,6 +43,7 @@ impl fmt::Display for Error { /// An uninhabited type that allows the type of [`TransparentBuilder::inputs`] /// to resolve when the transparent-inputs feature is not turned on. #[cfg(not(feature = "transparent-inputs"))] +#[derive(Debug)] enum InvalidTransparentInput {} #[cfg(not(feature = "transparent-inputs"))] diff --git a/zcash_primitives/src/transaction/components/transparent/fees.rs b/zcash_primitives/src/transaction/components/transparent/fees.rs index 1e63e16c3..4b3f4ddb0 100644 --- a/zcash_primitives/src/transaction/components/transparent/fees.rs +++ b/zcash_primitives/src/transaction/components/transparent/fees.rs @@ -9,7 +9,7 @@ use crate::{ /// This trait provides a minimized view of a transparent input suitable for use in /// fee and change computation. -pub trait InputView { +pub trait InputView: std::fmt::Debug { /// The outpoint to which the input refers. fn outpoint(&self) -> &OutPoint; /// The previous output being spent. @@ -18,7 +18,7 @@ pub trait InputView { /// This trait provides a minimized view of a transparent output suitable for use in /// fee and change computation. -pub trait OutputView { +pub trait OutputView: std::fmt::Debug { /// Returns the value of the output being created. fn value(&self) -> Amount; /// Returns the script corresponding to the newly created output.