Browse Source

runtime: utilities: rename pallet

conectado 4 years ago
parent
commit
b761fabbfd

+ 26 - 26
Cargo.lock

@@ -2345,7 +2345,6 @@ dependencies = [
  "frame-system-benchmarking",
  "frame-system-rpc-runtime-api",
  "hex-literal",
- "joystream-utility",
  "lazy_static",
  "lite-json",
  "pallet-authority-discovery",
@@ -2403,31 +2402,7 @@ dependencies = [
  "sp-version",
  "strum 0.19.5",
  "substrate-wasm-builder-runner",
-]
-
-[[package]]
-name = "joystream-utility"
-version = "1.0.0"
-dependencies = [
- "frame-benchmarking",
- "frame-support",
- "frame-system",
- "pallet-balances",
- "pallet-common",
- "pallet-council",
- "pallet-membership",
- "pallet-referendum",
- "pallet-staking-handler",
- "pallet-timestamp",
- "pallet-working-group",
- "parity-scale-codec",
- "serde",
- "sp-arithmetic",
- "sp-core",
- "sp-io",
- "sp-runtime",
- "sp-std",
- "strum 0.19.5",
+ "utility",
 ]
 
 [[package]]
@@ -8263,6 +8238,31 @@ dependencies = [
  "percent-encoding 2.1.0",
 ]
 
+[[package]]
+name = "utility"
+version = "1.0.0"
+dependencies = [
+ "frame-benchmarking",
+ "frame-support",
+ "frame-system",
+ "pallet-balances",
+ "pallet-common",
+ "pallet-council",
+ "pallet-membership",
+ "pallet-referendum",
+ "pallet-staking-handler",
+ "pallet-timestamp",
+ "pallet-working-group",
+ "parity-scale-codec",
+ "serde",
+ "sp-arithmetic",
+ "sp-core",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+ "strum 0.19.5",
+]
+
 [[package]]
 name = "vcpkg"
 version = "0.2.10"

+ 1 - 1
Cargo.toml

@@ -17,7 +17,7 @@ members = [
 	"runtime-modules/constitution",
 	"runtime-modules/staking-handler",
     "runtime-modules/blog",
-    "runtime-modules/joystream-utility",
+    "runtime-modules/utility",
 	"node",
 	"utils/chain-spec-builder/"
 ]

+ 1 - 1
runtime-modules/joystream-utility/Cargo.toml → runtime-modules/utility/Cargo.toml

@@ -1,5 +1,5 @@
 [package]
-name = 'joystream-utility'
+name = 'utility'
 version = '1.0.0'
 authors = ['Joystream contributors']
 edition = '2018'

+ 0 - 0
runtime-modules/joystream-utility/src/benchmarking.rs → runtime-modules/utility/src/benchmarking.rs


+ 0 - 0
runtime-modules/joystream-utility/src/lib.rs → runtime-modules/utility/src/lib.rs


+ 0 - 0
runtime-modules/joystream-utility/src/tests/mocks.rs → runtime-modules/utility/src/tests/mocks.rs


+ 0 - 0
runtime-modules/joystream-utility/src/tests/mod.rs → runtime-modules/utility/src/tests/mod.rs


+ 3 - 3
runtime/Cargo.toml

@@ -79,7 +79,7 @@ content-directory = { package = 'pallet-content-directory', default-features = f
 pallet_constitution = { package = 'pallet-constitution', default-features = false, path = '../runtime-modules/constitution' }
 staking-handler = { package = 'pallet-staking-handler', default-features = false, path = '../runtime-modules/staking-handler'}
 blog = { package = 'pallet-blog', default-features = false, path = '../runtime-modules/blog'}
-joystream-utility = { package = 'joystream-utility', default-features = false, path = '../runtime-modules/joystream-utility'}
+utility = { package = 'utility', default-features = false, path = '../runtime-modules/utility'}
 
 [dev-dependencies]
 sp-io = { package = 'sp-io', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = 'a200cdb93c6af5763b9c7bf313fa708764ac88ca'}
@@ -154,7 +154,7 @@ std = [
     'pallet_constitution/std',
     'staking-handler/std',
     'blog/std',
-    'joystream-utility/std'
+    'utility/std'
 ]
 runtime-benchmarks = [
     "frame-system/runtime-benchmarks",
@@ -171,7 +171,7 @@ runtime-benchmarks = [
     "proposals-discussion/runtime-benchmarks",
     "proposals-engine/runtime-benchmarks",
     "proposals-codex/runtime-benchmarks",
-    "joystream-utility/runtime-benchmarks",
+    "utility/runtime-benchmarks",
     "pallet_constitution/runtime-benchmarks",
     "working-group/runtime-benchmarks",
     "forum/runtime-benchmarks",

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

@@ -34,7 +34,7 @@ impl ProposalEncoder<Runtime> for ExtrinsicProposalEncoder {
     fn encode_proposal(proposal_details: ProposalDetailsOf<Runtime>) -> Vec<u8> {
         let call = match proposal_details {
             ProposalDetails::Signal(signal) => {
-                Call::JoystreamUtility(joystream_utility::Call::execute_signal_proposal(signal))
+                Call::JoystreamUtility(utility::Call::execute_signal_proposal(signal))
             }
             ProposalDetails::FundingRequest(params) => {
                 Call::Council(council::Call::funding_request(params))
@@ -42,9 +42,9 @@ impl ProposalEncoder<Runtime> for ExtrinsicProposalEncoder {
             ProposalDetails::SetMaxValidatorCount(new_validator_count) => Call::Staking(
                 pallet_staking::Call::set_validator_count(new_validator_count),
             ),
-            ProposalDetails::RuntimeUpgrade(blob) => Call::JoystreamUtility(
-                joystream_utility::Call::execute_runtime_upgrade_proposal(blob),
-            ),
+            ProposalDetails::RuntimeUpgrade(blob) => {
+                Call::JoystreamUtility(utility::Call::execute_runtime_upgrade_proposal(blob))
+            }
             ProposalDetails::CreateWorkingGroupLeadOpening(create_opening_params) => {
                 wrap_working_group_call!(
                     create_opening_params.group,
@@ -58,7 +58,7 @@ impl ProposalEncoder<Runtime> for ExtrinsicProposalEncoder {
                 )
             }
             ProposalDetails::UpdateWorkingGroupBudget(amount, working_group, balance_kind) => {
-                Call::JoystreamUtility(joystream_utility::Call::update_working_group_budget(
+                Call::JoystreamUtility(utility::Call::update_working_group_budget(
                     working_group,
                     amount,
                     balance_kind,

+ 3 - 3
runtime/src/lib.rs

@@ -827,10 +827,10 @@ impl proposals_discussion::Trait for Runtime {
     type WeightInfo = weights::proposals_discussion::WeightInfo;
 }
 
-impl joystream_utility::Trait for Runtime {
+impl utility::Trait for Runtime {
     type Event = Event;
 
-    type WeightInfo = weights::joystream_utility::WeightInfo;
+    type WeightInfo = weights::utility::WeightInfo;
 
     fn get_working_group_budget(working_group: WorkingGroup) -> Balance {
         call_wg!(working_group, get_budget)
@@ -957,7 +957,7 @@ construct_runtime!(
         ContentDirectory: content_directory::{Module, Call, Storage, Event<T>, Config<T>},
         Constitution: pallet_constitution::{Module, Call, Storage, Event},
         Blog: blog::<Instance1>::{Module, Call, Storage, Event<T>},
-        JoystreamUtility: joystream_utility::{Module, Call, Event<T>},
+        JoystreamUtility: utility::{Module, Call, Event<T>},
         // --- Storage
         DataObjectTypeRegistry: data_object_type_registry::{Module, Call, Storage, Event<T>, Config<T>},
         DataDirectory: data_directory::{Module, Call, Storage, Event<T>},

+ 1 - 1
runtime/src/runtime_api.rs

@@ -386,7 +386,7 @@ impl_runtime_apis! {
             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);
+            add_benchmark!(params, batches, utility, JoystreamUtility);
 
             if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }
             Ok(batches)

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

@@ -119,8 +119,7 @@ impl Default for DummyProposalFixture {
     fn default() -> Self {
         let title = b"title".to_vec();
         let description = b"description".to_vec();
-        let dummy_proposal =
-            joystream_utility::Call::<Runtime>::execute_signal_proposal(b"signal".to_vec());
+        let dummy_proposal = utility::Call::<Runtime>::execute_signal_proposal(b"signal".to_vec());
 
         DummyProposalFixture {
             parameters: ProposalParameters {

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

@@ -27,11 +27,11 @@ pub mod pallet_utility;
 pub mod blog;
 pub mod council;
 pub mod forum;
-pub mod joystream_utility;
 pub mod membership;
 pub mod pallet_constitution;
 pub mod proposals_codex;
 pub mod proposals_discussion;
 pub mod proposals_engine;
 pub mod referendum;
+pub mod utility;
 pub mod working_group;

+ 1 - 1
runtime/src/weights/joystream_utility.rs → runtime/src/weights/utility.rs

@@ -6,7 +6,7 @@
 use frame_support::weights::{constants::RocksDbWeight as DbWeight, Weight};
 
 pub struct WeightInfo;
-impl joystream_utility::WeightInfo for WeightInfo {
+impl utility::WeightInfo for WeightInfo {
     fn execute_signal_proposal(i: u32) -> Weight {
         (81_623_000 as Weight).saturating_add((162_000 as Weight).saturating_mul(i as Weight))
     }