mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +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
|
/// 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();
|
||||||
|
|||||||
Reference in New Issue
Block a user