mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
fix: subpool variant order (#3656)
This commit is contained in:
@ -55,11 +55,11 @@ pub enum SubPool {
|
||||
/// The queued sub-pool contains transactions that are not ready to be included in the next
|
||||
/// block because they have missing or queued ancestors.
|
||||
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
|
||||
/// block because they don't meet the base fee requirement.
|
||||
BaseFee,
|
||||
/// The pending sub-pool contains transactions that are ready to be included in the next block.
|
||||
Pending,
|
||||
}
|
||||
|
||||
// === impl SubPool ===
|
||||
@ -106,6 +106,15 @@ impl From<TxState> for SubPool {
|
||||
mod tests {
|
||||
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]
|
||||
fn test_tx_state() {
|
||||
let mut state = TxState::default();
|
||||
|
||||
Reference in New Issue
Block a user