pub struct TxStatus {
pub status: Status,
pub block_number: Option<BlockNumber>,
pub block_hash: Option<H256>,
pub tx_index: Option<Uint32>,
pub reason: Option<String>,
}
Expand description
Transaction status and the block hash if it is committed.
Fields§
§status: Status
The transaction status, allowed values: “pending”, “proposed” “committed” “unknown” and “rejected”.
block_number: Option<BlockNumber>
The block number of the block which has committed this transaction in the canonical chain.
block_hash: Option<H256>
The block hash of the block which has committed this transaction in the canonical chain.
tx_index: Option<Uint32>
The transaction index in the block.
reason: Option<String>
The reason why the transaction is rejected
Implementations§
Source§impl TxStatus
impl TxStatus
Sourcepub fn pending() -> Self
pub fn pending() -> Self
Pending transaction which is in the memory pool and must be proposed first.
Sourcepub fn committed(number: BlockNumber, hash: H256, tx_index: Uint32) -> Self
pub fn committed(number: BlockNumber, hash: H256, tx_index: Uint32) -> Self
Transaction which has already been committed.
§Params
hash
- the block hash in which the transaction is committed.
Sourcepub fn rejected(reason: String) -> Self
pub fn rejected(reason: String) -> Self
Transaction which has already been rejected recently.
§Params
reason
- the reason why the transaction is rejected.
Sourcepub fn is_unknown(&self) -> bool
pub fn is_unknown(&self) -> bool
Returns true if the status is Unknown.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TxStatus
impl<'de> Deserialize<'de> for TxStatus
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
Source§impl JsonSchema for TxStatus
impl JsonSchema for TxStatus
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moreimpl Eq for TxStatus
impl StructuralPartialEq for TxStatus
Auto Trait Implementations§
impl Freeze for TxStatus
impl RefUnwindSafe for TxStatus
impl Send for TxStatus
impl Sync for TxStatus
impl Unpin for TxStatus
impl UnwindSafe for TxStatus
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)