pub struct Transaction {
pub inputs: Vec<Amount>,
pub outputs: Vec<Amount>,
}
Expand description
Trx contain 2 pieces of info: Set of I/O that I=O - Value of TRXs=Sum(Inputs) Value of the Fee =Sum(Inputs)-Sum(Outputs) We implement coinbase TRXs model: do not require inputs, produce an output - allow the miner to collect all the trx fees in that block and that block’s block reward (coin genesis)
Fields§
§inputs: Vec<Amount>
§outputs: Vec<Amount>
Implementations§
Source§impl Transaction
impl Transaction
pub fn default() -> Transaction
pub fn new(inputs: Vec<Amount>, outputs: Vec<Amount>) -> Transaction
pub fn is_coinbase(&self) -> bool
Trait Implementations§
Source§impl Clone for Transaction
impl Clone for Transaction
Source§fn clone(&self) -> Transaction
fn clone(&self) -> Transaction
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Transaction
impl Debug for Transaction
Source§impl Hashable for Transaction
impl Hashable for Transaction
Source§impl Put for Transaction
impl Put for Transaction
Source§impl Serialize for Transaction
impl Serialize for Transaction
impl SuperTransaction for Transaction
Auto Trait Implementations§
impl Freeze for Transaction
impl RefUnwindSafe for Transaction
impl Send for Transaction
impl Sync for Transaction
impl Unpin for Transaction
impl UnwindSafe for Transaction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more