Add Many Sanity Checks to Crowdloans (#2745)

* Add many sanity checks to Crowdloans

* fix tests

* test contribution block in integration test

* fix rococo build

* remove leaser from crowdloans

* fix docs and terms

* fix compile
This commit is contained in:
Shawn Tabrizi
2021-03-29 16:52:55 +02:00
committed by GitHub
parent 7c21dbbdf4
commit 76db00f398
4 changed files with 148 additions and 90 deletions
+9 -1
View File
@@ -54,7 +54,7 @@ pub trait Config: frame_system::Config {
/// The overarching event type.
type Event: From<Event<Self>> + Into<<Self as frame_system::Config>::Event>;
/// The number of blocks over which a single period lasts.
/// The type representing the leasing system.
type Leaser: Leaser<AccountId=Self::AccountId, LeasePeriod=Self::BlockNumber>;
/// The parachain registrar type.
@@ -332,6 +332,14 @@ impl<T: Config> Auctioneer for Module<T> {
fn lease_period_index() -> Self::LeasePeriod {
T::Leaser::lease_period_index()
}
fn lease_period() -> Self::LeasePeriod {
T::Leaser::lease_period()
}
fn has_won_an_auction(para: ParaId, bidder: &T::AccountId) -> bool {
!T::Leaser::deposit_held(para, bidder).is_zero()
}
}
impl<T: Config> Module<T> {