mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 11:07:56 +00:00
Partial fix for transaction priority (#7034)
* Partial fix for priority stuff. * Small fix * Fix tests. * Update frame/transaction-payment/src/lib.rs Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com> * Better doc Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
This commit is contained in:
@@ -242,6 +242,30 @@ impl Default for DispatchClass {
|
||||
}
|
||||
}
|
||||
|
||||
/// Primitives related to priority management of Frame.
|
||||
pub mod priority {
|
||||
/// The starting point of all Operational transactions. 3/4 of u64::max_value().
|
||||
pub const LIMIT: u64 = 13_835_058_055_282_163_711_u64;
|
||||
|
||||
/// Wrapper for priority of different dispatch classes.
|
||||
///
|
||||
/// This only makes sure that any value created for the operational dispatch class is
|
||||
/// incremented by [`LIMIT`].
|
||||
pub enum FrameTransactionPriority {
|
||||
Normal(u64),
|
||||
Operational(u64),
|
||||
}
|
||||
|
||||
impl From<FrameTransactionPriority> for u64 {
|
||||
fn from(priority: FrameTransactionPriority) -> Self {
|
||||
match priority {
|
||||
FrameTransactionPriority::Normal(inner) => inner,
|
||||
FrameTransactionPriority::Operational(inner) => inner.saturating_add(LIMIT),
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A bundle of static information collected from the `#[weight = $x]` attributes.
|
||||
#[derive(Clone, Copy, Eq, PartialEq, Default, RuntimeDebug, Encode, Decode)]
|
||||
pub struct DispatchInfo {
|
||||
|
||||
Reference in New Issue
Block a user