Browse Source

chain: Fix benchmarking.

Shamil Gadelshin 3 years ago
parent
commit
ecda6dc166

+ 1 - 1
Cargo.lock

@@ -3751,7 +3751,7 @@ dependencies = [
 
 [[package]]
 name = "pallet-bounty"
-version = "1.0.1"
+version = "1.0.0"
 dependencies = [
  "frame-benchmarking",
  "frame-support",

+ 1 - 1
runtime-modules/bounty/Cargo.toml

@@ -1,6 +1,6 @@
 [package]
 name = 'pallet-bounty'
-version = '1.0.1'
+version = '1.0.0'
 authors = ['Joystream contributors']
 edition = '2018'
 

+ 2 - 0
runtime-modules/constitution/Cargo.toml

@@ -11,6 +11,8 @@ sp-std = { package = 'sp-std', default-features = false, git = 'https://github.c
 frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
 frame_system = { package = 'frame-system', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
 sp-runtime = { package = 'sp-runtime', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+
+# Benchmarking
 frame-benchmarking = { package = 'frame-benchmarking', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62', optional = true}
 
 [dev-dependencies]

+ 3 - 3
runtime-modules/council/Cargo.toml

@@ -33,16 +33,16 @@ default = ['std']
 runtime-benchmarks = ['frame-benchmarking', 'membership']
 std = [
     'codec/std',
-    'sp-core/std',
     'serde',
+    'sp-core/std',
     'sp-runtime/std',
     'sp-arithmetic/std',
     'frame-support/std',
-    'referendum/std',
     'frame-system/std',
-    'staking-handler/std',
+    'sp-std/std',
     'common/std',
     'balances/std',
+    'referendum/std',
     'staking-handler/std',
 ]
 

+ 3 - 1
runtime-modules/proposals/codex/Cargo.toml

@@ -21,11 +21,11 @@ proposals-discussion = { package = 'pallet-proposals-discussion', default-featur
 constitution = { package = 'pallet-constitution', default-features = false, path = '../../constitution'}
 membership = { package = 'pallet-membership', default-features = false, path = '../../membership'}
 blog = { package = 'pallet-blog', default-features = false, path = '../../blog'}
-balances = { package = 'pallet-balances', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62', optional = true}
 
 # Benchmarking dependencies
 frame-benchmarking = { package = 'frame-benchmarking', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62', optional = true}
 council = { package = 'pallet-council', default-features = false, path = '../../council', optional = true}
+balances = { package = 'pallet-balances', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62', optional = true}
 
 [dev-dependencies]
 sp-io = { package = 'sp-io', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
@@ -56,4 +56,6 @@ std = [
     'proposals-engine/std',
     'proposals-discussion/std',
     'constitution/std',
+    'membership/std',
+    'blog/std',
 ]

+ 0 - 1
runtime-modules/proposals/engine/Cargo.toml

@@ -50,5 +50,4 @@ std = [
 	'balances/std',
     'common/std',
     'staking-handler/std',
-    'balances/std',
 ]

+ 8 - 5
runtime/Cargo.toml

@@ -157,17 +157,21 @@ std = [
     'content/std',
 ]
 runtime-benchmarks = [
+    "hex-literal",
     "frame-support/runtime-benchmarks",
     "sp-runtime/runtime-benchmarks",
+    "frame-benchmarking",
+    "frame-system-benchmarking",
+    "frame-system/runtime-benchmarks",
+    "pallet-offences-benchmarking",
+    "pallet-session-benchmarking",
     "pallet-balances/runtime-benchmarks",
     "pallet-im-online/runtime-benchmarks",
     "pallet-staking/runtime-benchmarks",
     "pallet-timestamp/runtime-benchmarks",
-    "frame-benchmarking",
-    "frame-system-benchmarking",
-    "pallet-offences-benchmarking",
-	"pallet-session-benchmarking",
     "substrate-utility/runtime-benchmarks",
+
+    # Joystream
     "proposals-discussion/runtime-benchmarks",
     "proposals-engine/runtime-benchmarks",
     "proposals-codex/runtime-benchmarks",
@@ -180,7 +184,6 @@ runtime-benchmarks = [
     "referendum/runtime-benchmarks",
     "bounty/runtime-benchmarks",
     "blog/runtime-benchmarks",
-    "hex-literal",
 ]
 
 

+ 1 - 1
runtime/build.rs

@@ -25,7 +25,7 @@ fn main() {
 
     WasmBuilder::new()
         .with_current_project()
-        .with_wasm_builder_from_crates("2.0.0")
+        .with_wasm_builder_from_crates("2.0.1")
         .export_heap_base()
         .import_memory()
         .build()

+ 6 - 6
runtime/src/runtime_api.rs

@@ -316,8 +316,8 @@ impl_runtime_apis! {
             // 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::membership::Trait>::MemberId> for Runtime {
-                fn create_option(account_id: <Runtime as frame_system::Trait>::AccountId, member_id: <Runtime as common::membership::Trait>::MemberId) {
+            impl referendum::OptionCreator<<Runtime as frame_system::Trait>::AccountId, <Runtime as common::membership::MembershipTypes>::MemberId> for Runtime {
+                fn create_option(account_id: <Runtime as frame_system::Trait>::AccountId, member_id: <Runtime as common::membership::MembershipTypes>::MemberId) {
                     crate::council::Module::<Runtime>::announce_candidacy(
                         RawOrigin::Signed(account_id.clone()).into(),
                         member_id,
@@ -334,15 +334,15 @@ impl_runtime_apis! {
 
             impl membership::MembershipWorkingGroupHelper<
                 <Runtime as frame_system::Trait>::AccountId,
-                <Runtime as common::membership::Trait>::MemberId,
-                <Runtime as common::membership::Trait>::ActorId,
+                <Runtime as common::membership::MembershipTypes>::MemberId,
+                <Runtime as common::membership::MembershipTypes>::ActorId,
                     > for Runtime
             {
                 fn insert_a_lead(
                     opening_id: u32,
                     caller_id: &<Runtime as frame_system::Trait>::AccountId,
-                    member_id: <Runtime as common::membership::Trait>::MemberId,
-                ) -> <Runtime as common::membership::Trait>::ActorId {
+                    member_id: <Runtime as common::membership::MembershipTypes>::MemberId,
+                ) -> <Runtime as common::membership::MembershipTypes>::ActorId {
                     working_group::benchmarking::complete_opening::<Runtime, crate::MembershipWorkingGroupInstance>(
                         working_group::OpeningType::Leader,
                         opening_id,