Skip to content

Commit

Permalink
Add pallet-ddc-staking to the cere runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
khssnv committed Jul 17, 2023
1 parent 5d46d8a commit c32940d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
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.

3 changes: 3 additions & 0 deletions runtime/cere/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ pallet-cere-ddc = { version = "4.8.0", default-features = false, path = "../../p
pallet-erc721 = { version = "4.8.0", default-features = false, path = "../../pallets/erc721" }
pallet-erc20 = { version = "4.8.0", default-features = false, path = "../../pallets/erc20" }
pallet-ddc-metrics-offchain-worker = { version = "4.8.0", default-features = false, path = "../../pallets/ddc-metrics-offchain-worker" }
pallet-ddc-staking = { version = "4.8.0", default-features = false, path = "../../pallets/ddc-staking" }

[build-dependencies]
substrate-wasm-builder = { version = "5.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" }
Expand Down Expand Up @@ -177,6 +178,7 @@ std = [
"sp-io/std",
"pallet-child-bounties/std",
"pallet-ddc-metrics-offchain-worker/std",
"pallet-ddc-staking/std",
"cere-runtime-common/std",
"cere-runtime-constants/std"
]
Expand All @@ -193,6 +195,7 @@ runtime-benchmarks = [
"pallet-child-bounties/runtime-benchmarks",
"pallet-collective/runtime-benchmarks",
"pallet-contracts/runtime-benchmarks",
"pallet-ddc-staking/runtime-benchmarks",
"pallet-democracy/runtime-benchmarks",
"pallet-election-provider-multi-phase/runtime-benchmarks",
"pallet-election-provider-support-benchmarking/runtime-benchmarks",
Expand Down
22 changes: 22 additions & 0 deletions runtime/cere/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ pub use pallet_cere_ddc;
pub use pallet_chainbridge;
use pallet_contracts::weights::WeightInfo;
pub use pallet_ddc_metrics_offchain_worker;
pub use pallet_ddc_staking;
use pallet_election_provider_multi_phase::SolutionAccuracyOf;
use pallet_grandpa::{
fg_primitives, AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList,
Expand All @@ -76,6 +77,7 @@ use sp_runtime::{
transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity},
ApplyExtrinsicResult, FixedPointNumber, FixedU128, Perbill, Percent, Permill, Perquintill,
};
use sp_staking::EraIndex;
use sp_std::prelude::*;
#[cfg(any(feature = "std", test))]
use sp_version::NativeVersion;
Expand Down Expand Up @@ -1315,6 +1317,25 @@ impl pallet_ddc_metrics_offchain_worker::Config for Runtime {
type RuntimeCall = RuntimeCall;
}

parameter_types! {
pub const DefaultEdgeBondSize: Balance = 100 * DOLLARS;
pub const DefaultEdgeChillDelay: EraIndex = 7 * 24 * 60 / 2; // approx. 1 week with 2 min DDC era
pub const DefaultStorageBondSize: Balance = 100 * DOLLARS;
pub const DefaultStorageChillDelay: EraIndex = 7 * 24 * 60 / 2; // approx. 1 week with 2 min DDC era
}

impl pallet_ddc_staking::Config for Runtime {
type BondingDuration = BondingDuration;
type Currency = Balances;
type DefaultEdgeBondSize = DefaultEdgeBondSize;
type DefaultEdgeChillDelay = DefaultEdgeChillDelay;
type DefaultStorageBondSize = DefaultStorageBondSize;
type DefaultStorageChillDelay = DefaultStorageChillDelay;
type RuntimeEvent = RuntimeEvent;
type UnixTime = Timestamp;
type WeightInfo = pallet_ddc_staking::weights::SubstrateWeight<Runtime>;
}

construct_runtime!(
pub enum Runtime where
Block = Block,
Expand Down Expand Up @@ -1366,6 +1387,7 @@ construct_runtime!(
Erc721: pallet_erc721::{Pallet, Call, Storage, Event<T>},
Erc20: pallet_erc20::{Pallet, Call, Storage, Event<T>},
DdcMetricsOffchainWorker: pallet_ddc_metrics_offchain_worker::{Pallet, Call, Storage, Event<T>},
DdcStaking: pallet_ddc_staking,
}
);

Expand Down

0 comments on commit c32940d

Please sign in to comment.