Skip to content
This repository was archived by the owner on May 22, 2023. It is now read-only.

Commit 4f65602

Browse files
author
Andrei Navoichyk
authored
Merge pull request #191 from Cerebellum-Network/feature/cere-staking
DDC staking for CDN and storage roles
2 parents c026e5a + db0f26a commit 4f65602

File tree

8 files changed

+662
-1
lines changed

8 files changed

+662
-1
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [vNext]
9+
### Added
10+
- DDC staking initial impl in `ddc-staking` pallet
11+
12+
### Changed
13+
- Node runtime extended with `ddc-staking` pallet
14+
815
## [2.33.0]
916
### Changed
1017
- Updated Substrate to polkadot-v0.9.19

Cargo.lock

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ members = [
8787
"frame/election-provider-support/solution-type/fuzzer",
8888
"frame/ddc-metrics-offchain-worker",
8989
"frame/ddc-pallet",
90+
"frame/ddc-staking",
9091
"frame/executive",
9192
"frame/gilt",
9293
"frame/grandpa",

bin/node/runtime/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ pallet-cere-ddc = { version = "7.3.0", default-features = false, path = "../../.
9595
pallet-erc721 = { version = "2.0.0", default-features = false, path = "../../../frame/erc721" }
9696
pallet-erc20 = { version = "2.0.0", default-features = false, path = "../../../frame/erc20" }
9797
pallet-ddc-metrics-offchain-worker = { version = "2.0.0", default-features = false, path = "../../../frame/ddc-metrics-offchain-worker" }
98+
pallet-ddc-staking = { version = "0.1.0", default-features = false, path = "../../../frame/ddc-staking" }
9899

99100
[build-dependencies]
100101
substrate-wasm-builder = { version = "5.0.0-dev", path = "../../../utils/wasm-builder" }
@@ -168,6 +169,7 @@ std = [
168169
"sp-io/std",
169170
"pallet-child-bounties/std",
170171
"pallet-ddc-metrics-offchain-worker/std",
172+
"pallet-ddc-staking/std",
171173
]
172174
runtime-benchmarks = [
173175
"frame-benchmarking/runtime-benchmarks",

bin/node/runtime/src/lib.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ use static_assertions::const_assert;
8080
pub use pallet_cere_ddc;
8181
pub use pallet_chainbridge;
8282
pub use pallet_ddc_metrics_offchain_worker;
83+
pub use pallet_ddc_staking;
8384

8485
#[cfg(any(feature = "std", test))]
8586
pub use frame_system::Call as SystemCall;
@@ -128,7 +129,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
128129
// and set impl_version to 0. If only runtime
129130
// implementation changes and behavior does not, then leave spec_version as
130131
// is and increment impl_version.
131-
spec_version: 302,
132+
spec_version: 30200,
132133
impl_version: 0,
133134
apis: RUNTIME_API_VERSIONS,
134135
transaction_version: 2,
@@ -1221,6 +1222,12 @@ impl pallet_ddc_metrics_offchain_worker::Config for Runtime {
12211222
type Call = Call;
12221223
}
12231224

1225+
impl pallet_ddc_staking::Config for Runtime {
1226+
type BondingDuration = BondingDuration;
1227+
type Currency = Balances;
1228+
type Event = Event;
1229+
}
1230+
12241231
construct_runtime!(
12251232
pub enum Runtime where
12261233
Block = Block,
@@ -1270,6 +1277,7 @@ construct_runtime!(
12701277
Erc721: pallet_erc721::{Pallet, Call, Storage, Event<T>},
12711278
Erc20: pallet_erc20::{Pallet, Call, Storage, Event<T>},
12721279
DdcMetricsOffchainWorker: pallet_ddc_metrics_offchain_worker::{Pallet, Call, Storage, Event<T>},
1280+
DdcStaking: pallet_ddc_staking,
12731281
}
12741282
);
12751283

frame/ddc-staking/Cargo.toml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[package]
2+
name = "pallet-ddc-staking"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[dependencies]
7+
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }
8+
frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" }
9+
frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" }
10+
scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
11+
sp-io = { version = "6.0.0", default-features = false, path = "../../primitives/io" }
12+
sp-runtime = { version = "6.0.0", default-features = false, path = "../../primitives/runtime" }
13+
sp-staking = { version = "4.0.0-dev", default-features = false, path = "../../primitives/staking" }
14+
sp-std = { version = "4.0.0-dev", default-features = false, path = "../../primitives/std" }
15+
16+
[features]
17+
default = ["std"]
18+
std = [
19+
"codec/std",
20+
"frame-support/std",
21+
"frame-system/std",
22+
"scale-info/std",
23+
"sp-io/std",
24+
"sp-runtime/std",
25+
"sp-staking/std",
26+
"sp-std/std",
27+
]

frame/ddc-staking/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# DDC Staking Pallet

0 commit comments

Comments
 (0)