mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 08:11:03 +00:00
Make ParaId value of public paras non-discretionary (#2988)
* Make ParaId value of public paras non-discretionary * Fixes * Fixes * fix tests * fix benchmark tests * dont use hardcoded number Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
@@ -122,10 +122,14 @@ impl From<i32> for Id {
|
||||
}
|
||||
|
||||
const USER_INDEX_START: u32 = 1000;
|
||||
const PUBLIC_INDEX_START: u32 = 2000;
|
||||
|
||||
/// The ID of the first user (non-system) parachain.
|
||||
pub const LOWEST_USER_ID: Id = Id(USER_INDEX_START);
|
||||
|
||||
/// The ID of the first publicly registerable parachain.
|
||||
pub const LOWEST_PUBLIC_ID: Id = Id(PUBLIC_INDEX_START);
|
||||
|
||||
impl Id {
|
||||
/// Create an `Id`.
|
||||
pub const fn new(id: u32) -> Self {
|
||||
@@ -151,6 +155,14 @@ impl sp_std::ops::Add<u32> for Id {
|
||||
}
|
||||
}
|
||||
|
||||
impl sp_std::ops::Sub<u32> for Id {
|
||||
type Output = Self;
|
||||
|
||||
fn sub(self, other: u32) -> Self {
|
||||
Self(self.0 - other)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Default, Encode, Decode, Eq, PartialEq, Ord, PartialOrd, RuntimeDebug)]
|
||||
pub struct Sibling(pub Id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user