Merge pull request #1000 from zingolabs/add_debugs_to_inputs

add Debug to transaction builder-reported types
This commit is contained in:
Kris Nuttycombe 2023-10-04 09:15:29 -06:00 committed by GitHub
commit e6fa567332
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 2 deletions

View File

@ -219,6 +219,7 @@ pub(crate) mod tests {
transparent::{fees as transparent, OutPoint, TxOut}, transparent::{fees as transparent, OutPoint, TxOut},
}; };
#[derive(Debug)]
pub(crate) struct TestTransparentInput { pub(crate) struct TestTransparentInput {
pub outpoint: OutPoint, pub outpoint: OutPoint,
pub coin: TxOut, pub coin: TxOut,

View File

@ -43,6 +43,7 @@ impl fmt::Display for Error {
/// An uninhabited type that allows the type of [`TransparentBuilder::inputs`] /// An uninhabited type that allows the type of [`TransparentBuilder::inputs`]
/// to resolve when the transparent-inputs feature is not turned on. /// to resolve when the transparent-inputs feature is not turned on.
#[cfg(not(feature = "transparent-inputs"))] #[cfg(not(feature = "transparent-inputs"))]
#[derive(Debug)]
enum InvalidTransparentInput {} enum InvalidTransparentInput {}
#[cfg(not(feature = "transparent-inputs"))] #[cfg(not(feature = "transparent-inputs"))]

View File

@ -9,7 +9,7 @@ use crate::{
/// This trait provides a minimized view of a transparent input suitable for use in /// This trait provides a minimized view of a transparent input suitable for use in
/// fee and change computation. /// fee and change computation.
pub trait InputView { pub trait InputView: std::fmt::Debug {
/// The outpoint to which the input refers. /// The outpoint to which the input refers.
fn outpoint(&self) -> &OutPoint; fn outpoint(&self) -> &OutPoint;
/// The previous output being spent. /// 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 /// This trait provides a minimized view of a transparent output suitable for use in
/// fee and change computation. /// fee and change computation.
pub trait OutputView { pub trait OutputView: std::fmt::Debug {
/// Returns the value of the output being created. /// Returns the value of the output being created.
fn value(&self) -> Amount; fn value(&self) -> Amount;
/// Returns the script corresponding to the newly created output. /// Returns the script corresponding to the newly created output.