The order of balance transfers from the contract's accounts during termination is changed so that balance on hold is transferred to the origin before the contract's free balance is transferred to the beneficiary. This way we let the contract's account be reaped when the account is emptied.
The struct Charge is updated so that the bool terminated becomes status which is a new ContractStatus enum.
/// The beneficiary of a contract termination.
type BeneficiaryOf<T> = AccountIdOf<T>;
/// The status of a contract.
///
/// In case of termination the beneficiary is indicated.
#[derive(RuntimeDebugNoBound, Clone, PartialEq, Eq)]
pub enum ContractStatus<T: Config> {
Alive,
Terminated(BeneficiaryOf<T>),
}
The order of balance transfers from the contract's accounts during termination is changed so that balance on hold is transferred to the origin before the contract's free balance is transferred to the
beneficiary
. This way we let the contract's account be reaped when the account is emptied.The struct
Charge
is updated so that the boolterminated
becomesstatus
which is a newContractStatus
enum.