[−][src]Struct exonum_explorer::CommittedTransaction
Information about a particular transaction in the blockchain.
JSON presentation
Name | Equivalent type | Description |
---|---|---|
message | Verified<AnyTx> | Transaction as recorded in the blockchain |
location | TxLocation | Location of the transaction in the block |
location_proof | ListProof < Hash > | Proof of transaction inclusion into a block |
status | (custom; see below) | Execution status |
time | DateTime < Utc > | Commitment time* |
* By commitment time we mean an approximate commitment time of the block which includes the transaction. This time is a median time of the precommit local times of each validator.
status
field
The status
field is a more readable representation of the ExecutionStatus
type.
For successfully executed transactions, status
is equal to
{ "type": "success" }
For transactions that cause an ExecutionError
, status
contains the error code
and an optional description, i.e., has the following type in the TypeScript notation:
type Error = {
type: 'service_error' | 'core_error' | 'common_error' | 'runtime_error' | 'unexpected_error',
code?: number,
description?: string,
runtime_id: number,
call_site?: CallSite,
};
type CallSite = MethodCallSite | HookCallSite;
type MethodCallSite = {
call_type: 'method',
instance_id: number,
interface?: string,
method_id: number,
};
type HookCallSite = {
call_type: 'constructor' | 'before_transactions' | 'after_transactions',
instance_id: number,
};
Explanations:
Error.type
determines the component responsible for the error. Usually, errors are generated by the service code, but they can also be caused by the dispatch logic, runtime associated with the service, or come from another source (unexpected_error
s).Error.code
is the error code. For service errors, this code is specific to the service instance (which can be obtained fromcall_site
), and for runtime errors - to the runtime. For core errors, the codes are fixed; their meaning can be found in theCoreError
docs. The code is present for all error types exceptunexpected_error
s, in which the code is always absent. Besides types listed above, there is also a set of errors that can occur within any context, which are organized in theCommonError
.Error.description
is an optional human-readable description of the error.Error.runtime_id
is the numeric ID of the runtime in which the error has occurred. Note that the runtime is defined for all error types, not justruntime_error
s, since for any request it's possible to say which runtime is responsible for its processing.Error.call_site
provides most precise known location of the call in which the error has occurred.
Methods
impl CommittedTransaction
[src]
pub fn message(&self) -> &Verified<AnyTx>
[src]
Returns the content of the transaction.
pub fn location(&self) -> &TxLocation
[src]
Returns the transaction location in block.
pub fn location_proof(&self) -> &ListProof<Hash>
[src]
Returns a proof that transaction is recorded in the blockchain.
pub fn status(&self) -> Result<(), &ExecutionError>
[src]
Returns the status of the transaction execution.
pub fn time(&self) -> &DateTime<Utc>
[src]
Returns an approximate commit time of the block which includes this transaction.
Trait Implementations
impl Debug for CommittedTransaction
[src]
impl<'de> Deserialize<'de> for CommittedTransaction
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Serialize for CommittedTransaction
[src]
Auto Trait Implementations
impl RefUnwindSafe for CommittedTransaction
impl Send for CommittedTransaction
impl Sync for CommittedTransaction
impl Unpin for CommittedTransaction
impl UnwindSafe for CommittedTransaction
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,