Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,7 @@ impl parachains::Trait for Runtime {

parameter_types! {
pub const ParathreadDeposit: Balance = 500 * DOLLARS;
pub const QueueSize: usize = 2;
}

impl registrar::Trait for Runtime {
Expand All @@ -494,6 +495,8 @@ impl registrar::Trait for Runtime {
type Currency = Balances;
type ParathreadDeposit = ParathreadDeposit;
type SwapAux = Slots;
type QueueSize = QueueSize;
const MAX_RETRIES: u32 = 3;
}

parameter_types!{
Expand Down
7 changes: 5 additions & 2 deletions runtime/src/parachains.rs
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ impl<T: Trait> Module<T> {
fn queue_upward_messages(
id: ParaId,
upward_messages: &[UpwardMessage],
ordered_needs_dispatch: &mut [ParaId],
ordered_needs_dispatch: &mut Vec<ParaId>,
) {
if !upward_messages.is_empty() {
RelayDispatchQueueSize::mutate(id, |&mut(ref mut count, ref mut len)| {
Expand Down Expand Up @@ -1064,6 +1064,7 @@ mod tests {

parameter_types! {
pub const ParathreadDeposit: Balance = 10;
pub const QueueSize: usize = 2;
}

impl registrar::Trait for Test {
Expand All @@ -1072,6 +1073,8 @@ mod tests {
type Currency = balances::Module<Test>;
type ParathreadDeposit = ParathreadDeposit;
type SwapAux = slots::Module<Test>;
type QueueSize = QueueSize;
const MAX_RETRIES: u32 = 3;
}

impl Trait for Test {
Expand Down Expand Up @@ -1575,7 +1578,7 @@ mod tests {
assert_eq!(Parachains::parachain_code(ParaId::from(5u32)), Some(vec![1,2,3]));
assert_eq!(Parachains::parachain_code(ParaId::from(100u32)), Some(vec![4,5,6]));

assert_ok!(Registrar::register_para(Origin::ROOT, 99u32.into(), vec![7,8,9], vec![1, 1, 1], ParaInfo{scheduling: Scheduling::Always}));
assert_ok!(Registrar::register_para(Origin::ROOT, 99u32.into(), ParaInfo{scheduling: Scheduling::Always}, vec![7,8,9], vec![1, 1, 1]));
assert_ok!(Parachains::set_heads(Origin::NONE, vec![]));

run_to_block(3);
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/registrar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1344,7 +1344,7 @@ mod tests {
);

// Assuming Queue Size is 2
assert_eq!(Test::QueueSize::get(), 2);
assert_eq!(<Test as self::Trait>::QueueSize::get(), 2);

// 2 blocks later
run_to_block(5);
Expand Down