Parachain auctions (#239)

* Slots module

* Integrate slots

* More drafting

* Minor updates

* Update parachains to use trati

* More build fixes

* Full code now compiles

* Add renew bid function

* Implement calculate_winner

* Warning remove

* Update gitignore

* Test framework

* Tests

* Further testing

* More tests, new parameterisation.

* Fix and new test

* Thread-safe tests

* Test off-boarding and a fix.

* Test onboarding

* Allow late onboarding.

* Another test and fix

* Avoid println in nostd

* Compact representation of paraids

* Introduce documentation.

* Introduce events.

* Additional test and fix

* Additional test

* Tidy up line lengths.

* Remove printlns

* Use later substrate utils.

* Fix build/test

* Make slots work with latest substrate

* Update runtime/src/slot_range.rs

Co-Authored-By: Robert Habermeier <rphmeier@gmail.com>

* Update runtime/src/slots.rs

Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>

* Update runtime/src/slots.rs

Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>

* Polish logic

* Rewind to earlier substrate master

* Remove dead code.
This commit is contained in:
Gavin Wood
2019-05-25 13:34:23 +02:00
committed by GitHub
parent 10ae8d48f5
commit 32f9519743
11 changed files with 1936 additions and 238 deletions
+16
View File
@@ -76,6 +76,8 @@ extern crate substrate_trie;
mod curated_grandpa;
mod parachains;
mod claims;
mod slot_range;
mod slots;
use rstd::prelude::*;
use substrate_primitives::u32_trait::{_2, _4};
@@ -252,6 +254,19 @@ impl grandpa::Trait for Runtime {
impl parachains::Trait for Runtime {}
parameter_types!{
pub const LeasePeriod: BlockNumber = 100000;
pub const EndingPeriod: BlockNumber = 1000;
}
impl slots::Trait for Runtime {
type Event = Event;
type Currency = balances::Module<Self>;
type Parachains = parachains::Module<Self>;
type LeasePeriod = LeasePeriod;
type EndingPeriod = EndingPeriod;
}
impl curated_grandpa::Trait for Runtime { }
impl sudo::Trait for Runtime {
@@ -283,6 +298,7 @@ construct_runtime!(
CouncilSeats: council_seats::{Config<T>},
Treasury: treasury,
Parachains: parachains::{Module, Call, Storage, Config<T>, Inherent},
Slots: slots::{Module, Call, Storage, Event<T>},
Sudo: sudo,
}
);