-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Increased the generality of Builder struct implementations. Made Sapl…
…ing Builder views stricter.
- Loading branch information
Murisi Tarusenga
committed
Apr 18, 2023
1 parent
dc76395
commit 0f9ec18
Showing
4 changed files
with
33 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,24 @@ | ||
//! Types related to computation of fees and change related to the Sapling components | ||
//! of a transaction. | ||
use crate::transaction::components::amount::Amount; | ||
use crate::asset_type::AssetType; | ||
|
||
/// A trait that provides a minimized view of a Sapling input suitable for use in | ||
/// fee and change calculation. | ||
pub trait InputView<NoteRef> { | ||
/// An identifier for the input being spent. | ||
fn note_id(&self) -> &NoteRef; | ||
/// The value of the input being spent. | ||
fn value(&self) -> Amount; | ||
fn value(&self) -> u64; | ||
/// The asset type of the input being spent. | ||
fn asset_type(&self) -> AssetType; | ||
} | ||
|
||
/// A trait that provides a minimized view of a Sapling output suitable for use in | ||
/// fee and change calculation. | ||
pub trait OutputView { | ||
/// The value of the output being produced. | ||
fn value(&self) -> Amount; | ||
fn value(&self) -> u64; | ||
/// The asset type of the output being produced. | ||
fn asset_type(&self) -> AssetType; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters