Browse Source

runtime: Remove the InitialMembersBalance.

Shamil Gadelshin 4 years ago
parent
commit
6befceb8f4

+ 0 - 2
runtime-modules/content-working-group/src/mock.rs

@@ -36,7 +36,6 @@ parameter_types! {
     pub const CreationFee: u32 = 0;
     pub const TransactionBaseFee: u32 = 1;
     pub const TransactionByteFee: u32 = 0;
-    pub const InitialMembersBalance: u64 = 2000;
     pub const StakePoolId: [u8; 8] = *b"joystake";
 }
 
@@ -179,7 +178,6 @@ impl membership::Trait for Test {
     type PaidTermId = u64;
     type SubscriptionId = u64;
     type ActorId = u64;
-    type InitialMembersBalance = InitialMembersBalance;
 }
 
 impl Trait for Test {

+ 1 - 1
runtime-modules/content-working-group/src/tests.rs

@@ -1183,7 +1183,7 @@ impl SetLeadFixture {
         let new_lead = LeadById::<Test>::get(new_lead_id);
 
         let expected_new_lead = Lead {
-            member_id: 0,
+            member_id: self.member_id,
             role_account: self.new_role_account,
             reward_relationship: None,
             inducted: 1, // make dynamic later

+ 0 - 2
runtime-modules/governance/src/mock.rs

@@ -68,7 +68,6 @@ impl membership::Trait for Test {
     type SubscriptionId = u32;
     type PaidTermId = u32;
     type ActorId = u32;
-    type InitialMembersBalance = InitialMembersBalance;
 }
 impl minting::Trait for Test {
     type Currency = Balances;
@@ -85,7 +84,6 @@ parameter_types! {
     pub const CreationFee: u32 = 0;
     pub const TransactionBaseFee: u32 = 1;
     pub const TransactionByteFee: u32 = 0;
-    pub const InitialMembersBalance: u32 = 0;
 }
 
 impl balances::Trait for Test {

+ 0 - 1
runtime-modules/hiring/src/mock.rs

@@ -58,7 +58,6 @@ parameter_types! {
     pub const CreationFee: u32 = 0;
     pub const TransactionBaseFee: u32 = 1;
     pub const TransactionByteFee: u32 = 0;
-    pub const InitialMembersBalance: u64 = 2000;
     pub const StakePoolId: [u8; 8] = *b"joystake";
 }
 

+ 1 - 7
runtime-modules/membership/src/lib.rs

@@ -13,7 +13,7 @@ use codec::{Codec, Decode, Encode};
 use rstd::borrow::ToOwned;
 use rstd::prelude::*;
 use sr_primitives::traits::{MaybeSerialize, Member, One, SimpleArithmetic};
-use srml_support::traits::{Currency, Get};
+use srml_support::traits::Currency;
 use srml_support::{decl_event, decl_module, decl_storage, dispatch, ensure, Parameter};
 use system::{self, ensure_root, ensure_signed};
 
@@ -59,9 +59,6 @@ pub trait Trait: system::Trait + GovernanceCurrency + timestamp::Trait {
         + MaybeSerialize
         + PartialEq
         + Ord;
-
-    /// Initial balance of members created at genesis
-    type InitialMembersBalance: Get<BalanceOf<Self>>;
 }
 
 const FIRST_PAID_TERMS_ID: u32 = 1;
@@ -216,9 +213,6 @@ decl_storage! {
                 };
 
                 <Module<T>>::insert_member(&who, &user_info, EntryMethod::Genesis);
-
-                // Give member starting balance
-                T::Currency::deposit_creating(&who, T::InitialMembersBalance::get());
             }
         });
     }

+ 0 - 2
runtime-modules/membership/src/mock.rs

@@ -60,7 +60,6 @@ parameter_types! {
     pub const CreationFee: u32 = 0;
     pub const TransactionBaseFee: u32 = 1;
     pub const TransactionByteFee: u32 = 0;
-    pub const InitialMembersBalance: u64 = 2000;
 }
 
 impl balances::Trait for Test {
@@ -90,7 +89,6 @@ impl Trait for Test {
     type PaidTermId = u32;
     type SubscriptionId = u32;
     type ActorId = u32;
-    type InitialMembersBalance = InitialMembersBalance;
 }
 
 pub struct TestExternalitiesBuilder<T: Trait> {

+ 0 - 6
runtime-modules/membership/src/tests.rs

@@ -89,12 +89,6 @@ fn initial_state() {
                 };
 
             assert_eq!(default_terms.fee, DEFAULT_FEE);
-
-            // initial balance
-            assert_eq!(
-                Balances::free_balance(initial_members[0]),
-                <Test as crate::Trait>::InitialMembersBalance::get()
-            );
         });
 }
 

