mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 12:51:02 +00:00
Tweak Rococo Settings For Onboarding Testing (#2671)
* Tweak Rococo Settings * rococo: use CurrentBlockRandomness wrapper in auctions Co-authored-by: André Silva <andrerfosilva@gmail.com> Co-authored-by: Bastian Köcher <info@kchr.de>
This commit is contained in:
@@ -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! {
|
|||||||
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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user