Browse Source

runtime: Fix tests.

Shamil Gadelshin 4 years ago
parent
commit
b685c4df32

+ 485 - 0
Cargo.lock

@@ -583,6 +583,12 @@ dependencies = [
  "syn",
 ]
 
+[[package]]
+name = "difference"
+version = "2.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198"
+
 [[package]]
 name = "digest"
 version = "0.8.1"
@@ -601,6 +607,12 @@ dependencies = [
  "generic-array 0.14.4",
 ]
 
+[[package]]
+name = "downcast"
+version = "0.10.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4bb454f0228b18c7f4c3b0ebbee346ed9c52e7443b0999cd543ff3571205701d"
+
 [[package]]
 name = "dyn-clonable"
 version = "0.9.0"
@@ -739,6 +751,15 @@ version = "0.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d"
 
+[[package]]
+name = "float-cmp"
+version = "0.8.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e1267f4ac4f343772758f7b1bdcbe767c218bbab93bb432acbf5162bbf85a6c4"
+dependencies = [
+ "num-traits",
+]
+
 [[package]]
 name = "fnv"
 version = "1.0.7"
@@ -755,6 +776,12 @@ dependencies = [
  "percent-encoding",
 ]
 
+[[package]]
+name = "fragile"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "69a039c3498dc930fe810151a34ba0c1c70b02b8625035592e74432f678591f2"
+
 [[package]]
 name = "frame-benchmarking"
 version = "2.0.0"
