Browse Source

Lib.rs: add type aliases for the StorageOwnership types

iorveth 4 years ago
parent
commit
a59562e099

+ 1 - 0
Cargo.lock

@@ -3300,6 +3300,7 @@ dependencies = [
  "serde",
  "sp-arithmetic 2.0.0",
  "sp-runtime",
+ "sp-std 2.0.0-rc4",
  "strum 0.19.2",
  "strum_macros 0.19.2",
 ]

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

@@ -14,6 +14,7 @@ frame-support = { package = 'frame-support', default-features = false, git = 'ht
 system = { package = 'frame-system', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
 pallet-timestamp = { package = 'pallet-timestamp', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
 sp-arithmetic = { package = 'sp-arithmetic', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = 'a200cdb93c6af5763b9c7bf313fa708764ac88ca'}
+sp-std = { package = 'sp-std', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
 
 [features]
 default = ['std']
@@ -24,6 +25,7 @@ std = [
 	'codec/std',
 	'sp-runtime/std',
 	'sp-arithmetic/std',
+	'sp-std/std',
 	'frame-support/std',
 	'system/std',
 	'pallet-timestamp/std',

+ 1 - 0
runtime-modules/common/src/storage.rs

@@ -2,6 +2,7 @@ use codec::{Decode, Encode};
 #[cfg(feature = "std")]
 use serde::{Deserialize, Serialize};
 use sp_runtime::DispatchResult;
+use sp_std::vec::Vec;
 
 #[derive(Clone, Encode, Decode, PartialEq, Eq, Debug)]
 pub struct ContentParameters<ContentId, DataObjectTypeId> {

+ 2 - 3
runtime/src/lib.rs

@@ -451,8 +451,8 @@ impl common::currency::GovernanceCurrency for Runtime {
 }
 
 impl common::MembershipTypes for Runtime {
-    type MemberId = u64;
-    type ActorId = u64;
+    type MemberId = MemberId;
+    type ActorId = ActorId;
 }
 
 impl common::StorageOwnership for Runtime {
@@ -482,7 +482,6 @@ parameter_types! {
 
 impl storage::data_object_type_registry::Trait for Runtime {
     type Event = Event;
-    type DataObjectTypeId = u64;
 }
 
 impl storage::data_directory::Trait for Runtime {

+ 9 - 0
runtime/src/primitives.rs

@@ -15,6 +15,15 @@ pub type TransactionPriority = u64;
 /// Alias for ContentId, used in various places.
 pub type ContentId = sp_core::H256;
 
+/// Alias for ChannelId, used in various places.
+pub type ChannelId = u64;
+
+/// Alias for DAOId, used in various places.
+pub type DAOId = u64;
+
+/// Alias for DataObjectTypeId, used in various places.
+pub type DataObjectTypeId = u64;
+
 /// An index to a block.
 pub type BlockNumber = u32;