Struct ckb_jsonrpc_types::TxStatus
source · [−]pub struct TxStatus {
pub status: Status,
pub block_hash: Option<H256>,
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_hash: Option<H256>
The block hash of the block which has committed this transaction in the canonical chain.
reason: Option<String>
The reason why the transaction is rejected
Implementations
sourceimpl 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(hash: H256) -> Self
pub fn committed(hash: H256) -> 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
sourceimpl<'de> Deserialize<'de> for TxStatus
impl<'de> Deserialize<'de> for TxStatus
sourcefn 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 TxStatus
impl StructuralEq for TxStatus
impl StructuralPartialEq for TxStatus
Auto Trait Implementations
impl RefUnwindSafe for TxStatus
impl Send for TxStatus
impl Sync for TxStatus
impl Unpin for TxStatus
impl UnwindSafe for TxStatus
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more