Minimum balance (#3519)

This commit is contained in:
Sergei Pepyakin
2019-09-01 02:19:31 +02:00
committed by Gavin Wood
parent feecfc856d
commit 63c15c9803
3 changed files with 83 additions and 0 deletions
+7
View File
@@ -154,6 +154,9 @@ pub trait Ext {
/// Returns a reference to the timestamp of the current block
fn now(&self) -> &MomentOf<Self::T>;
/// Returns the minimum balance that is required for creating an account.
fn minimum_balance(&self) -> BalanceOf<Self::T>;
/// Returns a random number for the current block with the given subject.
fn random(&self, subject: &[u8]) -> SeedOf<Self::T>;
@@ -766,6 +769,10 @@ where
&self.timestamp
}
fn minimum_balance(&self) -> BalanceOf<T> {
self.ctx.config.existential_deposit
}
fn deposit_event(&mut self, topics: Vec<T::Hash>, data: Vec<u8>) {
self.ctx.deferred.push(DeferredAction::DepositEvent {
topics,