Skip to content

Commit

Permalink
[Manta-PC]Add pallet_scheduler into Manta-pc (#100)
Browse files Browse the repository at this point in the history
* Add pallet_scheduler into Manta-pc
  • Loading branch information
xialovexia authored Jul 1, 2021
1 parent 702a288 commit e1f8406
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
Binary file removed .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions runtime/manta-pc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ pallet-timestamp = { version = '3.0.0', git = 'https://github.com/paritytech/sub
pallet-transaction-payment = { version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', default-features = false, branch = "master" }
pallet-transaction-payment-rpc-runtime-api = { version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', default-features = false, branch = "master" }
pallet-utility = { version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', default-features = false, branch = "master" }
pallet-scheduler = { version = '3.0.0', git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }

# Cumulus dependencies
cumulus-pallet-aura-ext = { git = 'https://github.com/paritytech/cumulus.git', default-features = false, branch = "master" }
Expand Down Expand Up @@ -126,6 +127,7 @@ std = [
'pallet-proxy/std',
'pallet-utility/std',
'pallet-randomness-collective-flip/std',
'pallet-scheduler/std',
'pallet-transaction-payment-rpc-runtime-api/std',
'pallet-timestamp/std',
'pallet-session/std',
Expand Down
24 changes: 24 additions & 0 deletions runtime/manta-pc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,27 @@ impl pallet_transaction_payment::Config for Runtime {
type FeeMultiplierUpdate = SlowAdjustingFeeUpdate<Self>;
}

parameter_types! {
// The maximum weight that may be scheduled per block for any
// dispatchables of less priority than schedule::HARD_DEADLINE.
pub MaximumSchedulerWeight: Weight = Perbill::from_percent(80) *
RuntimeBlockWeights::get().max_block;
// The maximum number of scheduled calls in the queue for a single block.
// Not strictly enforced, but used for weight estimation.
pub const MaxScheduledPerBlock: u32 = 50;
}

impl pallet_scheduler::Config for Runtime {
type Event = Event;
type Origin = Origin;
type PalletsOrigin = OriginCaller;
type Call = Call;
type MaximumWeight = MaximumSchedulerWeight;
type ScheduleOrigin = EnsureRoot<AccountId>;
type MaxScheduledPerBlock = MaxScheduledPerBlock;
type WeightInfo = pallet_scheduler::weights::SubstrateWeight<Runtime>;
}

parameter_types! {
pub const AssetDeposit: Balance = 100 * MA; // 100 DOLLARS deposit to create asset
pub const ApprovalDeposit: Balance = NativeTokenExistentialDeposit::get();
Expand Down Expand Up @@ -608,6 +629,9 @@ construct_runtime!(
RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Call, Storage} = 2,
Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 3,
ParachainInfo: parachain_info::{Pallet, Storage, Config} = 4,
Scheduler: pallet_scheduler::{Pallet, Call, Storage, Event<T>} = 5,



// Monetary stuff.
Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>} = 10,
Expand Down

0 comments on commit e1f8406

Please sign in to comment.