pub struct Transaction { /* private fields */ }Expand description
A concrete BCTS transaction with receipt-chain integrity.
Implementations§
Source§impl Transaction
impl Transaction
Sourcepub fn new(correlation_id: CorrelationId) -> Self
pub fn new(correlation_id: CorrelationId) -> Self
Create a new transaction in the Draft state.
Sourcepub fn transitions(&self) -> &[BctsTransition]
pub fn transitions(&self) -> &[BctsTransition]
Return all recorded transitions.
Sourcepub fn verify_receipt_chain(&self) -> Result<()>
pub fn verify_receipt_chain(&self) -> Result<()>
Verify the integrity of the receipt chain.
Re-computes each receipt from the corresponding transition and checks it matches the stored receipt.
Trait Implementations§
Source§impl BailmentTransaction for Transaction
impl BailmentTransaction for Transaction
Source§fn transition(
&mut self,
to: BctsState,
actor: &Did,
clock: &mut HybridClock,
adjudicator: &dyn BctsTransitionAdjudicator,
) -> Result<BctsTransition>
fn transition( &mut self, to: BctsState, actor: &Did, clock: &mut HybridClock, adjudicator: &dyn BctsTransitionAdjudicator, ) -> Result<BctsTransition>
Attempt a state transition. Read more
Source§fn receipt_chain(&self) -> &[Hash256]
fn receipt_chain(&self) -> &[Hash256]
The chain of receipt hashes for every transition so far.
Source§fn correlation_id(&self) -> &CorrelationId
fn correlation_id(&self) -> &CorrelationId
The correlation ID for end-to-end tracking.
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 (const: unstable) · 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<'de> Deserialize<'de> for Transaction
impl<'de> Deserialize<'de> for Transaction
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Transaction
impl RefUnwindSafe for Transaction
impl Send for Transaction
impl Sync for Transaction
impl Unpin for Transaction
impl UnsafeUnpin 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