Unverified Commit 2bbeb01b authored by Shawn Tabrizi's avatar Shawn Tabrizi Committed by GitHub
Browse files

Tweak Rococo Settings For Onboarding Testing (#2671)



* Tweak Rococo Settings

* rococo: use CurrentBlockRandomness wrapper in auctions

Co-authored-by: default avatarAndré Silva <andrerfosilva@gmail.com>
Co-authored-by: default avatarBastian Köcher <info@kchr.de>
parent 6252c064
Pipeline #130009 failed with stages
in 25 minutes and 6 seconds
...@@ -34,7 +34,7 @@ pub mod time { ...@@ -34,7 +34,7 @@ pub mod time {
pub const MILLISECS_PER_BLOCK: Moment = 6000; pub const MILLISECS_PER_BLOCK: Moment = 6000;
pub const SLOT_DURATION: Moment = MILLISECS_PER_BLOCK; pub const SLOT_DURATION: Moment = MILLISECS_PER_BLOCK;
frame_support::parameter_types! { frame_support::parameter_types! {
pub storage EpochDurationInBlocks: BlockNumber = 1 * HOURS; pub storage EpochDurationInBlocks: BlockNumber = 30 * MINUTES;
} }
// These time units are defined in number of blocks. // These time units are defined in number of blocks.
......
...@@ -616,11 +616,29 @@ parameter_types! { ...@@ -616,11 +616,29 @@ parameter_types! {
pub const EndingPeriod: BlockNumber = 15 * MINUTES; pub const EndingPeriod: BlockNumber = 15 * MINUTES;
} }
// A wrapper around `babe::CurrentBlockRandomness` that does not return `Option<Random>`.
pub struct CurrentBlockRandomness;
impl Randomness<Hash, BlockNumber> for CurrentBlockRandomness {
fn random(subject: &[u8]) -> (Hash, BlockNumber) {
let (randomness, block_number) =
pallet_babe::CurrentBlockRandomness::<Runtime>::random(subject);
let randomness = randomness.expect(
"only returns None when secondary VRF slots are not enabled; \
secondary VRF slots are enbaled for rococo runtime; \
qed.",
);
(randomness, block_number)
}
}
impl auctions::Config for Runtime { impl auctions::Config for Runtime {
type Event = Event; type Event = Event;
type Leaser = Slots; type Leaser = Slots;
type EndingPeriod = EndingPeriod; type EndingPeriod = EndingPeriod;
type Randomness = pallet_babe::RandomnessFromOneEpochAgo<Runtime>; type Randomness = CurrentBlockRandomness;
type InitiateOrigin = EnsureRoot<AccountId>; type InitiateOrigin = EnsureRoot<AccountId>;
type WeightInfo = auctions::TestWeightInfo; type WeightInfo = auctions::TestWeightInfo;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment