pub trait TransactionOrdering:
Send
+ Sync
+ 'static {
type PriorityValue: Ord + Clone + Default + Debug + Send + Sync;
type Transaction: PoolTransaction<Pooled = PooledTransactionsElementEcRecovered, Consensus = TransactionSignedEcRecovered>;
// Required method
fn priority(
&self,
transaction: &Self::Transaction,
base_fee: u64,
) -> Priority<Self::PriorityValue>;
}
Expand description
Transaction ordering trait to determine the order of transactions.
Decides how transactions should be ordered within the pool, depending on a Priority
value.
The returned priority must reflect total order.
Required Associated Types§
sourcetype PriorityValue: Ord + Clone + Default + Debug + Send + Sync
type PriorityValue: Ord + Clone + Default + Debug + Send + Sync
Priority of a transaction.
Higher is better.
sourcetype Transaction: PoolTransaction<Pooled = PooledTransactionsElementEcRecovered, Consensus = TransactionSignedEcRecovered>
type Transaction: PoolTransaction<Pooled = PooledTransactionsElementEcRecovered, Consensus = TransactionSignedEcRecovered>
The transaction type to determine the priority of.
Required Methods§
sourcefn priority(
&self,
transaction: &Self::Transaction,
base_fee: u64,
) -> Priority<Self::PriorityValue>
fn priority( &self, transaction: &Self::Transaction, base_fee: u64, ) -> Priority<Self::PriorityValue>
Returns the priority score for the given transaction.