Contracts: seal0::balance should return the free balance (#1254)

This commit is contained in:
Cyrill Leutwiler
2023-09-01 14:33:15 +02:00
committed by GitHub
parent e165eacd58
commit 24c41f10bb
4 changed files with 128 additions and 7 deletions
+6 -2
View File
@@ -30,7 +30,7 @@ use frame_support::{
storage::{with_transaction, TransactionOutcome},
traits::{
fungible::{Inspect, Mutate},
tokens::Preservation,
tokens::{Fortitude, Preservation},
Contains, OriginTrait, Randomness, Time,
},
weights::Weight,
@@ -1368,7 +1368,11 @@ where
}
fn balance(&self) -> BalanceOf<T> {
T::Currency::balance(&self.top_frame().account_id)
T::Currency::reducible_balance(
&self.top_frame().account_id,
Preservation::Preserve,
Fortitude::Polite,
)
}
fn value_transferred(&self) -> BalanceOf<T> {