Enumerate mempool errors (#2615)
* Enumerate mempool errors. * Update code formatting * Allow dead code Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com> * Allow dead code Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com> * Add a new error * Update error formatting Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com> * Remove TransactionQueryError * Derive Copy and Clone Co-authored-by: teor <teor@riseup.net> * Remove the Copy trait Co-authored-by: teor <teor@riseup.net> * Rename enum variants Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com> Co-authored-by: teor <teor@riseup.net> Co-authored-by: Deirdre Connolly <deirdre@zfnd.org>
This commit is contained in:
parent
ace7aec933
commit
1c232ff5ea
|
@ -1,5 +1,8 @@
|
|||
//! Zebra mempool.
|
||||
|
||||
/// Mempool-related errors.
|
||||
pub mod error;
|
||||
|
||||
mod crawler;
|
||||
|
||||
pub use self::crawler::Crawler;
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
//! Errors that can occur when manipulating transactions in the mempool.
|
||||
|
||||
use thiserror::Error;
|
||||
|
||||
#[derive(Error, Clone, Debug, PartialEq)]
|
||||
#[allow(dead_code)]
|
||||
pub enum MempoolError {
|
||||
#[error("transaction already exists in mempool")]
|
||||
InMempool,
|
||||
|
||||
#[error("transaction did not pass consensus validation")]
|
||||
Invalid(#[from] zebra_consensus::error::TransactionError),
|
||||
|
||||
#[error("transaction is committed in block {0:?}")]
|
||||
InBlock(zebra_chain::block::Hash),
|
||||
|
||||
#[error("transaction has expired")]
|
||||
Expired,
|
||||
|
||||
#[error("transaction fee is too low for the current mempool state")]
|
||||
LowFee,
|
||||
|
||||
#[error("transaction was not found in mempool")]
|
||||
NotInMempool,
|
||||
}
|
Loading…
Reference in New Issue