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
There is an erroneous output that its occupied capacity is greater than its capacity (output.occupied_capacity() > output.capacity()
).
Fields
inner: TransactionErrorSource
The transaction field that causes error.
It should always be TransactionErrorSource::Outputs.
OutputsSumOverflow
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]
).
Fields
Empty
Either inputs or outputs of the transaction are empty (inputs.is_empty() || outputs.is_empty()
).
Fields
inner: TransactionErrorSource
The transaction field that causes the error.
It should be TransactionErrorSource::Inputs
or TransactionErrorSource::Outputs
.
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 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
The transaction is not mature yet, according to the cellbase maturity rule.
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.
MismatchedVersion
The transaction version does not match with the system expected.
Fields
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
impl Eq for TransactionError
impl StructuralPartialEq for TransactionError
Auto Trait Implementations§
impl !Freeze for TransactionError
impl RefUnwindSafe for TransactionError
impl Send for TransactionError
impl Sync for TransactionError
impl Unpin for TransactionError
impl UnwindSafe for TransactionError
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
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)
clone_to_uninit
)