|
@@ -1,9 +1,19 @@
|
|
|
-// commented out to use in other crates
|
|
|
-// #![cfg(test)]
|
|
|
+#![cfg(feature = "std")]
|
|
|
|
|
|
-use crate::genesis_member;
|
|
|
use crate::{GenesisConfig, Trait};
|
|
|
use common::currency::BalanceOf;
|
|
|
+use serde::{Deserialize, Serialize};
|
|
|
+
|
|
|
+#[derive(Serialize, Deserialize)]
|
|
|
+pub struct Member<MemberId, AccountId, Moment> {
|
|
|
+ pub member_id: MemberId,
|
|
|
+ pub root_account: AccountId,
|
|
|
+ pub controller_account: AccountId,
|
|
|
+ pub handle: String,
|
|
|
+ pub avatar_uri: String,
|
|
|
+ pub about: String,
|
|
|
+ pub registered_at_time: Moment,
|
|
|
+}
|
|
|
|
|
|
/// Builder fo membership module genesis configuration.
|
|
|
pub struct GenesisConfigBuilder<T: Trait> {
|
|
@@ -41,18 +51,16 @@ impl<T: Trait> GenesisConfigBuilder<T> {
|
|
|
.members
|
|
|
.iter()
|
|
|
.enumerate()
|
|
|
- .map(
|
|
|
- |(ix, (ref member_id, ref account_id))| genesis_member::Member {
|
|
|
- member_id: *member_id,
|
|
|
- root_account: account_id.clone(),
|
|
|
- controller_account: account_id.clone(),
|
|
|
- // hack to get min handle length to 5
|
|
|
- handle: (10000 + ix).to_string(),
|
|
|
- avatar_uri: "".into(),
|
|
|
- about: "".into(),
|
|
|
- registered_at_time: T::Moment::from(0),
|
|
|
- },
|
|
|
- )
|
|
|
+ .map(|(ix, (ref member_id, ref account_id))| Member {
|
|
|
+ member_id: *member_id,
|
|
|
+ root_account: account_id.clone(),
|
|
|
+ controller_account: account_id.clone(),
|
|
|
+ // hack to get min handle length to 5
|
|
|
+ handle: (10000 + ix).to_string(),
|
|
|
+ avatar_uri: "".into(),
|
|
|
+ about: "".into(),
|
|
|
+ registered_at_time: T::Moment::from(0),
|
|
|
+ })
|
|
|
.collect(),
|
|
|
}
|
|
|
}
|