mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 17:31:03 +00:00
seal: Fail instantiate if new contract is below subsistence threshold (#6719)
* seal: Fail instantiate if new contract is below subsistence threshold We need each contract that exists to be above the subsistence threshold in order to keep up the guarantuee that we always leave a tombstone behind with the exception of a contract that called `ext_terminate`. * Fixup executor test * Bump runtime
This commit is contained in:
committed by
GitHub
parent
63bd1d8346
commit
bead1becf0
@@ -743,7 +743,7 @@ impl<T: Trait> Config<T> {
|
||||
/// than the subsistence threshold in order to guarantee that a tombstone is created.
|
||||
///
|
||||
/// The only way to completely kill a contract without a tombstone is calling `ext_terminate`.
|
||||
fn subsistence_threshold(&self) -> BalanceOf<T> {
|
||||
pub fn subsistence_threshold(&self) -> BalanceOf<T> {
|
||||
self.existential_deposit.saturating_add(self.tombstone_deposit)
|
||||
}
|
||||
|
||||
@@ -751,7 +751,7 @@ impl<T: Trait> Config<T> {
|
||||
///
|
||||
/// This is for cases where this value is needed in rent calculation rather than
|
||||
/// during contract execution.
|
||||
fn subsistence_threshold_uncached() -> BalanceOf<T> {
|
||||
pub fn subsistence_threshold_uncached() -> BalanceOf<T> {
|
||||
T::Currency::minimum_balance().saturating_add(T::TombstoneDeposit::get())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user