use crate::{
extensions::transparent as tze,
transaction::components::{
amount::Amount,
tze::{builder::TzeBuildInput, OutPoint, TzeOut},
},
};
pub trait InputView {
fn outpoint(&self) -> &OutPoint;
fn coin(&self) -> &TzeOut;
}
impl InputView for TzeBuildInput {
fn outpoint(&self) -> &OutPoint {
self.outpoint()
}
fn coin(&self) -> &TzeOut {
self.coin()
}
}
pub trait OutputView {
fn value(&self) -> Amount;
fn precondition(&self) -> &tze::Precondition;
}
impl OutputView for TzeOut {
fn value(&self) -> Amount {
self.value
}
fn precondition(&self) -> &tze::Precondition {
&self.precondition
}
}