Browse Source

Merge remote-tracking branch 'arsen/atomic_multi_upload' into sumer-content-dir-module

Mokhtar Naamani 4 years ago
parent
commit
c09b27c4d9

+ 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 - 9
runtime-modules/common/src/lib.rs

@@ -71,15 +71,7 @@ pub trait StorageOwnership {
         + PartialEq;
 
     /// Content id representation.
-    type ContentId: Parameter
-        + Member
-        + BaseArithmetic
-        + Codec
-        + Default
-        + Copy
-        + MaybeSerialize
-        + Ord
-        + PartialEq;
+    type ContentId: Parameter + Member + Codec + Default + Copy + MaybeSerialize + Ord + PartialEq;
 
     /// Data object type id.
     type DataObjectTypeId: Parameter

+ 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> {

+ 6 - 7
runtime/src/lib.rs

@@ -428,15 +428,15 @@ 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 {
-    type ChannelId = u64;
-    type DAOId = u64;
-    type ContentId = u64;
-    type DataObjectTypeId = u64;
+    type ChannelId = ChannelId;
+    type DAOId = DAOId;
+    type ContentId = ContentId;
+    type DataObjectTypeId = DataObjectTypeId;
 }
 
 impl governance::election::Trait for Runtime {
@@ -459,7 +459,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;