@@ -1359,21 +1386,40 @@ dependencies = [
  "pallet-babe",
  "pallet-balances",
  "pallet-collective",
+ "pallet-common",
+ "pallet-content-directory",
+ "pallet-content-working-group",
  "pallet-finality-tracker",
+ "pallet-forum",
+ "pallet-governance",
  "pallet-grandpa",
+ "pallet-hiring",
  "pallet-im-online",
+ "pallet-membership",
+ "pallet-memo",
  "pallet-offences",
  "pallet-offences-benchmarking",
+ "pallet-proposals-codex",
+ "pallet-proposals-discussion",
+ "pallet-proposals-engine",
  "pallet-randomness-collective-flip",
+ "pallet-recurring-reward",
+ "pallet-service-discovery",
  "pallet-session",
  "pallet-session-benchmarking",
+ "pallet-stake",
  "pallet-staking",
  "pallet-staking-reward-curve",
+ "pallet-storage",
  "pallet-sudo",
  "pallet-timestamp",
+ "pallet-token-mint",
  "pallet-transaction-payment",
  "pallet-transaction-payment-rpc-runtime-api",
  "pallet-utility",
+ "pallet-versioned-store",
+ "pallet-versioned-store-permissions",
+ "pallet-working-group",
  "parity-scale-codec",
  "serde",
  "sp-api",
@@ -1679,6 +1725,33 @@ dependencies = [
  "autocfg 1.0.1",
 ]
 
+[[package]]
+name = "mockall"
+version = "0.7.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "01458f8a19b10cb28195290942e3149161c75acf67ebc8fbf714ab67a2b943bc"
+dependencies = [
+ "cfg-if 0.1.10",
+ "downcast",
+ "fragile",
+ "lazy_static",
+ "mockall_derive",
+ "predicates",
+ "predicates-tree",
+]
+
+[[package]]
+name = "mockall_derive"
+version = "0.7.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a673cb441f78cd9af4f5919c28576a3cc325fb6b54e42f7047dacce3c718c17b"
+dependencies = [
+ "cfg-if 0.1.10",
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
 [[package]]
 name = "multihash"
 version = "0.11.4"
@@ -1747,6 +1820,12 @@ version = "0.1.14"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb"
 
+[[package]]
+name = "normalize-line-endings"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be"
+
 [[package]]
 name = "num-bigint"
 version = "0.2.6"
@@ -1923,6 +2002,60 @@ dependencies = [
  "sp-std",
 ]
 
+[[package]]
+name = "pallet-common"
+version = "3.1.0"
+dependencies = [
+ "frame-support",
+ "frame-system",
+ "pallet-timestamp",
+ "parity-scale-codec",
+ "serde",
+ "sp-runtime",
+ "strum",
+ "strum_macros",
+]
+
+[[package]]
+name = "pallet-content-directory"
+version = "3.1.0"
+dependencies = [
+ "frame-support",
+ "frame-system",
+ "parity-scale-codec",
+ "serde",
+ "sp-arithmetic",
+ "sp-core",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+]
+
+[[package]]
+name = "pallet-content-working-group"
+version = "3.1.0"
+dependencies = [
+ "frame-support",
+ "frame-system",
+ "pallet-balances",
+ "pallet-common",
+ "pallet-hiring",
+ "pallet-membership",
+ "pallet-recurring-reward",
+ "pallet-stake",
+ "pallet-timestamp",
+ "pallet-token-mint",
+ "pallet-versioned-store",
+ "pallet-versioned-store-permissions",
+ "parity-scale-codec",
+ "serde",
+ "sp-arithmetic",
+ "sp-core",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+]
+
 [[package]]
 name = "pallet-finality-tracker"
 version = "2.0.0"
@@ -1939,6 +2072,44 @@ dependencies = [
  "sp-std",
 ]
 
+[[package]]
+name = "pallet-forum"
+version = "3.1.0"
+dependencies = [
+ "frame-support",
+ "frame-system",
+ "pallet-common",
+ "pallet-timestamp",
+ "parity-scale-codec",
+ "serde",
+ "sp-arithmetic",
+ "sp-core",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+]
+
+[[package]]
+name = "pallet-governance"
+version = "3.1.0"
+dependencies = [
+ "frame-support",
+ "frame-system",
+ "pallet-balances",
+ "pallet-common",
+ "pallet-membership",
+ "pallet-recurring-reward",
+ "pallet-timestamp",
+ "pallet-token-mint",
+ "parity-scale-codec",
+ "serde",
+ "sp-arithmetic",
+ "sp-core",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+]
+
 [[package]]
 name = "pallet-grandpa"
 version = "2.0.0"
@@ -1961,6 +2132,24 @@ dependencies = [
  "sp-std",
 ]
 
+[[package]]
+name = "pallet-hiring"
+version = "3.1.0"
+dependencies = [
+ "frame-support",
+ "frame-system",
+ "mockall",
+ "pallet-balances",
+ "pallet-stake",
+ "parity-scale-codec",
+ "serde",
+ "sp-arithmetic",
+ "sp-core",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+]
+
 [[package]]
 name = "pallet-im-online"
 version = "2.0.0"
@@ -1981,6 +2170,36 @@ dependencies = [
  "sp-std",
 ]
 
+[[package]]
+name = "pallet-membership"
+version = "3.1.0"
+dependencies = [
+ "frame-support",
+ "frame-system",
+ "pallet-balances",
+ "pallet-common",
+ "pallet-timestamp",
+ "parity-scale-codec",
+ "serde",
+ "sp-arithmetic",
+ "sp-core",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+]
+
+[[package]]
+name = "pallet-memo"
+version = "3.1.0"
+dependencies = [
+ "frame-support",
+ "frame-system",
+ "pallet-common",
+ "parity-scale-codec",
+ "sp-arithmetic",
+ "sp-std",
+]
+
 [[package]]
 name = "pallet-offences"
 version = "2.0.0"
@@ -2017,6 +2236,76 @@ dependencies = [
  "sp-std",
 ]
 
+[[package]]
+name = "pallet-proposals-codex"
+version = "3.1.0"
+dependencies = [
+ "frame-support",
+ "frame-system",
+ "pallet-balances",
+ "pallet-common",
+ "pallet-governance",
+ "pallet-hiring",
+ "pallet-membership",
+ "pallet-proposals-discussion",
+ "pallet-proposals-engine",
+ "pallet-recurring-reward",
+ "pallet-stake",
+ "pallet-staking",
+ "pallet-staking-reward-curve",
+ "pallet-timestamp",
+ "pallet-token-mint",
+ "pallet-working-group",
+ "parity-scale-codec",
+ "serde",
+ "sp-arithmetic",
+ "sp-core",
+ "sp-io",
+ "sp-runtime",
+ "sp-staking",
+ "sp-std",
+ "strum",
+]
+
+[[package]]
+name = "pallet-proposals-discussion"
+version = "3.1.0"
+dependencies = [
+ "frame-support",
+ "frame-system",
+ "pallet-balances",
+ "pallet-common",
+ "pallet-membership",
+ "pallet-timestamp",
+ "parity-scale-codec",
+ "serde",
+ "sp-core",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+]
+
+[[package]]
+name = "pallet-proposals-engine"
+version = "3.1.0"
+dependencies = [
+ "frame-support",
+ "frame-system",
+ "mockall",
+ "pallet-balances",
+ "pallet-common",
+ "pallet-membership",
+ "pallet-stake",
+ "pallet-timestamp",
+ "parity-scale-codec",
+ "serde",
+ "sp-arithmetic",
+ "sp-core",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+]
+
 [[package]]
 name = "pallet-randomness-collective-flip"
 version = "2.0.0"
@@ -2030,6 +2319,44 @@ dependencies = [
  "sp-std",
 ]
 
+[[package]]
+name = "pallet-recurring-reward"
+version = "3.1.0"
+dependencies = [
+ "frame-support",
+ "frame-system",
+ "pallet-balances",
+ "pallet-token-mint",
+ "parity-scale-codec",
+ "sp-arithmetic",
+ "sp-core",
+ "sp-io",
+ "sp-runtime",
+]
+
+[[package]]
+name = "pallet-service-discovery"
+version = "3.1.0"
+dependencies = [
+ "frame-support",
+ "frame-system",
+ "pallet-balances",
+ "pallet-common",
+ "pallet-hiring",
+ "pallet-membership",
+ "pallet-recurring-reward",
+ "pallet-stake",
+ "pallet-timestamp",
+ "pallet-token-mint",
+ "pallet-working-group",
+ "parity-scale-codec",
+ "serde",
+ "sp-core",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+]
+
 [[package]]
 name = "pallet-session"
 version = "2.0.0"
@@ -2066,6 +2393,22 @@ dependencies = [
  "sp-std",
 ]
 
+[[package]]
+name = "pallet-stake"
+version = "3.1.0"
+dependencies = [
+ "frame-support",
+ "frame-system",
+ "pallet-balances",
+ "pallet-timestamp",
+ "parity-scale-codec",
+ "sp-arithmetic",
+ "sp-core",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+]
+
 [[package]]
 name = "pallet-staking"
 version = "2.0.0"
@@ -2099,6 +2442,30 @@ dependencies = [
  "syn",
 ]
 
+[[package]]
+name = "pallet-storage"
+version = "3.1.0"
+dependencies = [
+ "frame-support",
+ "frame-system",
+ "pallet-balances",
+ "pallet-common",
+ "pallet-hiring",
+ "pallet-membership",
+ "pallet-recurring-reward",
+ "pallet-stake",
+ "pallet-timestamp",
+ "pallet-token-mint",
+ "pallet-working-group",
+ "parity-scale-codec",
+ "serde",
+ "sp-arithmetic",
+ "sp-core",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+]
+
 [[package]]
 name = "pallet-sudo"
 version = "2.0.0"
@@ -2131,6 +2498,20 @@ dependencies = [
  "sp-timestamp",
 ]
 
+[[package]]
+name = "pallet-token-mint"
+version = "3.1.0"
+dependencies = [
+ "frame-support",
+ "frame-system",
+ "pallet-balances",
+ "parity-scale-codec",
+ "sp-arithmetic",
+ "sp-core",
+ "sp-io",
+ "sp-runtime",
+]
+
 [[package]]
 name = "pallet-transaction-payment"
 version = "2.0.0"
@@ -2177,6 +2558,63 @@ dependencies = [
  "sp-std",
 ]
 
+[[package]]
+name = "pallet-versioned-store"
+version = "3.1.0"
+dependencies = [
+ "frame-support",
+ "frame-system",
+ "pallet-common",
+ "pallet-timestamp",
+ "parity-scale-codec",
+ "serde",
+ "sp-core",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+]
+
+[[package]]
+name = "pallet-versioned-store-permissions"
+version = "3.1.0"
+dependencies = [
+ "frame-support",
+ "frame-system",
+ "pallet-common",
+ "pallet-timestamp",
+ "pallet-versioned-store",
+ "parity-scale-codec",
+ "serde",
+ "sp-arithmetic",
+ "sp-core",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+]
+
+[[package]]
+name = "pallet-working-group"
+version = "3.1.0"
+dependencies = [
+ "frame-support",
+ "frame-system",
+ "pallet-balances",
+ "pallet-common",
+ "pallet-hiring",
+ "pallet-membership",
+ "pallet-recurring-reward",
+ "pallet-stake",
+ "pallet-timestamp",
+ "pallet-token-mint",
+ "parity-scale-codec",
+ "serde",
+ "sp-arithmetic",
+ "sp-core",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+]
+
 [[package]]
 name = "parity-multiaddr"
 version = "0.9.6"
@@ -2456,6 +2894,35 @@ version = "0.2.10"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857"
 
+[[package]]
+name = "predicates"
+version = "1.0.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "eeb433456c1a57cc93554dea3ce40b4c19c4057e41c55d4a0f3d84ea71c325aa"
+dependencies = [
+ "difference",
+ "float-cmp",
+ "normalize-line-endings",
+ "predicates-core",
+ "regex",
+]
+
+[[package]]
+name = "predicates-core"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "57e35a3326b75e49aa85f5dc6ec15b41108cf5aee58eabb1f274dd18b73c2451"
+
+[[package]]
+name = "predicates-tree"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "15f553275e5721409451eb85e15fd9a860a6e5ab4496eb215987502b5f5391f2"
+dependencies = [
+ "predicates-core",
+ "treeline",
+]
+
 [[package]]
 name = "primitive-types"
 version = "0.7.3"
@@ -3643,6 +4110,18 @@ version = "0.19.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "b89a286a7e3b5720b9a477b23253bc50debac207c8d21505f8e70b36792f11b5"
 
+[[package]]
+name = "strum_macros"
+version = "0.19.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e61bb0be289045cb80bfce000512e32d09f8337e54c186725da381377ad1f8d5"
+dependencies = [
+ "heck",
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
 [[package]]
 name = "substrate-bip39"
 version = "0.4.2"
@@ -3932,6 +4411,12 @@ dependencies = [
  "tracing-serde",
 ]
 
+[[package]]
+name = "treeline"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a7f741b240f1a48843f9b8e0444fb55fb2a4ff67293b50a9179dfd5ea67f8d41"
+
 [[package]]
 name = "trie-db"
 version = "0.22.1"

+ 1 - 1
runtime-modules/content-working-group/src/lib.rs

@@ -4,7 +4,7 @@
 
 // Clippy linter warning. TODO: refactor "this function has too many argument"
 #![allow(clippy::too_many_arguments)] // disable it because of possible API break
-
+#![allow(clippy::match_like_matches_macro)]
 // Ensure we're `no_std` when compiling for Wasm.
 #![cfg_attr(not(feature = "std"), no_std)]
 

+ 1 - 0
runtime-modules/governance/src/election.rs

@@ -28,6 +28,7 @@
 
 // Clippy linter warning
 #![allow(clippy::redundant_closure_call)] // disable it because of the substrate lib design
+#![allow(clippy::match_like_matches_macro)]
 
 #[cfg(feature = "std")]
 use serde::{Deserialize, Serialize};

+ 1 - 0
runtime-modules/versioned-store/src/lib.rs

@@ -10,6 +10,7 @@
 
 // Ensure we're `no_std` when compiling for Wasm.
 #![cfg_attr(not(feature = "std"), no_std)]
+#![allow(clippy::match_like_matches_macro)]
 
 #[cfg(feature = "std")]
 use serde::{Deserialize, Serialize};

+ 38 - 38
runtime/Cargo.toml

@@ -60,25 +60,25 @@ pallet-offences-benchmarking = { git = 'https://github.com/paritytech/substrate.
 pallet-session-benchmarking = { git = 'https://github.com/paritytech/substrate.git', rev = 'a200cdb93c6af5763b9c7bf313fa708764ac88ca', default-features = false, optional = true }
 
 # Joystream
-#common = { package = 'pallet-common', default-features = false, path = '../runtime-modules/common'}
-#memo = { package = 'pallet-memo', default-features = false, path = '../runtime-modules/memo'}
-#forum = { package = 'pallet-forum', default-features = false, path = '../runtime-modules/forum'}
-#membership = { package = 'pallet-membership', default-features = false, path = '../runtime-modules/membership'}
-#stake = { package = 'pallet-stake', default-features = false, path = '../runtime-modules/stake'}
-#governance = { package = 'pallet-governance', default-features = false, path = '../runtime-modules/governance'}
-#hiring = { package = 'pallet-hiring', default-features = false, path = '../runtime-modules/hiring'}
-#minting = { package = 'pallet-token-mint', default-features = false, path = '../runtime-modules/token-minting'}
-#recurring-rewards = { package = 'pallet-recurring-reward', default-features = false, path = '../runtime-modules/recurring-reward'}
-#working-group = { package = 'pallet-working-group', default-features = false, path = '../runtime-modules/working-group'}
-#content-working-group = { package = 'pallet-content-working-group', default-features = false, path = '../runtime-modules/content-working-group'}
-#versioned-store = { package = 'pallet-versioned-store', default-features = false, path = '../runtime-modules/versioned-store'}
-#versioned-store-permissions = { package = 'pallet-versioned-store-permissions', default-features = false, path = '../runtime-modules/versioned-store-permissions'}
-#storage = { package = 'pallet-storage', default-features = false, path = '../runtime-modules/storage'}
-#service-discovery = { package = 'pallet-service-discovery', default-features = false, path = '../runtime-modules/service-discovery'}
-#proposals-engine = { package = 'pallet-proposals-engine', default-features = false, path = '../runtime-modules/proposals/engine'}
-#proposals-discussion = { package = 'pallet-proposals-discussion', default-features = false, path = '../runtime-modules/proposals/discussion'}
-#proposals-codex = { package = 'pallet-proposals-codex', default-features = false, path = '../runtime-modules/proposals/codex'}
-#content-directory = { package = 'pallet-content-directory', default-features = false, path = '../runtime-modules/content-directory' }
+common = { package = 'pallet-common', default-features = false, path = '../runtime-modules/common'}
+memo = { package = 'pallet-memo', default-features = false, path = '../runtime-modules/memo'}
+forum = { package = 'pallet-forum', default-features = false, path = '../runtime-modules/forum'}
+membership = { package = 'pallet-membership', default-features = false, path = '../runtime-modules/membership'}
+stake = { package = 'pallet-stake', default-features = false, path = '../runtime-modules/stake'}
+governance = { package = 'pallet-governance', default-features = false, path = '../runtime-modules/governance'}
+hiring = { package = 'pallet-hiring', default-features = false, path = '../runtime-modules/hiring'}
+minting = { package = 'pallet-token-mint', default-features = false, path = '../runtime-modules/token-minting'}
+recurring-rewards = { package = 'pallet-recurring-reward', default-features = false, path = '../runtime-modules/recurring-reward'}
+working-group = { package = 'pallet-working-group', default-features = false, path = '../runtime-modules/working-group'}
+content-working-group = { package = 'pallet-content-working-group', default-features = false, path = '../runtime-modules/content-working-group'}
+versioned-store = { package = 'pallet-versioned-store', default-features = false, path = '../runtime-modules/versioned-store'}
+versioned-store-permissions = { package = 'pallet-versioned-store-permissions', default-features = false, path = '../runtime-modules/versioned-store-permissions'}
+storage = { package = 'pallet-storage', default-features = false, path = '../runtime-modules/storage'}
+service-discovery = { package = 'pallet-service-discovery', default-features = false, path = '../runtime-modules/service-discovery'}
+proposals-engine = { package = 'pallet-proposals-engine', default-features = false, path = '../runtime-modules/proposals/engine'}
+proposals-discussion = { package = 'pallet-proposals-discussion', default-features = false, path = '../runtime-modules/proposals/discussion'}
+proposals-codex = { package = 'pallet-proposals-codex', default-features = false, path = '../runtime-modules/proposals/codex'}
+content-directory = { package = 'pallet-content-directory', default-features = false, path = '../runtime-modules/content-directory' }
 
 [dev-dependencies]
 sp-io = { package = 'sp-io', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = 'a200cdb93c6af5763b9c7bf313fa708764ac88ca'}
@@ -137,25 +137,25 @@ std = [
     'substrate-utility/std',
 
     # Joystream
-#    'common/std',
-#    'memo/std',
-#    'forum/std',
-#    'membership/std',
-#    'stake/std',
-#    'governance/std',
-#    'hiring/std',
-#    'minting/std',
-#    'recurring-rewards/std',
-#    'working-group/std',
-#    'content-working-group/std',
-#    'versioned-store/std',
-#    'versioned-store-permissions/std',
-#    'storage/std',
-#    'service-discovery/std',
-#    'proposals-engine/std',
-#    'proposals-discussion/std',
-#    'proposals-codex/std',
-#    'content-directory/std',
+    'common/std',
+    'memo/std',
+    'forum/std',
+    'membership/std',
+    'stake/std',
+    'governance/std',
+    'hiring/std',
+    'minting/std',
+    'recurring-rewards/std',
+    'working-group/std',
+    'content-working-group/std',
+    'versioned-store/std',
+    'versioned-store-permissions/std',
+    'storage/std',
+    'service-discovery/std',
+    'proposals-engine/std',
+    'proposals-discussion/std',
+    'proposals-codex/std',
+    'content-directory/std',
 ]
 runtime-benchmarks = [
     "frame-system/runtime-benchmarks",

+ 7 - 7
runtime/src/integration/mod.rs

@@ -1,8 +1,8 @@
-// pub mod content_directory;
-// pub mod content_working_group;
-// pub mod forum;
-// pub mod proposals;
-// pub mod storage;
+pub mod content_directory;
+pub mod content_working_group;
+pub mod forum;
+pub mod proposals;
+pub mod storage;
 pub mod transactions;
-// pub mod versioned_store_permissions;
-// pub mod working_group;
+pub mod versioned_store_permissions;
+pub mod working_group;

+ 11 - 8
runtime/src/integration/proposals/council_origin_validator.rs

@@ -14,15 +14,18 @@ pub struct CouncilManager<T> {
 }
 
 impl<T: governance::council::Trait + membership::Trait>
-    ActorOriginValidator<<T as system::Trait>::Origin, MemberId<T>, <T as system::Trait>::AccountId>
-    for CouncilManager<T>
+    ActorOriginValidator<
+        <T as frame_system::Trait>::Origin,
+        MemberId<T>,
+        <T as frame_system::Trait>::AccountId,
+    > for CouncilManager<T>
 {
     /// Check for valid combination of origin and actor_id. Actor_id should be valid member_id of
     /// the membership module
     fn ensure_actor_origin(
-        origin: <T as system::Trait>::Origin,
+        origin: <T as frame_system::Trait>::Origin,
         actor_id: MemberId<T>,
-    ) -> Result<<T as system::Trait>::AccountId, &'static str> {
+    ) -> Result<<T as frame_system::Trait>::AccountId, &'static str> {
         let account_id = <MembershipOriginValidator<T>>::ensure_actor_origin(origin, actor_id)?;
 
         if <governance::council::Module<T>>::is_councilor(&account_id) {
@@ -45,14 +48,14 @@ mod tests {
     use super::CouncilManager;
     use crate::Runtime;
     use common::origin::ActorOriginValidator;
+    use frame_system::RawOrigin;
     use proposals_engine::VotersParameters;
     use sp_runtime::AccountId32;
-    use system::RawOrigin;
 
     type Council = governance::council::Module<Runtime>;
 
     fn initial_test_ext() -> sp_io::TestExternalities {
-        let t = system::GenesisConfig::default()
+        let t = frame_system::GenesisConfig::default()
             .build_storage::<Runtime>()
             .unwrap();
 
@@ -83,7 +86,7 @@ mod tests {
             let councilor3: [u8; 32] = [3; 32];
 
             assert!(Council::set_council(
-                system::RawOrigin::Root.into(),
+                frame_system::RawOrigin::Root.into(),
                 vec![councilor1, councilor2.into(), councilor3.into()]
             )
             .is_ok());
@@ -185,7 +188,7 @@ mod tests {
             let councilor3: [u8; 32] = [3; 32];
             let councilor4: [u8; 32] = [4; 32];
             assert!(Council::set_council(
-                system::RawOrigin::Root.into(),
+                frame_system::RawOrigin::Root.into(),
                 vec![
                     councilor1,
                     councilor2.into(),

+ 10 - 7
runtime/src/integration/proposals/membership_origin_validator.rs

@@ -3,7 +3,7 @@
 use sp_std::marker::PhantomData;
 
 use common::origin::ActorOriginValidator;
-use system::ensure_signed;
+use frame_system::ensure_signed;
 
 /// Member of the Joystream organization
 pub type MemberId<T> = <T as membership::Trait>::MemberId;
@@ -14,15 +14,18 @@ pub struct MembershipOriginValidator<T> {
 }
 
 impl<T: membership::Trait>
-    ActorOriginValidator<<T as system::Trait>::Origin, MemberId<T>, <T as system::Trait>::AccountId>
-    for MembershipOriginValidator<T>
+    ActorOriginValidator<
+        <T as frame_system::Trait>::Origin,
+        MemberId<T>,
+        <T as frame_system::Trait>::AccountId,
+    > for MembershipOriginValidator<T>
 {
     /// Check for valid combination of origin and actor_id. Actor_id should be valid member_id of
     /// the membership module
     fn ensure_actor_origin(
-        origin: <T as system::Trait>::Origin,
+        origin: <T as frame_system::Trait>::Origin,
         actor_id: MemberId<T>,
-    ) -> Result<<T as system::Trait>::AccountId, &'static str> {
+    ) -> Result<<T as frame_system::Trait>::AccountId, &'static str> {
         // check valid signed account_id
         let account_id = ensure_signed(origin)?;
 
@@ -47,13 +50,13 @@ mod tests {
     use super::MembershipOriginValidator;
     use crate::Runtime;
     use common::origin::ActorOriginValidator;
+    use frame_system::RawOrigin;
     use sp_runtime::AccountId32;
-    use system::RawOrigin;
 
     type Membership = membership::Module<Runtime>;
 
     fn initial_test_ext() -> sp_io::TestExternalities {
-        let t = system::GenesisConfig::default()
+        let t = frame_system::GenesisConfig::default()
             .build_storage::<Runtime>()
             .unwrap();
 

+ 1 - 1
runtime/src/integration/proposals/proposal_encoder.rs

@@ -141,7 +141,7 @@ struct Wg<T, I> {
 impl<T, I> Wg<T, I>
 where
     T: working_group::Trait<I>,
-    I: working_group::Instance,
+    I: frame_support::traits::Instance,
 {
     // Generic call constructor for the add working group opening.
     fn create_add_opening_call(

+ 4 - 3
runtime/src/integration/proposals/staking_events_handler.rs

@@ -6,11 +6,12 @@ use sp_std::marker::PhantomData;
 
 // Balance alias
 type BalanceOf<T> =
-    <<T as stake::Trait>::Currency as Currency<<T as system::Trait>::AccountId>>::Balance;
+    <<T as stake::Trait>::Currency as Currency<<T as frame_system::Trait>::AccountId>>::Balance;
 
 // Balance alias for staking
-type NegativeImbalance<T> =
-    <<T as stake::Trait>::Currency as Currency<<T as system::Trait>::AccountId>>::NegativeImbalance;
+type NegativeImbalance<T> = <<T as stake::Trait>::Currency as Currency<
+    <T as frame_system::Trait>::AccountId,
+>>::NegativeImbalance;
 
 /// Proposal implementation of the staking event handler from the stake module.
 /// 'marker' responsible for the 'Trait' binding.

+ 287 - 287
runtime/src/lib.rs

@@ -17,9 +17,9 @@ mod constants;
 mod integration;
 pub mod primitives;
 mod runtime_api;
-mod weights;
-// #[cfg(test)]
-// mod tests; // Runtime integration tests
+#[cfg(test)]
+mod tests;
+mod weights; // Runtime integration tests
 
 use frame_support::traits::{Currency, KeyOwnerProofSystem, OnUnbalanced};
 use frame_support::weights::{
@@ -48,29 +48,29 @@ pub use constants::*;
 pub use primitives::*;
 pub use runtime_api::*;
 
-// use integration::proposals::{CouncilManager, ExtrinsicProposalEncoder, MembershipOriginValidator};
-//
-// use governance::{council, election};
-// use storage::data_object_storage_registry;
-
-// // Node dependencies
-// pub use common;
-// pub use content_working_group as content_wg;
-// pub use forum;
-// pub use governance::election_params::ElectionParameters;
-// pub use membership;
-// #[cfg(any(feature = "std", test))]
-// pub use pallet_balances::Call as BalancesCall;
-// pub use pallet_staking::StakerStatus;
-// pub use proposals_codex::ProposalsConfigParameters;
-// pub use storage::{data_directory, data_object_type_registry};
-// pub use versioned_store;
-// pub use versioned_store_permissions;
-// pub use working_group;
-// pub use content_directory;
-// pub use content_directory::{
-//     HashedTextMaxLength, InputValidationLengthConstraint, MaxNumber, TextMaxLength, VecMaxLength,
-// };
+use integration::proposals::{CouncilManager, ExtrinsicProposalEncoder, MembershipOriginValidator};
+
+use governance::{council, election};
+use storage::data_object_storage_registry;
+
+// Node dependencies
+pub use common;
+pub use content_directory;
+pub use content_directory::{
+    HashedTextMaxLength, InputValidationLengthConstraint, MaxNumber, TextMaxLength, VecMaxLength,
+};
+pub use content_working_group as content_wg;
+pub use forum;
+pub use governance::election_params::ElectionParameters;
+pub use membership;
+#[cfg(any(feature = "std", test))]
+pub use pallet_balances::Call as BalancesCall;
+pub use pallet_staking::StakerStatus;
+pub use proposals_codex::ProposalsConfigParameters;
+pub use storage::{data_directory, data_object_type_registry};
+pub use versioned_store;
+pub use versioned_store_permissions;
+pub use working_group;
 
 /// This runtime version.
 pub const VERSION: RuntimeVersion = RuntimeVersion {
@@ -446,240 +446,240 @@ impl pallet_finality_tracker::Trait for Runtime {
     type ReportLatency = ReportLatency;
 }
 
-// impl versioned_store::Trait for Runtime {
-//     type Event = Event;
-// }
-//
-// impl versioned_store_permissions::Trait for Runtime {
-//     type Credential = Credential;
-//     type CredentialChecker = (
-//         integration::content_working_group::ContentWorkingGroupCredentials,
-//         integration::versioned_store_permissions::SudoKeyHasAllCredentials,
-//     );
-//     type CreateClassPermissionsChecker =
-//         integration::versioned_store_permissions::ContentLeadOrSudoKeyCanCreateClasses;
-// }
-//
-// type EntityId = <Runtime as content_directory::Trait>::EntityId;
-//
-// parameter_types! {
-//     pub const PropertyNameLengthConstraint: InputValidationLengthConstraint = InputValidationLengthConstraint::new(1, 49);
-//     pub const PropertyDescriptionLengthConstraint: InputValidationLengthConstraint = InputValidationLengthConstraint::new(1, 500);
-//     pub const ClassNameLengthConstraint: InputValidationLengthConstraint = InputValidationLengthConstraint::new(1, 49);
-//     pub const ClassDescriptionLengthConstraint: InputValidationLengthConstraint = InputValidationLengthConstraint::new(1, 500);
-//     pub const MaxNumberOfClasses: MaxNumber = 100;
-//     pub const MaxNumberOfMaintainersPerClass: MaxNumber = 10;
-//     pub const MaxNumberOfSchemasPerClass: MaxNumber = 20;
-//     pub const MaxNumberOfPropertiesPerSchema: MaxNumber = 40;
-//     pub const MaxNumberOfEntitiesPerClass: MaxNumber = 5000;
-//     pub const MaxNumberOfCuratorsPerGroup: MaxNumber = 50;
-//     pub const MaxNumberOfOperationsDuringAtomicBatching: MaxNumber = 500;
-//     pub const VecMaxLengthConstraint: VecMaxLength = 200;
-//     pub const TextMaxLengthConstraint: TextMaxLength = 5000;
-//     pub const HashedTextMaxLengthConstraint: HashedTextMaxLength = Some(25000);
-//     pub const IndividualEntitiesCreationLimit: EntityId = 500;
-// }
-//
-// impl content_directory::Trait for Runtime {
-//     type Event = Event;
-//     type Nonce = u64;
-//     type ClassId = u64;
-//     type EntityId = u64;
-//     type PropertyNameLengthConstraint = PropertyNameLengthConstraint;
-//     type PropertyDescriptionLengthConstraint = PropertyDescriptionLengthConstraint;
-//     type ClassNameLengthConstraint = ClassNameLengthConstraint;
-//     type ClassDescriptionLengthConstraint = ClassDescriptionLengthConstraint;
-//     type MaxNumberOfClasses = MaxNumberOfClasses;
-//     type MaxNumberOfMaintainersPerClass = MaxNumberOfMaintainersPerClass;
-//     type MaxNumberOfSchemasPerClass = MaxNumberOfSchemasPerClass;
-//     type MaxNumberOfPropertiesPerSchema = MaxNumberOfPropertiesPerSchema;
-//     type MaxNumberOfEntitiesPerClass = MaxNumberOfEntitiesPerClass;
-//     type MaxNumberOfCuratorsPerGroup = MaxNumberOfCuratorsPerGroup;
-//     type MaxNumberOfOperationsDuringAtomicBatching = MaxNumberOfOperationsDuringAtomicBatching;
-//     type VecMaxLengthConstraint = VecMaxLengthConstraint;
-//     type TextMaxLengthConstraint = TextMaxLengthConstraint;
-//     type HashedTextMaxLengthConstraint = HashedTextMaxLengthConstraint;
-//     type IndividualEntitiesCreationLimit = IndividualEntitiesCreationLimit;
-// }
-//
-// impl hiring::Trait for Runtime {
-//     type OpeningId = u64;
-//     type ApplicationId = u64;
-//     type ApplicationDeactivatedHandler = (); // TODO - what needs to happen?
-//     type StakeHandlerProvider = hiring::Module<Self>;
-// }
-//
-// impl minting::Trait for Runtime {
-//     type Currency = <Self as common::currency::GovernanceCurrency>::Currency;
-//     type MintId = u64;
-// }
-//
-// impl recurring_rewards::Trait for Runtime {
-//     type PayoutStatusHandler = (); // TODO - deal with successful and failed payouts
-//     type RecipientId = u64;
-//     type RewardRelationshipId = u64;
-// }
-//
-// parameter_types! {
-//     pub const StakePoolId: [u8; 8] = *b"joystake";
-// }
-//
-// impl stake::Trait for Runtime {
-//     type Currency = <Self as common::currency::GovernanceCurrency>::Currency;
-//     type StakePoolId = StakePoolId;
-//     type StakingEventsHandler = (
-//         crate::integration::proposals::StakingEventsHandler<Self>,
-//         (
-//             crate::integration::working_group::ContentDirectoryWGStakingEventsHandler<Self>,
-//             crate::integration::working_group::StorageWgStakingEventsHandler<Self>,
-//         ),
-//     );
-//     type StakeId = u64;
-//     type SlashId = u64;
-// }
-//
-// impl content_wg::Trait for Runtime {
-//     type Event = Event;
-// }
-//
-// impl common::currency::GovernanceCurrency for Runtime {
-//     type Currency = pallet_balances::Module<Self>;
-// }
-//
-// impl governance::election::Trait for Runtime {
-//     type Event = Event;
-//     type CouncilElected = (Council, integration::proposals::CouncilElectedHandler);
-// }
-//
-// impl governance::council::Trait for Runtime {
-//     type Event = Event;
-//     type CouncilTermEnded = (CouncilElection,);
-// }
-//
-// impl memo::Trait for Runtime {
-//     type Event = Event;
-// }
-//
-// parameter_types! {
-//     pub const MaxObjectsPerInjection: u32 = 100;
-// }
-//
-// impl storage::data_object_type_registry::Trait for Runtime {
-//     type Event = Event;
-//     type DataObjectTypeId = u64;
-// }
-//
-// impl storage::data_directory::Trait for Runtime {
-//     type Event = Event;
-//     type ContentId = ContentId;
-//     type StorageProviderHelper = integration::storage::StorageProviderHelper;
-//     type IsActiveDataObjectType = DataObjectTypeRegistry;
-//     type MemberOriginValidator = MembershipOriginValidator<Self>;
-//     type MaxObjectsPerInjection = MaxObjectsPerInjection;
-// }
-//
-// impl storage::data_object_storage_registry::Trait for Runtime {
-//     type Event = Event;
-//     type DataObjectStorageRelationshipId = u64;
-//     type ContentIdExists = DataDirectory;
-// }
-//
-// impl membership::Trait for Runtime {
-//     type Event = Event;
-//     type MemberId = MemberId;
-//     type PaidTermId = u64;
-//     type SubscriptionId = u64;
-//     type ActorId = ActorId;
-// }
-//
-// impl forum::Trait for Runtime {
-//     type Event = Event;
-//     type MembershipRegistry = integration::forum::ShimMembershipRegistry;
-//     type ThreadId = ThreadId;
-//     type PostId = PostId;
-// }
-//
-// // The storage working group instance alias.
-// pub type StorageWorkingGroupInstance = working_group::Instance2;
-//
-// // The content directory working group instance alias.
-// pub type ContentDirectoryWorkingGroupInstance = working_group::Instance3;
-//
-// parameter_types! {
-//     pub const MaxWorkerNumberLimit: u32 = 100;
-// }
-//
-// impl working_group::Trait<StorageWorkingGroupInstance> for Runtime {
-//     type Event = Event;
-//     type MaxWorkerNumberLimit = MaxWorkerNumberLimit;
-// }
-//
-// impl working_group::Trait<ContentDirectoryWorkingGroupInstance> for Runtime {
-//     type Event = Event;
-//     type MaxWorkerNumberLimit = MaxWorkerNumberLimit;
-// }
-//
-// impl service_discovery::Trait for Runtime {
-//     type Event = Event;
-// }
-//
-// parameter_types! {
-//     pub const ProposalCancellationFee: u64 = 10000;
-//     pub const ProposalRejectionFee: u64 = 5000;
-//     pub const ProposalTitleMaxLength: u32 = 40;
-//     pub const ProposalDescriptionMaxLength: u32 = 3000;
-//     pub const ProposalMaxActiveProposalLimit: u32 = 20;
-// }
-//
-// impl proposals_engine::Trait for Runtime {
-//     type Event = Event;
-//     type ProposerOriginValidator = MembershipOriginValidator<Self>;
-//     type VoterOriginValidator = CouncilManager<Self>;
-//     type TotalVotersCounter = CouncilManager<Self>;
-//     type ProposalId = u32;
-//     type StakeHandlerProvider = proposals_engine::DefaultStakeHandlerProvider;
-//     type CancellationFee = ProposalCancellationFee;
-//     type RejectionFee = ProposalRejectionFee;
-//     type TitleMaxLength = ProposalTitleMaxLength;
-//     type DescriptionMaxLength = ProposalDescriptionMaxLength;
-//     type MaxActiveProposalLimit = ProposalMaxActiveProposalLimit;
-//     type DispatchableCallCode = Call;
-// }
-// impl Default for Call {
-//     fn default() -> Self {
-//         panic!("shouldn't call default for Call");
-//     }
-// }
-//
-// parameter_types! {
-//     pub const ProposalMaxPostEditionNumber: u32 = 0; // post update is disabled
-//     pub const ProposalMaxThreadInARowNumber: u32 = 100_000; // will not be used
-//     pub const ProposalThreadTitleLengthLimit: u32 = 40;
-//     pub const ProposalPostLengthLimit: u32 = 1000;
-// }
-//
-// impl proposals_discussion::Trait for Runtime {
-//     type Event = Event;
-//     type PostAuthorOriginValidator = MembershipOriginValidator<Self>;
-//     type ThreadId = ThreadId;
-//     type PostId = PostId;
-//     type MaxPostEditionNumber = ProposalMaxPostEditionNumber;
-//     type ThreadTitleLengthLimit = ProposalThreadTitleLengthLimit;
-//     type PostLengthLimit = ProposalPostLengthLimit;
-//     type MaxThreadInARowNumber = ProposalMaxThreadInARowNumber;
-// }
-//
-// parameter_types! {
-//     pub const TextProposalMaxLength: u32 = 5_000;
-//     pub const RuntimeUpgradeWasmProposalMaxLength: u32 = 3_000_000;
-// }
-//
-// impl proposals_codex::Trait for Runtime {
-//     type MembershipOriginValidator = MembershipOriginValidator<Self>;
-//     type TextProposalMaxLength = TextProposalMaxLength;
-//     type RuntimeUpgradeWasmProposalMaxLength = RuntimeUpgradeWasmProposalMaxLength;
-//     type ProposalEncoder = ExtrinsicProposalEncoder;
-// }
+impl versioned_store::Trait for Runtime {
+    type Event = Event;
+}
+
+impl versioned_store_permissions::Trait for Runtime {
+    type Credential = Credential;
+    type CredentialChecker = (
+        integration::content_working_group::ContentWorkingGroupCredentials,
+        integration::versioned_store_permissions::SudoKeyHasAllCredentials,
+    );
+    type CreateClassPermissionsChecker =
+        integration::versioned_store_permissions::ContentLeadOrSudoKeyCanCreateClasses;
+}
+
+type EntityId = <Runtime as content_directory::Trait>::EntityId;
+
+parameter_types! {
+    pub const PropertyNameLengthConstraint: InputValidationLengthConstraint = InputValidationLengthConstraint::new(1, 49);
+    pub const PropertyDescriptionLengthConstraint: InputValidationLengthConstraint = InputValidationLengthConstraint::new(1, 500);
+    pub const ClassNameLengthConstraint: InputValidationLengthConstraint = InputValidationLengthConstraint::new(1, 49);
+    pub const ClassDescriptionLengthConstraint: InputValidationLengthConstraint = InputValidationLengthConstraint::new(1, 500);
+    pub const MaxNumberOfClasses: MaxNumber = 100;
+    pub const MaxNumberOfMaintainersPerClass: MaxNumber = 10;
+    pub const MaxNumberOfSchemasPerClass: MaxNumber = 20;
+    pub const MaxNumberOfPropertiesPerSchema: MaxNumber = 40;
+    pub const MaxNumberOfEntitiesPerClass: MaxNumber = 5000;
+    pub const MaxNumberOfCuratorsPerGroup: MaxNumber = 50;
+    pub const MaxNumberOfOperationsDuringAtomicBatching: MaxNumber = 500;
+    pub const VecMaxLengthConstraint: VecMaxLength = 200;
+    pub const TextMaxLengthConstraint: TextMaxLength = 5000;
+    pub const HashedTextMaxLengthConstraint: HashedTextMaxLength = Some(25000);
+    pub const IndividualEntitiesCreationLimit: EntityId = 500;
+}
+
+impl content_directory::Trait for Runtime {
+    type Event = Event;
+    type Nonce = u64;
+    type ClassId = u64;
+    type EntityId = u64;
+    type PropertyNameLengthConstraint = PropertyNameLengthConstraint;
+    type PropertyDescriptionLengthConstraint = PropertyDescriptionLengthConstraint;
+    type ClassNameLengthConstraint = ClassNameLengthConstraint;
+    type ClassDescriptionLengthConstraint = ClassDescriptionLengthConstraint;
+    type MaxNumberOfClasses = MaxNumberOfClasses;
+    type MaxNumberOfMaintainersPerClass = MaxNumberOfMaintainersPerClass;
+    type MaxNumberOfSchemasPerClass = MaxNumberOfSchemasPerClass;
+    type MaxNumberOfPropertiesPerSchema = MaxNumberOfPropertiesPerSchema;
+    type MaxNumberOfEntitiesPerClass = MaxNumberOfEntitiesPerClass;
+    type MaxNumberOfCuratorsPerGroup = MaxNumberOfCuratorsPerGroup;
+    type MaxNumberOfOperationsDuringAtomicBatching = MaxNumberOfOperationsDuringAtomicBatching;
+    type VecMaxLengthConstraint = VecMaxLengthConstraint;
+    type TextMaxLengthConstraint = TextMaxLengthConstraint;
+    type HashedTextMaxLengthConstraint = HashedTextMaxLengthConstraint;
+    type IndividualEntitiesCreationLimit = IndividualEntitiesCreationLimit;
+}
+
+impl hiring::Trait for Runtime {
+    type OpeningId = u64;
+    type ApplicationId = u64;
+    type ApplicationDeactivatedHandler = (); // TODO - what needs to happen?
+    type StakeHandlerProvider = hiring::Module<Self>;
+}
+
+impl minting::Trait for Runtime {
+    type Currency = <Self as common::currency::GovernanceCurrency>::Currency;
+    type MintId = u64;
+}
+
+impl recurring_rewards::Trait for Runtime {
+    type PayoutStatusHandler = (); // TODO - deal with successful and failed payouts
+    type RecipientId = u64;
+    type RewardRelationshipId = u64;
+}
+
+parameter_types! {
+    pub const StakePoolId: [u8; 8] = *b"joystake";
+}
+
+impl stake::Trait for Runtime {
+    type Currency = <Self as common::currency::GovernanceCurrency>::Currency;
+    type StakePoolId = StakePoolId;
+    type StakingEventsHandler = (
+        crate::integration::proposals::StakingEventsHandler<Self>,
+        (
+            crate::integration::working_group::ContentDirectoryWGStakingEventsHandler<Self>,
+            crate::integration::working_group::StorageWgStakingEventsHandler<Self>,
+        ),
+    );
+    type StakeId = u64;
+    type SlashId = u64;
+}
+
+impl content_wg::Trait for Runtime {
+    type Event = Event;
+}
+
+impl common::currency::GovernanceCurrency for Runtime {
+    type Currency = pallet_balances::Module<Self>;
+}
+
+impl governance::election::Trait for Runtime {
+    type Event = Event;
+    type CouncilElected = (Council, integration::proposals::CouncilElectedHandler);
+}
+
+impl governance::council::Trait for Runtime {
+    type Event = Event;
+    type CouncilTermEnded = (CouncilElection,);
+}
+
+impl memo::Trait for Runtime {
+    type Event = Event;
+}
+
+parameter_types! {
+    pub const MaxObjectsPerInjection: u32 = 100;
+}
+
+impl storage::data_object_type_registry::Trait for Runtime {
+    type Event = Event;
+    type DataObjectTypeId = u64;
+}
+
+impl storage::data_directory::Trait for Runtime {
+    type Event = Event;
+    type ContentId = ContentId;
+    type StorageProviderHelper = integration::storage::StorageProviderHelper;
+    type IsActiveDataObjectType = DataObjectTypeRegistry;
+    type MemberOriginValidator = MembershipOriginValidator<Self>;
+    type MaxObjectsPerInjection = MaxObjectsPerInjection;
+}
+
+impl storage::data_object_storage_registry::Trait for Runtime {
+    type Event = Event;
+    type DataObjectStorageRelationshipId = u64;
+    type ContentIdExists = DataDirectory;
+}
+
+impl membership::Trait for Runtime {
+    type Event = Event;
+    type MemberId = MemberId;
+    type PaidTermId = u64;
+    type SubscriptionId = u64;
+    type ActorId = ActorId;
+}
+
+impl forum::Trait for Runtime {
+    type Event = Event;
+    type MembershipRegistry = integration::forum::ShimMembershipRegistry;
+    type ThreadId = ThreadId;
+    type PostId = PostId;
+}
+
+// The storage working group instance alias.
+pub type StorageWorkingGroupInstance = working_group::Instance2;
+
+// The content directory working group instance alias.
+pub type ContentDirectoryWorkingGroupInstance = working_group::Instance3;
+
+parameter_types! {
+    pub const MaxWorkerNumberLimit: u32 = 100;
+}
+
+impl working_group::Trait<StorageWorkingGroupInstance> for Runtime {
+    type Event = Event;
+    type MaxWorkerNumberLimit = MaxWorkerNumberLimit;
+}
+
+impl working_group::Trait<ContentDirectoryWorkingGroupInstance> for Runtime {
+    type Event = Event;
+    type MaxWorkerNumberLimit = MaxWorkerNumberLimit;
+}
+
+impl service_discovery::Trait for Runtime {
+    type Event = Event;
+}
+
+parameter_types! {
+    pub const ProposalCancellationFee: u64 = 10000;
+    pub const ProposalRejectionFee: u64 = 5000;
+    pub const ProposalTitleMaxLength: u32 = 40;
+    pub const ProposalDescriptionMaxLength: u32 = 3000;
+    pub const ProposalMaxActiveProposalLimit: u32 = 20;
+}
+
+impl proposals_engine::Trait for Runtime {
+    type Event = Event;
+    type ProposerOriginValidator = MembershipOriginValidator<Self>;
+    type VoterOriginValidator = CouncilManager<Self>;
+    type TotalVotersCounter = CouncilManager<Self>;
+    type ProposalId = u32;
+    type StakeHandlerProvider = proposals_engine::DefaultStakeHandlerProvider;
+    type CancellationFee = ProposalCancellationFee;
+    type RejectionFee = ProposalRejectionFee;
+    type TitleMaxLength = ProposalTitleMaxLength;
+    type DescriptionMaxLength = ProposalDescriptionMaxLength;
+    type MaxActiveProposalLimit = ProposalMaxActiveProposalLimit;
+    type DispatchableCallCode = Call;
+}
+impl Default for Call {
+    fn default() -> Self {
+        panic!("shouldn't call default for Call");
+    }
+}
+
+parameter_types! {
+    pub const ProposalMaxPostEditionNumber: u32 = 0; // post update is disabled
+    pub const ProposalMaxThreadInARowNumber: u32 = 100_000; // will not be used
+    pub const ProposalThreadTitleLengthLimit: u32 = 40;
+    pub const ProposalPostLengthLimit: u32 = 1000;
+}
+
+impl proposals_discussion::Trait for Runtime {
+    type Event = Event;
+    type PostAuthorOriginValidator = MembershipOriginValidator<Self>;
+    type ThreadId = ThreadId;
+    type PostId = PostId;
+    type MaxPostEditionNumber = ProposalMaxPostEditionNumber;
+    type ThreadTitleLengthLimit = ProposalThreadTitleLengthLimit;
+    type PostLengthLimit = ProposalPostLengthLimit;
+    type MaxThreadInARowNumber = ProposalMaxThreadInARowNumber;
+}
+
+parameter_types! {
+    pub const TextProposalMaxLength: u32 = 5_000;
+    pub const RuntimeUpgradeWasmProposalMaxLength: u32 = 3_000_000;
+}
+
+impl proposals_codex::Trait for Runtime {
+    type MembershipOriginValidator = MembershipOriginValidator<Self>;
+    type TextProposalMaxLength = TextProposalMaxLength;
+    type RuntimeUpgradeWasmProposalMaxLength = RuntimeUpgradeWasmProposalMaxLength;
+    type ProposalEncoder = ExtrinsicProposalEncoder;
+}
 
 parameter_types! {
     pub const TombstoneDeposit: Balance = 1; // TODO: adjust fee
@@ -729,32 +729,32 @@ construct_runtime!(
         Offences: pallet_offences::{Module, Call, Storage, Event},
         RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Module, Call, Storage},
         Sudo: pallet_sudo::{Module, Call, Config<T>, Storage, Event<T>},
-        // // Joystream
-        // CouncilElection: election::{Module, Call, Storage, Event<T>, Config<T>},
-        // Council: council::{Module, Call, Storage, Event<T>, Config<T>},
-        // Memo: memo::{Module, Call, Storage, Event<T>},
-        // Members: membership::{Module, Call, Storage, Event<T>, Config<T>},
-        // Forum: forum::{Module, Call, Storage, Event<T>, Config<T>},
-        // VersionedStore: versioned_store::{Module, Call, Storage, Event<T>, Config},
-        // VersionedStorePermissions: versioned_store_permissions::{Module, Call, Storage, Config<T>},
-        // Stake: stake::{Module, Call, Storage},
-        // Minting: minting::{Module, Call, Storage},
-        // RecurringRewards: recurring_rewards::{Module, Call, Storage},
-        // Hiring: hiring::{Module, Call, Storage},
-        // ContentWorkingGroup: content_wg::{Module, Call, Storage, Event<T>, Config<T>},
-        // ContentDirectory: content_directory::{Module, Call, Storage, Event<T>, Config<T>},
-        // // --- Storage
-        // DataObjectTypeRegistry: data_object_type_registry::{Module, Call, Storage, Event<T>, Config<T>},
-        // DataDirectory: data_directory::{Module, Call, Storage, Event<T>, Config<T>},
-        // DataObjectStorageRegistry: data_object_storage_registry::{Module, Call, Storage, Event<T>, Config<T>},
-        // Discovery: service_discovery::{Module, Call, Storage, Event<T>},
-        // // --- Proposals
-        // ProposalsEngine: proposals_engine::{Module, Call, Storage, Event<T>},
-        // ProposalsDiscussion: proposals_discussion::{Module, Call, Storage, Event<T>},
-        // ProposalsCodex: proposals_codex::{Module, Call, Storage, Config<T>},
-        // // --- Working groups
-        // // reserved for the future use: ForumWorkingGroup: working_group::<Instance1>::{Module, Call, Storage, Event<T>},
-        // StorageWorkingGroup: working_group::<Instance2>::{Module, Call, Storage, Config<T>, Event<T>},
-        // ContentDirectoryWorkingGroup: working_group::<Instance3>::{Module, Call, Storage, Config<T>, Event<T>},
+        // Joystream
+        CouncilElection: election::{Module, Call, Storage, Event<T>, Config<T>},
+        Council: council::{Module, Call, Storage, Event<T>, Config<T>},
+        Memo: memo::{Module, Call, Storage, Event<T>},
+        Members: membership::{Module, Call, Storage, Event<T>, Config<T>},
+        Forum: forum::{Module, Call, Storage, Event<T>, Config<T>},
+        VersionedStore: versioned_store::{Module, Call, Storage, Event<T>, Config},
+        VersionedStorePermissions: versioned_store_permissions::{Module, Call, Storage, Config<T>},
+        Stake: stake::{Module, Call, Storage},
+        Minting: minting::{Module, Call, Storage},
+        RecurringRewards: recurring_rewards::{Module, Call, Storage},
+        Hiring: hiring::{Module, Call, Storage},
+        ContentWorkingGroup: content_wg::{Module, Call, Storage, Event<T>, Config<T>},
+        ContentDirectory: content_directory::{Module, Call, Storage, Event<T>, Config<T>},
+        // --- Storage
+        DataObjectTypeRegistry: data_object_type_registry::{Module, Call, Storage, Event<T>, Config<T>},
+        DataDirectory: data_directory::{Module, Call, Storage, Event<T>, Config<T>},
+        DataObjectStorageRegistry: data_object_storage_registry::{Module, Call, Storage, Event<T>, Config<T>},
+        Discovery: service_discovery::{Module, Call, Storage, Event<T>},
+        // --- Proposals
+        ProposalsEngine: proposals_engine::{Module, Call, Storage, Event<T>},
+        ProposalsDiscussion: proposals_discussion::{Module, Call, Storage, Event<T>},
+        ProposalsCodex: proposals_codex::{Module, Call, Storage, Config<T>},
+        // --- Working groups
+        // reserved for the future use: ForumWorkingGroup: working_group::<Instance1>::{Module, Call, Storage, Event<T>},
+        StorageWorkingGroup: working_group::<Instance2>::{Module, Call, Storage, Config<T>, Event<T>},
+        ContentDirectoryWorkingGroup: working_group::<Instance3>::{Module, Call, Storage, Config<T>, Event<T>},
     }
 );

+ 0 - 121
runtime/src/runtime_api.rs

@@ -241,125 +241,4 @@ impl_runtime_apis! {
             SessionKeys::decode_into_raw_public_keys(&encoded)
         }
     }
-
-    #[cfg(feature = "runtime-benchmarks")]
-    impl frame_benchmarking::Benchmark<Block> for Runtime {
-        fn dispatch_benchmark(
-            config: frame_benchmarking::BenchmarkConfig
-        ) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, sp_runtime::RuntimeString> {
-            use sp_std::vec;
-            use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey};
-
-            use pallet_session_benchmarking::Module as SessionBench;
-            use frame_system_benchmarking::Module as SystemBench;
-            use frame_system::RawOrigin;
-            use crate::ProposalsDiscussion;
-            use crate::ProposalsEngine;
-            use crate::ProposalsCodex;
-            use crate::Constitution;
-            use crate::Forum;
-            use crate::Members;
-            use crate::ContentDirectoryWorkingGroup;
-            use crate::Utility;
-            use crate::Timestamp;
-            use crate::ImOnline;
-            use crate::Council;
-            use crate::Referendum;
-            use crate::Blog;
-            use crate::JoystreamUtility;
-
-
-            // Trying to add benchmarks directly to the Session Pallet caused cyclic dependency issues.
-            // To get around that, we separated the Session benchmarks into its own crate, which is why
-            // we need these two lines below.
-            impl pallet_session_benchmarking::Trait for Runtime {}
-            impl frame_system_benchmarking::Trait for Runtime {}
-            impl referendum::OptionCreator<<Runtime as frame_system::Trait>::AccountId, <Runtime as common::Trait>::MemberId> for Runtime {
-                fn create_option(account_id: <Runtime as frame_system::Trait>::AccountId, member_id: <Runtime as common::Trait>::MemberId) {
-                    crate::council::Module::<Runtime>::announce_candidacy(
-                        RawOrigin::Signed(account_id.clone()).into(),
-                        member_id,
-                        account_id.clone(),
-                        account_id.clone(),
-                        <Runtime as council::Trait>::MinCandidateStake::get().into(),
-                    ).expect(
-                        "Should pass a valid member associated to the account and the account
-                        should've enough
-                        free balance to stake the minimum for a council candidate."
-                    );
-                }
-            }
-
-            impl membership::MembershipWorkingGroupHelper<
-                <Runtime as frame_system::Trait>::AccountId,
-                <Runtime as common::Trait>::MemberId,
-                <Runtime as common::Trait>::ActorId,
-                    > for Runtime
-            {
-                fn insert_a_lead(
-                    opening_id: u32,
-                    caller_id: &<Runtime as frame_system::Trait>::AccountId,
-                    member_id: <Runtime as common::Trait>::MemberId,
-                ) -> <Runtime as common::Trait>::ActorId {
-                    working_group::benchmarking::complete_opening::<Runtime, crate::MembershipWorkingGroupInstance>(
-                        working_group::OpeningType::Leader,
-                        opening_id,
-                        None,
-                        &caller_id,
-                        member_id,
-                    )
-                }
-            }
-
-            let whitelist: Vec<TrackedStorageKey> = vec![
-                // Block Number
-                hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac").to_vec().into(),
-                // Total Issuance
-                hex_literal::hex!("c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80").to_vec().into(),
-                // Execution Phase
-                hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7ff553b5a9862a516939d82b3d3d8661a").to_vec().into(),
-                // Event Count
-                hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850").to_vec().into(),
-                // System Events
-                hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7").to_vec().into(),
-                // Caller 0 Account
-                hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da946c154ffd9992e395af90b5b13cc6f295c77033fce8a9045824a6690bbf99c6db269502f0a8d1d2a008542d5690a0749").to_vec().into(),
-                // Treasury Account
-                hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da95ecffd7b6c0f78751baa9d281e0bfa3a6d6f646c70792f74727372790000000000000000000000000000000000000000").to_vec().into(),
-            ];
-
-            let mut batches = Vec::<BenchmarkBatch>::new();
-            let params = (&config, &whitelist);
-
-            // Note: For benchmarking Stake and Balances we need to change ExistentialDeposit to
-            // a non-zero value.
-            // For now, due to the complexity grandpa and babe aren't benchmarked automatically
-            // we should use the default manually created weights.
-            // Finally, pallet_offences have no `WeightInfo` so there's no need to benchmark it
-            // the benchmark is only for illustrative pourpuses.
-
-            // Frame benchmarks
-            add_benchmark!(params, batches, frame_system, SystemBench::<Runtime>);
-            add_benchmark!(params, batches, substrate_utility, Utility);
-            add_benchmark!(params, batches, pallet_timestamp, Timestamp);
-            add_benchmark!(params, batches, pallet_session, SessionBench::<Runtime>);
-            add_benchmark!(params, batches, pallet_im_online, ImOnline);
-
-            // Joystream Benchmarks
-            add_benchmark!(params, batches, proposals_discussion, ProposalsDiscussion);
-            add_benchmark!(params, batches, proposals_codex, ProposalsCodex);
-            add_benchmark!(params, batches, proposals_engine, ProposalsEngine);
-            add_benchmark!(params, batches, membership, Members);
-            add_benchmark!(params, batches, forum, Forum);
-            add_benchmark!(params, batches, pallet_constitution, Constitution);
-            add_benchmark!(params, batches, working_group, ContentDirectoryWorkingGroup);
-            add_benchmark!(params, batches, referendum, Referendum);
-            add_benchmark!(params, batches, council, Council);
-            add_benchmark!(params, batches, blog, Blog);
-            add_benchmark!(params, batches, joystream_utility, JoystreamUtility);
-
-            if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }
-            Ok(batches)
-        }
-    }
 }

+ 1 - 1
runtime/src/tests/mod.rs

@@ -8,7 +8,7 @@ mod storage_integration;
 use sp_runtime::BuildStorage;
 
 pub(crate) fn initial_test_ext() -> sp_io::TestExternalities {
-    let mut t = system::GenesisConfig::default()
+    let mut t = frame_system::GenesisConfig::default()
         .build_storage::<crate::Runtime>()
         .unwrap();
 

+ 8 - 8
runtime/src/tests/proposals_integration/mod.rs

@@ -17,15 +17,15 @@ use proposals_engine::{
 use frame_support::dispatch::{DispatchError, DispatchResult};
 use frame_support::traits::{Currency, OnFinalize, OnInitialize};
 use frame_support::{StorageMap, StorageValue};
+use frame_system::RawOrigin;
 use sp_runtime::AccountId32;
-use system::RawOrigin;
 
 use super::initial_test_ext;
 
 use crate::CouncilManager;
 
 pub type Balances = pallet_balances::Module<Runtime>;
-pub type System = system::Module<Runtime>;
+pub type System = frame_system::Module<Runtime>;
 pub type Membership = membership::Module<Runtime>;
 pub type ProposalsEngine = proposals_engine::Module<Runtime>;
 pub type Council = governance::council::Module<Runtime>;
@@ -33,7 +33,7 @@ pub type Election = governance::election::Module<Runtime>;
 pub type ProposalCodex = proposals_codex::Module<Runtime>;
 
 fn setup_members(count: u8) {
-    let authority_account_id = <Runtime as system::Trait>::AccountId::default();
+    let authority_account_id = <Runtime as frame_system::Trait>::AccountId::default();
     Membership::set_screening_authority(RawOrigin::Root.into(), authority_account_id.clone())
         .unwrap();
 
@@ -58,7 +58,7 @@ fn setup_council() {
     let councilor4: [u8; 32] = [4; 32];
     let councilor5: [u8; 32] = [5; 32];
     assert!(Council::set_council(
-        system::RawOrigin::Root.into(),
+        frame_system::RawOrigin::Root.into(),
         vec![
             councilor0,
             councilor1.into(),
@@ -132,7 +132,7 @@ impl VoteGenerator {
         }
 
         ProposalsEngine::vote(
-            system::RawOrigin::Signed(self.current_account_id.clone()).into(),
+            frame_system::RawOrigin::Signed(self.current_account_id.clone()).into(),
             self.current_voter_id,
             self.proposal_id,
             vote_kind,
@@ -168,7 +168,7 @@ impl Default for DummyProposalFixture {
                 grace_period: 0,
                 required_stake: None,
             },
-            account_id: <Runtime as system::Trait>::AccountId::default(),
+            account_id: <Runtime as frame_system::Trait>::AccountId::default(),
             proposer_id: 0,
             proposal_code: dummy_proposal.encode(),
             title,
@@ -235,7 +235,7 @@ struct CancelProposalFixture {
 
 impl CancelProposalFixture {
     fn new(proposal_id: u32) -> Self {
-        let account_id = <Runtime as system::Trait>::AccountId::default();
+        let account_id = <Runtime as frame_system::Trait>::AccountId::default();
         CancelProposalFixture {
             proposal_id,
             origin: RawOrigin::Signed(account_id),
@@ -267,7 +267,7 @@ impl CancelProposalFixture {
 #[test]
 fn proposal_cancellation_with_slashes_with_balance_checks_succeeds() {
     initial_test_ext().execute_with(|| {
-        let account_id = <Runtime as system::Trait>::AccountId::default();
+        let account_id = <Runtime as frame_system::Trait>::AccountId::default();
 
         setup_members(2);
         let member_id = 0; // newly created member_id

+ 54 - 52
runtime/src/tests/proposals_integration/working_group_proposals.rs

@@ -3,7 +3,7 @@
 
 use super::*;
 
-use system::RawOrigin;
+use frame_system::RawOrigin;
 
 use common::working_group::WorkingGroup;
 use hiring::ActivateOpeningAt;
@@ -240,8 +240,8 @@ fn set_reward(
 }
 
 fn set_mint_capacity<
-    T: working_group::Trait<I> + system::Trait + minting::Trait,
-    I: working_group::Instance,
+    T: working_group::Trait<I> + frame_system::Trait + minting::Trait,
+    I: frame_support::traits::Instance,
 >(
     member_id: MemberId,
     account_id: [u8; 32],
@@ -335,8 +335,8 @@ fn create_add_working_group_leader_opening_proposal_execution_succeeds() {
 }
 
 fn run_create_add_working_group_leader_opening_proposal_execution_succeeds<
-    T: working_group::Trait<I> + system::Trait + stake::Trait,
-    I: working_group::Instance,
+    T: working_group::Trait<I> + frame_system::Trait + stake::Trait,
+    I: frame_support::traits::Instance,
 >(
     working_group: WorkingGroup,
 ) where
@@ -393,8 +393,8 @@ fn create_begin_review_working_group_leader_applications_proposal_execution_succ
 }
 
 fn run_create_begin_review_working_group_leader_applications_proposal_execution_succeeds<
-    T: working_group::Trait<I> + system::Trait + stake::Trait,
-    I: working_group::Instance,
+    T: working_group::Trait<I> + frame_system::Trait + stake::Trait,
+    I: frame_support::traits::Instance,
 >(
     working_group: WorkingGroup,
 ) where
@@ -472,12 +472,12 @@ fn create_fill_working_group_leader_opening_proposal_execution_succeeds() {
     }
 
     fn run_create_fill_working_group_leader_opening_proposal_execution_succeeds<
-        T: working_group::Trait<I> + system::Trait + stake::Trait,
-        I: working_group::Instance,
+        T: working_group::Trait<I> + frame_system::Trait + stake::Trait,
+        I: frame_support::traits::Instance,
     >(
         working_group: WorkingGroup,
     ) where
-        <T as system::Trait>::AccountId: From<[u8; 32]>,
+        <T as frame_system::Trait>::AccountId: From<[u8; 32]>,
         <T as membership::Trait>::MemberId: From<u64>,
         <T as hiring::Trait>::OpeningId: From<u64>,
     {
@@ -549,19 +549,20 @@ fn create_fill_working_group_leader_opening_proposal_execution_succeeds() {
         }
     }
 
-fn run_create_decrease_group_leader_stake_proposal_execution_succeeds<
-    T: working_group::Trait<I> + system::Trait + stake::Trait,
-    I: working_group::Instance,
->(
-    working_group: WorkingGroup,
-) where
-    <T as system::Trait>::AccountId: From<[u8; 32]>,
-    <T as hiring::Trait>::OpeningId: From<u64>,
-    <T as membership::Trait>::MemberId: From<u64>,
-    <T as membership::Trait>::ActorId: Into<u64>,
-    <<T as stake::Trait>::Currency as traits::Currency<<T as system::Trait>::AccountId>>::Balance:
-        From<u128>,
-{
+    fn run_create_decrease_group_leader_stake_proposal_execution_succeeds<
+        T: working_group::Trait<I> + frame_system::Trait + stake::Trait,
+        I: frame_support::traits::Instance,
+    >(
+        working_group: WorkingGroup,
+    ) where
+        <T as frame_system::Trait>::AccountId: From<[u8; 32]>,
+        <T as hiring::Trait>::OpeningId: From<u64>,
+        <T as membership::Trait>::MemberId: From<u64>,
+        <T as membership::Trait>::ActorId: Into<u64>,
+        <<T as stake::Trait>::Currency as traits::Currency<
+            <T as frame_system::Trait>::AccountId,
+        >>::Balance: From<u128>,
+    {
         initial_test_ext().execute_with(|| {
             let member_id: MemberId = 1;
             let account_id: [u8; 32] = [member_id as u8; 32];
@@ -665,19 +666,20 @@ fn run_create_decrease_group_leader_stake_proposal_execution_succeeds<
         }
     }
 
-fn run_create_slash_group_leader_stake_proposal_execution_succeeds<
-    T: working_group::Trait<I> + system::Trait + stake::Trait,
-    I: working_group::Instance,
->(
-    working_group: WorkingGroup,
-) where
-    <T as system::Trait>::AccountId: From<[u8; 32]>,
-    <T as hiring::Trait>::OpeningId: From<u64>,
-    <T as membership::Trait>::MemberId: From<u64>,
-    <T as membership::Trait>::ActorId: Into<u64>,
-    <<T as stake::Trait>::Currency as traits::Currency<<T as system::Trait>::AccountId>>::Balance:
-        From<u128>,
-{
+    fn run_create_slash_group_leader_stake_proposal_execution_succeeds<
+        T: working_group::Trait<I> + frame_system::Trait + stake::Trait,
+        I: frame_support::traits::Instance,
+    >(
+        working_group: WorkingGroup,
+    ) where
+        <T as frame_system::Trait>::AccountId: From<[u8; 32]>,
+        <T as hiring::Trait>::OpeningId: From<u64>,
+        <T as membership::Trait>::MemberId: From<u64>,
+        <T as membership::Trait>::ActorId: Into<u64>,
+        <<T as stake::Trait>::Currency as traits::Currency<
+            <T as frame_system::Trait>::AccountId,
+        >>::Balance: From<u128>,
+    {
         initial_test_ext().execute_with(|| {
             let member_id: MemberId = 1;
             let account_id: [u8; 32] = [member_id as u8; 32];
@@ -782,16 +784,16 @@ fn run_create_slash_group_leader_stake_proposal_execution_succeeds<
         }
 
         fn run_create_set_working_group_mint_capacity_proposal_execution_succeeds<
-            T: working_group::Trait<I> + system::Trait + minting::Trait,
-            I: working_group::Instance,
+            T: working_group::Trait<I> + frame_system::Trait + minting::Trait,
+            I: frame_support::traits::Instance,
         >(
             working_group: WorkingGroup,
         ) where
-            <T as system::Trait>::AccountId: From<[u8; 32]>,
+            <T as frame_system::Trait>::AccountId: From<[u8; 32]>,
             <T as membership::Trait>::MemberId: From<u64>,
             <T as minting::Trait>::MintId: From<u64>,
             <<T as minting::Trait>::Currency as traits::Currency<
-                <T as system::Trait>::AccountId,
+                <T as frame_system::Trait>::AccountId,
             >>::Balance: From<u128>,
         {
             initial_test_ext().execute_with(|| {
@@ -839,18 +841,18 @@ fn run_create_slash_group_leader_stake_proposal_execution_succeeds<
         }
 
         fn run_create_set_group_leader_reward_proposal_execution_succeeds<
-            T: working_group::Trait<I> + system::Trait + minting::Trait,
-            I: working_group::Instance,
+            T: working_group::Trait<I> + frame_system::Trait + minting::Trait,
+            I: frame_support::traits::Instance,
         >(
             working_group: WorkingGroup,
         ) where
-            <T as system::Trait>::AccountId: From<[u8; 32]>,
+            <T as frame_system::Trait>::AccountId: From<[u8; 32]>,
             <T as membership::Trait>::MemberId: From<u64>,
             <T as membership::Trait>::ActorId: Into<u64>,
             <T as minting::Trait>::MintId: From<u64>,
             <T as hiring::Trait>::OpeningId: From<u64>,
             <<T as minting::Trait>::Currency as traits::Currency<
-                <T as system::Trait>::AccountId,
+                <T as frame_system::Trait>::AccountId,
             >>::Balance: From<u128>,
         {
             initial_test_ext().execute_with(|| {
@@ -962,18 +964,18 @@ fn run_create_slash_group_leader_stake_proposal_execution_succeeds<
         }
 
         fn run_create_terminate_group_leader_role_proposal_execution_succeeds<
-            T: working_group::Trait<I> + system::Trait + minting::Trait,
-            I: working_group::Instance,
+            T: working_group::Trait<I> + frame_system::Trait + minting::Trait,
+            I: frame_support::traits::Instance,
         >(
             working_group: WorkingGroup,
         ) where
-            <T as system::Trait>::AccountId: From<[u8; 32]>,
+            <T as frame_system::Trait>::AccountId: From<[u8; 32]>,
             <T as membership::Trait>::MemberId: From<u64>,
             <T as membership::Trait>::ActorId: Into<u64>,
             <T as minting::Trait>::MintId: From<u64>,
             <T as hiring::Trait>::OpeningId: From<u64>,
             <<T as stake::Trait>::Currency as traits::Currency<
-                <T as system::Trait>::AccountId,
+                <T as frame_system::Trait>::AccountId,
             >>::Balance: From<u128>,
         {
             initial_test_ext().execute_with(|| {
@@ -1081,18 +1083,18 @@ fn run_create_slash_group_leader_stake_proposal_execution_succeeds<
         }
 
         fn run_create_terminate_group_leader_role_proposal_with_slashing_execution_succeeds<
-            T: working_group::Trait<I> + system::Trait + minting::Trait,
-            I: working_group::Instance,
+            T: working_group::Trait<I> + frame_system::Trait + minting::Trait,
+            I: frame_support::traits::Instance,
         >(
             working_group: WorkingGroup,
         ) where
-            <T as system::Trait>::AccountId: From<[u8; 32]>,
+            <T as frame_system::Trait>::AccountId: From<[u8; 32]>,
             <T as membership::Trait>::MemberId: From<u64>,
             <T as membership::Trait>::ActorId: Into<u64>,
             <T as minting::Trait>::MintId: From<u64>,
             <T as hiring::Trait>::OpeningId: From<u64>,
             <<T as stake::Trait>::Currency as traits::Currency<
-                <T as system::Trait>::AccountId,
+                <T as frame_system::Trait>::AccountId,
             >>::Balance: From<u128>,
         {
             initial_test_ext().execute_with(|| {

+ 1 - 1
runtime/src/tests/storage_integration.rs

@@ -9,7 +9,7 @@ use working_group::{Instance2, Worker};
 fn storage_provider_helper_succeeds() {
     initial_test_ext().execute_with(|| {
 		// Bug in random module requires move the initial block number.
-		<system::Module<Runtime>>::set_block_number(1);
+		<frame_system::Module<Runtime>>::set_block_number(1);
 
 		// Error - no workers.
 		let random_provider_result = <StorageProviderHelper