Enum ckb_types::core::error::TransactionError
source · pub enum TransactionError {
Show 14 variants
InsufficientCellCapacity {
inner: TransactionErrorSource,
index: usize,
occupied_capacity: Capacity,
capacity: Capacity,
},
OutputsSumOverflow {
inputs_sum: Capacity,
outputs_sum: Capacity,
},
Empty {
inner: TransactionErrorSource,
},
DuplicateCellDeps {
out_point: OutPoint,
},
DuplicateHeaderDeps {
hash: Byte32,
},
OutputsDataLengthMismatch {
outputs_len: usize,
outputs_data_len: usize,
},
InvalidSince {
index: usize,
},
Immature {
index: usize,
},
CellbaseImmaturity {
inner: TransactionErrorSource,
index: usize,
},
MismatchedVersion {
expected: Version,
actual: Version,
},
ExceededMaximumBlockBytes {
limit: u64,
actual: u64,
},
Compatible {
feature: &'static str,
},
DaoLockSizeMismatch {
index: usize,
},
Internal {
description: String,
},
}
Expand description
The error types to transactions.
Variants§
InsufficientCellCapacity
Fields
inner: TransactionErrorSource
The transaction field that causes error.
It should always be TransactionErrorSource::Outputs.
There is an erroneous output that its occupied capacity is greater than its capacity (output.occupied_capacity() > output.capacity()
).
OutputsSumOverflow
Fields
The total capacity of outputs is less than the total capacity of inputs (SUM([o.capacity for o in outputs]) > SUM([i.capacity for i in inputs]
).
Empty
Fields
inner: TransactionErrorSource
The transaction field that causes the error.
It should be TransactionErrorSource::Inputs
or TransactionErrorSource::Outputs
.
Either inputs or outputs of the transaction are empty (inputs.is_empty() || outputs.is_empty()
).
DuplicateCellDeps
There are duplicated CellDep
s within the same transaction.
DuplicateHeaderDeps
There are duplicated HeaderDep
within the same transaction.
OutputsDataLengthMismatch
The length of outputs is not equal to the length of outputs-data (outputs.len() != outputs_data.len()
).
InvalidSince
Error dues to the the fact that the since rule is not respected.
See also 0017-tx-valid-since.
Immature
The transaction is not mature yet, according to the since
rule.
See also 0017-tx-valid-since.
CellbaseImmaturity
Fields
inner: TransactionErrorSource
The transaction field that causes the error.
It should be TransactionErrorSource::Inputs
or TransactionErrorSource::CellDeps
. It does not allow using an immature cell as input out-point and dependency out-point.
The transaction is not mature yet, according to the cellbase maturity rule.
MismatchedVersion
Fields
The transaction version does not match with the system expected.
ExceededMaximumBlockBytes
The transaction size exceeds limit.
Compatible
The compatible error.
DaoLockSizeMismatch
Nervos DAO lock size mismatch.
Internal
The internal error.
Implementations§
source§impl TransactionError
impl TransactionError
sourcepub fn is_malformed_tx(&self) -> bool
pub fn is_malformed_tx(&self) -> bool
Returns whether this transaction error indicates that the transaction is malformed.
Trait Implementations§
source§impl Clone for TransactionError
impl Clone for TransactionError
source§fn clone(&self) -> TransactionError
fn clone(&self) -> TransactionError
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for TransactionError
impl Debug for TransactionError
source§impl Display for TransactionError
impl Display for TransactionError
source§impl Error for TransactionError
impl Error for TransactionError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
source§impl From<TransactionError> for Error
impl From<TransactionError> for Error
source§fn from(error: TransactionError) -> Self
fn from(error: TransactionError) -> Self
source§impl PartialEq for TransactionError
impl PartialEq for TransactionError
source§fn eq(&self, other: &TransactionError) -> bool
fn eq(&self, other: &TransactionError) -> bool
self
and other
values to be equal, and is used
by ==
.