mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-17 16:01:04 +00:00
contracts: Cap the surcharge reward by the amount of rent that way payed by a contract (#7870)
* Add rent_payed field to the contract info * Don't pay out more as reward as was spent in rent * Make successful evictions free * Add tests to check that surcharge reward is capped by rent payed * review: Fixed docs
This commit is contained in:
committed by
GitHub
parent
c2ebcae0a6
commit
ad1717293d
@@ -27,7 +27,7 @@ use codec::{Encode, Decode};
|
||||
use sp_std::prelude::*;
|
||||
use sp_std::marker::PhantomData;
|
||||
use sp_io::hashing::blake2_256;
|
||||
use sp_runtime::traits::{Bounded, Saturating};
|
||||
use sp_runtime::traits::{Bounded, Saturating, Zero};
|
||||
use sp_core::crypto::UncheckedFrom;
|
||||
use frame_support::{
|
||||
dispatch::DispatchResult,
|
||||
@@ -181,6 +181,7 @@ where
|
||||
// charge rent for it during instantation.
|
||||
<frame_system::Module<T>>::block_number().saturating_sub(1u32.into()),
|
||||
rent_allowance: <BalanceOf<T>>::max_value(),
|
||||
rent_payed: <BalanceOf<T>>::zero(),
|
||||
pair_count: 0,
|
||||
last_write: None,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user