decouple balances from some modules (#1641)

* decouple balances from some module by creating a new traits in support/traits
* improve decl_event
This commit is contained in:
thiolliere
2019-02-08 17:43:12 +01:00
committed by GitHub
parent 83f9e1e720
commit e5dbcf6890
19 changed files with 510 additions and 341 deletions
+2 -1
View File
@@ -79,6 +79,7 @@ use codec::Codec;
use runtime_primitives::traits::{Hash, As, SimpleArithmetic,Bounded, StaticLookup};
use runtime_support::dispatch::{Result, Dispatchable};
use runtime_support::{Parameter, StorageMap, StorageValue, StorageDoubleMap};
use runtime_support::traits::OnFreeBalanceZero;
use system::{ensure_signed, RawOrigin};
use runtime_io::{blake2_256, twox_128};
use timestamp;
@@ -369,7 +370,7 @@ impl<T: Trait> StorageDoubleMap for StorageOf<T> {
}
}
impl<T: Trait> balances::OnFreeBalanceZero<T::AccountId> for Module<T> {
impl<T: Trait> OnFreeBalanceZero<T::AccountId> for Module<T> {
fn on_free_balance_zero(who: &T::AccountId) {
<CodeHashOf<T>>::remove(who);
<StorageOf<T>>::remove_prefix(who.clone());