mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-11-13 14:17:08 +00:00
Make ParaId constructible from a const context (#483)
This commit is contained in:
1 parent
b890df6cde
commit
2842be7b81
5 files changed
+23
-30
No files matched your search
@@ -610,19 +610,19 @@ mod tests {
|
||||
initial_head_data: Vec<u8>
|
||||
) -> Result<(), &'static str> {
|
||||
PARACHAINS.with(|p| {
|
||||
if p.borrow().contains_key(&id.into_inner()) {
|
||||
if p.borrow().contains_key(&id.into()) {
|
||||
panic!("ID already exists")
|
||||
}
|
||||
p.borrow_mut().insert(id.into_inner(), (code, initial_head_data));
|
||||
p.borrow_mut().insert(id.into(), (code, initial_head_data));
|
||||
Ok(())
|
||||
})
|
||||
}
|
||||
fn deregister_para(id: ParaId) -> Result<(), &'static str> {
|
||||
PARACHAINS.with(|p| {
|
||||
if !p.borrow().contains_key(&id.into_inner()) {
|
||||
if !p.borrow().contains_key(&id.into()) {
|
||||
panic!("ID doesn't exist")
|
||||
}
|
||||
p.borrow_mut().remove(&id.into_inner());
|
||||
p.borrow_mut().remove(&id.into());
|
||||
Ok(())
|
||||
})
|
||||
}
|
||||
|
||||
@@ -829,7 +829,7 @@ mod tests {
|
||||
}
|
||||
|
||||
fn user_id(i: u32) -> ParaId {
|
||||
(LOWEST_USER_ID.into_inner() + i).into()
|
||||
LOWEST_USER_ID + i
|
||||
}
|
||||
|
||||
fn attest(id: ParaId, collator: &CollatorPair, head_data: &[u8], block_data: &[u8]) -> AttestedCandidate {
|
||||
|
||||
@@ -905,19 +905,19 @@ mod tests {
|
||||
initial_head_data: Vec<u8>
|
||||
) -> Result<(), &'static str> {
|
||||
PARACHAINS.with(|p| {
|
||||
if p.borrow().contains_key(&id.into_inner()) {
|
||||
if p.borrow().contains_key(&id.into()) {
|
||||
panic!("ID already exists")
|
||||
}
|
||||
p.borrow_mut().insert(id.into_inner(), (code, initial_head_data));
|
||||
p.borrow_mut().insert(id.into(), (code, initial_head_data));
|
||||
Ok(())
|
||||
})
|
||||
}
|
||||
fn deregister_para(id: ParaId) -> Result<(), &'static str> {
|
||||
PARACHAINS.with(|p| {
|
||||
if !p.borrow().contains_key(&id.into_inner()) {
|
||||
if !p.borrow().contains_key(&id.into()) {
|
||||
panic!("ID doesn't exist")
|
||||
}
|
||||
p.borrow_mut().remove(&id.into_inner());
|
||||
p.borrow_mut().remove(&id.into());
|
||||
Ok(())
|
||||
})
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user