fix: subpool variant order (#3656)

This commit is contained in:
Matthias Seitz
2023-07-07 13:49:04 +02:00
committed by GitHub
parent 0d76dd762a
commit 15bd88c30b

View File

@ -55,11 +55,11 @@ pub enum SubPool {
/// The queued sub-pool contains transactions that are not ready to be included in the next /// The queued sub-pool contains transactions that are not ready to be included in the next
/// block because they have missing or queued ancestors. /// block because they have missing or queued ancestors.
Queued = 0, Queued = 0,
/// The pending sub-pool contains transactions that are ready to be included in the next block.
Pending,
/// The base-fee sub-pool contains transactions that are not ready to be included in the next /// The base-fee sub-pool contains transactions that are not ready to be included in the next
/// block because they don't meet the base fee requirement. /// block because they don't meet the base fee requirement.
BaseFee, BaseFee,
/// The pending sub-pool contains transactions that are ready to be included in the next block.
Pending,
} }
// === impl SubPool === // === impl SubPool ===
@ -106,6 +106,15 @@ impl From<TxState> for SubPool {
mod tests { mod tests {
use super::*; use super::*;
#[test]
fn test_promoted() {
assert!(SubPool::BaseFee.is_promoted(SubPool::Queued));
assert!(SubPool::Pending.is_promoted(SubPool::BaseFee));
assert!(SubPool::Pending.is_promoted(SubPool::Queued));
assert!(!SubPool::BaseFee.is_promoted(SubPool::Pending));
assert!(!SubPool::Queued.is_promoted(SubPool::BaseFee));
}
#[test] #[test]
fn test_tx_state() { fn test_tx_state() {
let mut state = TxState::default(); let mut state = TxState::default();