pub struct Ext(/* private fields */);Expand description
Extension for the group of transactions. It must be filled by the validator
in Split or Merge types. Due to the check on create, extenstion cannot
be invalid. The valid extension must have: 1) unique coins, 2) the same
sender (validator), 3) correct coins ownership, 4) consistent transaction
order, types, values and count depending on the group type. Extension can be
empty for Transfer type.
Implementations§
Source§impl Ext
impl Ext
Sourcepub fn new(
transactions: Vec<Transaction>,
state: &State,
senders: &[U256],
) -> UqoinResult<Self>
pub fn new( transactions: Vec<Transaction>, state: &State, senders: &[U256], ) -> UqoinResult<Self>
Create a new extension from transactions.
Sourcepub fn transactions(&self) -> &[Transaction]
pub fn transactions(&self) -> &[Transaction]
Accessor to the inner transactions.
Sourcepub fn get_sender(&self, senders: &[U256]) -> Option<U256>
pub fn get_sender(&self, senders: &[U256]) -> Option<U256>
Get sender of the extension.
Sourcepub fn get_order(&self, state: &State, senders: &[U256]) -> u64
pub fn get_order(&self, state: &State, senders: &[U256]) -> u64
Get order of the main coins in the extension.
Sourcepub fn validate_transactions(
transactions: &[Transaction],
state: &State,
senders: &[U256],
) -> UqoinResult<()>
pub fn validate_transactions( transactions: &[Transaction], state: &State, senders: &[U256], ) -> UqoinResult<()>
Validate transactions for the extension creation.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Ext
impl RefUnwindSafe for Ext
impl Send for Ext
impl Sync for Ext
impl Unpin for Ext
impl UnsafeUnpin for Ext
impl UnwindSafe for Ext
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