pub enum TransactionError {
Show 16 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,
},
ScriptHashTypeNotPermitted {
hash_type: u8,
},
InvalidScriptHashType {
hash_type: Byte,
},
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: TransactionErrorSourceThe 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: TransactionErrorSourceThe transaction field that causes the error.
It should be TransactionErrorSource::Inputs or TransactionErrorSource::Outputs.
DuplicateCellDeps
There are duplicated CellDeps 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: 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.
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.
ScriptHashTypeNotPermitted
The lock script hash type is not permitted by the current consensus rules.
InvalidScriptHashType
The lock Script hash_type field is invalid.
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
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§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more