Skip to content

Commit

Permalink
[shell-runtime] add timestamp pallet
Browse files Browse the repository at this point in the history
  • Loading branch information
clangenb committed Jun 13, 2021
1 parent 38669ba commit 460102a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
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.

4 changes: 4 additions & 0 deletions polkadot-parachains/shell-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ frame-system = { git = "https://github.com/paritytech/substrate", default-featur

pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.4" }
pallet-sudo = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.4" }
pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.4" }

# Cumulus dependencies
cumulus-pallet-parachain-system = { path = "../../pallets/parachain-system", default-features = false }
Expand Down Expand Up @@ -79,4 +80,7 @@ std = [
"xcm/std",
"xcm-builder/std",
"xcm-executor/std",
"pallet-balances/std",
"pallet-sudo/std",
"pallet-timestamp/std",
]
17 changes: 16 additions & 1 deletion polkadot-parachains/shell-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,21 @@ impl cumulus_pallet_parachain_system::Config for Runtime {

impl parachain_info::Config for Runtime {}

pub const MILLISECS_PER_BLOCK: u64 = 12000;
pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK;

parameter_types! {
pub const MinimumPeriod: u64 = SLOT_DURATION / 2;
}

impl pallet_timestamp::Config for Runtime {
/// A timestamp: milliseconds since the unix epoch.
type Moment = u64;
type OnTimestampSet = ();
type MinimumPeriod = MinimumPeriod;
type WeightInfo = ();
}

impl pallet_sudo::Config for Runtime {
type Call = Call;
type Event = Event;
Expand Down Expand Up @@ -257,14 +272,14 @@ construct_runtime! {
UncheckedExtrinsic = UncheckedExtrinsic,
{
System: frame_system::{Pallet, Call, Storage, Config, Event<T>},
Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent},
ParachainSystem: cumulus_pallet_parachain_system::{Pallet, Call, Config, Storage, Inherent, Event<T>, ValidateUnsigned},
ParachainInfo: parachain_info::{Pallet, Storage, Config},

// added by integritee
Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>} = 30,
Sudo: pallet_sudo::{Pallet, Call, Storage, Config<T>, Event<T>},


// DMP handler.
CumulusXcm: cumulus_pallet_xcm::{Pallet, Call, Storage, Event<T>, Origin},
}
Expand Down

0 comments on commit 460102a

Please sign in to comment.