+ 0 - 1
runtime-modules/proposals/codex/src/tests/mock.rs

@@ -50,7 +50,6 @@ impl membership::Trait for Test {
     type PaidTermId = u64;
     type SubscriptionId = u64;
     type ActorId = u64;
-    type InitialMembersBalance = ();
 }
 
 parameter_types! {

+ 0 - 1
runtime-modules/proposals/discussion/src/tests/mock.rs

@@ -81,7 +81,6 @@ impl membership::Trait for Test {
     type PaidTermId = u64;
     type SubscriptionId = u64;
     type ActorId = u64;
-    type InitialMembersBalance = ();
 }
 
 impl crate::Trait for Test {

+ 0 - 1
runtime-modules/proposals/engine/src/tests/mock/mod.rs

@@ -100,7 +100,6 @@ impl membership::Trait for Test {
     type PaidTermId = u64;
     type SubscriptionId = u64;
     type ActorId = u64;
-    type InitialMembersBalance = ();
 }
 
 impl crate::Trait for Test {

+ 0 - 1
runtime-modules/recurring-reward/src/mock/mod.rs

@@ -56,7 +56,6 @@ parameter_types! {
     pub const CreationFee: u32 = 0;
     pub const TransactionBaseFee: u32 = 1;
     pub const TransactionByteFee: u32 = 0;
-    pub const InitialMembersBalance: u64 = 2000;
 }
 
 impl balances::Trait for Test {

+ 0 - 2
runtime-modules/service-discovery/src/mock.rs

@@ -50,7 +50,6 @@ parameter_types! {
     pub const MaximumBlockLength: u32 = 2 * 1024;
     pub const AvailableBlockRatio: Perbill = Perbill::one();
     pub const MinimumPeriod: u64 = 5;
-    pub const InitialMembersBalance: u64 = 2000;
     pub const StakePoolId: [u8; 8] = *b"joystake";
     pub const ExistentialDeposit: u32 = 0;
     pub const TransferFee: u32 = 0;
@@ -105,7 +104,6 @@ impl membership::Trait for Test {
     type PaidTermId = u64;
     type SubscriptionId = u64;
     type ActorId = u64;
-    type InitialMembersBalance = InitialMembersBalance;
 }
 
 impl common::currency::GovernanceCurrency for Test {

+ 0 - 2
runtime-modules/storage/src/tests/mock.rs

@@ -126,7 +126,6 @@ parameter_types! {
     pub const CreationFee: u32 = 0;
     pub const TransactionBaseFee: u32 = 1;
     pub const TransactionByteFee: u32 = 0;
-    pub const InitialMembersBalance: u32 = 2000;
     pub const StakePoolId: [u8; 8] = *b"joystake";
 }
 
@@ -200,7 +199,6 @@ impl membership::Trait for Test {
     type SubscriptionId = u32;
     type PaidTermId = u32;
     type ActorId = u32;
-    type InitialMembersBalance = InitialMembersBalance;
 }
 
 impl stake::Trait for Test {

+ 0 - 1
runtime-modules/token-minting/src/mock.rs

@@ -52,7 +52,6 @@ parameter_types! {
     pub const CreationFee: u32 = 0;
     pub const TransactionBaseFee: u32 = 1;
     pub const TransactionByteFee: u32 = 0;
-    pub const InitialMembersBalance: u64 = 2000;
 }
 
 impl balances::Trait for Test {

+ 0 - 2
runtime-modules/working-group/src/tests/mock.rs

@@ -38,7 +38,6 @@ parameter_types! {
     pub const MaximumBlockLength: u32 = 2 * 1024;
     pub const AvailableBlockRatio: Perbill = Perbill::one();
     pub const MinimumPeriod: u64 = 5;
-    pub const InitialMembersBalance: u64 = 2000;
     pub const StakePoolId: [u8; 8] = *b"joystake";
     pub const ExistentialDeposit: u32 = 0;
     pub const TransferFee: u32 = 0;
@@ -93,7 +92,6 @@ impl membership::Trait for Test {
     type PaidTermId = u64;
     type SubscriptionId = u64;
     type ActorId = u64;
-    type InitialMembersBalance = InitialMembersBalance;
 }
 
 impl common::currency::GovernanceCurrency for Test {

+ 0 - 1
runtime/src/lib.rs

@@ -589,7 +589,6 @@ impl membership::Trait for Runtime {
     type PaidTermId = u64;
     type SubscriptionId = u64;
     type ActorId = ActorId;
-    type InitialMembersBalance = InitialMembersBalance;
 }
 
 /*