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: u32,
actual: u32,
},
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: TransactionErrorSourceThe transaction field that causes error.
It should always be TransactionErrorSource::Outputs.
occupied_capacity: CapacityThe occupied capacity of that erroneous output.
capacity: CapacityThe capacity of that erroneous output.
There is an erroneous output that its occupied capacity is greater than its capacity (output.occupied_capacity() > output.capacity()).
OutputsSumOverflow
Fields
inputs_sum: CapacityThe total capacity of inputs.
outputs_sum: CapacityThe total capacity of outputs.
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: TransactionErrorSourceThe 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 CellDeps within the same transaction.
DuplicateHeaderDeps
Fields
hash: Byte32The block hash of that duplicated HeaderDep.
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: TransactionErrorSourceThe 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
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 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 ==.