pub struct Receipt {
pub tx_hash: Hash,
pub block_height: BlockHeight,
pub tx_index: u32,
pub status: TxStatus,
pub fee_paid: Balance,
}Expand description
Receipt for an executed transaction
Fields§
§tx_hash: HashHash of the transaction
block_height: BlockHeightBlock height where tx was included
tx_index: u32Index of tx within the block
status: TxStatusExecution status
fee_paid: BalanceFee actually paid (may differ if tx failed early)
Implementations§
Source§impl Receipt
impl Receipt
Sourcepub fn new(
tx_hash: Hash,
block_height: BlockHeight,
tx_index: u32,
status: TxStatus,
fee_paid: Balance,
) -> Self
pub fn new( tx_hash: Hash, block_height: BlockHeight, tx_index: u32, status: TxStatus, fee_paid: Balance, ) -> Self
Create a new receipt
Sourcepub fn success(
tx_hash: Hash,
block_height: BlockHeight,
tx_index: u32,
fee_paid: Balance,
) -> Self
pub fn success( tx_hash: Hash, block_height: BlockHeight, tx_index: u32, fee_paid: Balance, ) -> Self
Create a success receipt
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Check if the transaction succeeded
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, Error>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, Error>
Deserialize from bytes
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Receipt
impl<'de> Deserialize<'de> for Receipt
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
impl Eq for Receipt
impl StructuralPartialEq for Receipt
Auto Trait Implementations§
impl Freeze for Receipt
impl RefUnwindSafe for Receipt
impl Send for Receipt
impl Sync for Receipt
impl Unpin for Receipt
impl UnsafeUnpin for Receipt
impl UnwindSafe for Receipt
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