Skip to content
Snippets Groups Projects
Commit 3761fd38 authored by Éloïs's avatar Éloïs
Browse files

fix(scheduler): impl PreimageProvider

parent 5e62acc1
Branches
Tags
No related merge requests found
......@@ -2196,6 +2196,7 @@ dependencies = [
"pallet-membership",
"pallet-multisig",
"pallet-offences",
"pallet-preimage",
"pallet-provide-randomness",
"pallet-proxy",
"pallet-scheduler",
......@@ -2264,6 +2265,7 @@ dependencies = [
"pallet-membership",
"pallet-multisig",
"pallet-offences",
"pallet-preimage",
"pallet-provide-randomness",
"pallet-proxy",
"pallet-scheduler",
......@@ -2476,6 +2478,7 @@ dependencies = [
"pallet-membership",
"pallet-multisig",
"pallet-offences",
"pallet-preimage",
"pallet-provide-randomness",
"pallet-proxy",
"pallet-scheduler",
......@@ -5067,6 +5070,22 @@ dependencies = [
"sp-std",
]
[[package]]
name = "pallet-preimage"
version = "4.0.0-dev"
source = "git+https://github.com/librelois/substrate.git?branch=duniter-monthly-2022-02#80f060dfad0363af03dbecbe39c6fa9b99042acc"
dependencies = [
"frame-benchmarking",
"frame-support",
"frame-system",
"parity-scale-codec",
"scale-info",
"sp-core",
"sp-io",
"sp-runtime",
"sp-std",
]
[[package]]
name = "pallet-provide-randomness"
version = "3.0.0"
......
......@@ -83,6 +83,7 @@ macro_rules! pallets_config {
pub MaximumSchedulerWeight: Weight = Perbill::from_percent(80) *
BlockWeights::get().max_block;
pub const MaxScheduledPerBlock: u32 = 50;
pub const NoPreimagePostponement: Option<u32> = Some(10);
}
impl pallet_scheduler::Config for Runtime {
type Event = Event;
......@@ -94,7 +95,7 @@ macro_rules! pallets_config {
type OriginPrivilegeCmp = EqualPrivilegeOnly;
type MaxScheduledPerBlock = MaxScheduledPerBlock;
type WeightInfo = pallet_scheduler::weights::SubstrateWeight<Runtime>;
type PreimageProvider = ();
type PreimageProvider = Preimage;
type NoPreimagePostponement = ();
}
......@@ -257,6 +258,30 @@ macro_rules! pallets_config {
type MaxAuthorities = MaxAuthorities;
}
// ONCHAIN GOVERNANCE //
impl pallet_upgrade_origin::Config for Runtime {
type Event = Event;
type Call = Call;
type UpgradableOrigin = pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, SmithsInstance>;
}
parameter_types! {
pub const PreimageMaxSize: u32 = 4096 * 1024;
pub const PreimageBaseDeposit: Balance = deposit(2, 64);
pub const PreimageByteDeposit: Balance = deposit(0, 1);
}
impl pallet_preimage::Config for Runtime {
type WeightInfo = pallet_preimage::weights::SubstrateWeight<Runtime>;
type Event = Event;
type Currency = Balances;
type ManagerOrigin = EnsureRoot<AccountId>;
type MaxSize = PreimageMaxSize;
type BaseDeposit = PreimageBaseDeposit;
type ByteDeposit = PreimageByteDeposit;
}
// UTILITIES //
impl pallet_atomic_swap::Config for Runtime {
......
......@@ -52,6 +52,7 @@ std = [
'pallet-provide-randomness/std',
'pallet-im-online/std',
'pallet-multisig/std',
'pallet-preimage/std',
'pallet-proxy/std',
'pallet-session/std',
'pallet-sudo/std',
......@@ -147,6 +148,7 @@ pallet-grandpa = { git = 'https://github.com/librelois/substrate.git', branch =
pallet-im-online = { git = 'https://github.com/librelois/substrate.git', branch = 'duniter-monthly-2022-02', default-features = false }
pallet-offences = { git = 'https://github.com/librelois/substrate.git', branch = 'duniter-monthly-2022-02', default-features = false }
pallet-multisig = { git = 'https://github.com/librelois/substrate.git', branch = 'duniter-monthly-2022-02', default-features = false }
pallet-preimage = { git = 'https://github.com/librelois/substrate.git', branch = 'duniter-monthly-2022-02', default-features = false }
pallet-proxy = { git = 'https://github.com/librelois/substrate.git', branch = 'duniter-monthly-2022-02', default-features = false }
pallet-scheduler = { git = 'https://github.com/librelois/substrate.git', branch = 'duniter-monthly-2022-02', default-features = false }
pallet-session = { git = 'https://github.com/librelois/substrate.git', branch = 'duniter-monthly-2022-02', default-features = false }
......
......@@ -47,6 +47,7 @@ use frame_system::EnsureRoot;
use pallet_grandpa::fg_primitives;
use pallet_grandpa::{AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList};
use sp_api::impl_runtime_apis;
use sp_core::u32_trait::*;
use sp_core::OpaqueMetadata;
use sp_runtime::traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, NumberFor, OpaqueKeys};
use sp_runtime::{
......@@ -221,6 +222,8 @@ construct_runtime!(
// Governance stuff.
Sudo: pallet_sudo::{Pallet, Call, Config<T>, Storage, Event<T>} = 20,
UpgradeOrigin: pallet_upgrade_origin::{Pallet, Call, Event} = 21,
Preimage: pallet_preimage::{Pallet, Call, Storage, Event<T>} = 22,
// Universal dividend
UdAccountsStorage: pallet_ud_accounts_storage::{Pallet, Config<T>, Storage} = 30,
......
......@@ -52,6 +52,7 @@ std = [
'pallet-provide-randomness/std',
'pallet-im-online/std',
'pallet-multisig/std',
'pallet-preimage/std',
'pallet-proxy/std',
'pallet-session/std',
'pallet-sudo/std',
......@@ -147,6 +148,7 @@ pallet-grandpa = { git = 'https://github.com/librelois/substrate.git', branch =
pallet-im-online = { git = 'https://github.com/librelois/substrate.git', branch = 'duniter-monthly-2022-02', default-features = false }
pallet-offences = { git = 'https://github.com/librelois/substrate.git', branch = 'duniter-monthly-2022-02', default-features = false }
pallet-multisig = { git = 'https://github.com/librelois/substrate.git', branch = 'duniter-monthly-2022-02', default-features = false }
pallet-preimage = { git = 'https://github.com/librelois/substrate.git', branch = 'duniter-monthly-2022-02', default-features = false }
pallet-proxy = { git = 'https://github.com/librelois/substrate.git', branch = 'duniter-monthly-2022-02', default-features = false }
pallet-scheduler = { git = 'https://github.com/librelois/substrate.git', branch = 'duniter-monthly-2022-02', default-features = false }
pallet-session = { git = 'https://github.com/librelois/substrate.git', branch = 'duniter-monthly-2022-02', default-features = false }
......
......@@ -233,12 +233,6 @@ common_runtime::pallets_config! {
type Event = Event;
type Call = Call;
}
impl pallet_upgrade_origin::Config for Runtime {
type Event = Event;
type Call = Call;
type UpgradableOrigin = pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, SmithsInstance>;
}
}
// Create the runtime by composing the FRAME pallets that were previously configured.
......@@ -277,6 +271,7 @@ construct_runtime!(
// Governance stuff
Sudo: pallet_sudo::{Pallet, Call, Config<T>, Storage, Event<T>} = 20,
UpgradeOrigin: pallet_upgrade_origin::{Pallet, Call, Event} = 21,
Preimage: pallet_preimage::{Pallet, Call, Storage, Event<T>} = 22,
// Universal dividend
UdAccountsStorage: pallet_ud_accounts_storage::{Pallet, Config<T>, Storage} = 30,
......
......@@ -52,6 +52,7 @@ std = [
'pallet-provide-randomness/std',
'pallet-im-online/std',
'pallet-multisig/std',
'pallet-preimage/std',
'pallet-proxy/std',
'pallet-session/std',
'pallet-sudo/std',
......@@ -147,6 +148,7 @@ pallet-grandpa = { git = 'https://github.com/librelois/substrate.git', branch =
pallet-im-online = { git = 'https://github.com/librelois/substrate.git', branch = 'duniter-monthly-2022-02', default-features = false }
pallet-offences = { git = 'https://github.com/librelois/substrate.git', branch = 'duniter-monthly-2022-02', default-features = false }
pallet-multisig = { git = 'https://github.com/librelois/substrate.git', branch = 'duniter-monthly-2022-02', default-features = false }
pallet-preimage = { git = 'https://github.com/librelois/substrate.git', branch = 'duniter-monthly-2022-02', default-features = false }
pallet-proxy = { git = 'https://github.com/librelois/substrate.git', branch = 'duniter-monthly-2022-02', default-features = false }
pallet-scheduler = { git = 'https://github.com/librelois/substrate.git', branch = 'duniter-monthly-2022-02', default-features = false }
pallet-session = { git = 'https://github.com/librelois/substrate.git', branch = 'duniter-monthly-2022-02', default-features = false }
......
......@@ -47,6 +47,7 @@ use frame_system::EnsureRoot;
use pallet_grandpa::fg_primitives;
use pallet_grandpa::{AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList};
use sp_api::impl_runtime_apis;
use sp_core::u32_trait::*;
use sp_core::OpaqueMetadata;
use sp_runtime::traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, NumberFor, OpaqueKeys};
use sp_runtime::{
......@@ -222,6 +223,8 @@ construct_runtime!(
// Governance stuff.
Sudo: pallet_sudo::{Pallet, Call, Config<T>, Storage, Event<T>} = 20,
UpgradeOrigin: pallet_upgrade_origin::{Pallet, Call, Event} = 21,
Preimage: pallet_preimage::{Pallet, Call, Storage, Event<T>} = 22,
// Universal dividend
UdAccountsStorage: pallet_ud_accounts_storage::{Pallet, Config<T>, Storage} = 30,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment