diff --git a/frame/contracts/src/rent.rs b/frame/contracts/src/rent.rs index 9b3a3f731a2a4..8605451ad1ee7 100644 --- a/frame/contracts/src/rent.rs +++ b/frame/contracts/src/rent.rs @@ -245,7 +245,6 @@ where evictable_code: Option>, ) -> Result>, DispatchError> { match (verdict, evictable_code) { - (Verdict::Exempt, _) => return Ok(Some(alive_contract_info)), (Verdict::Evict { amount }, Some(code)) => { // We need to remove the trie first because it is the only operation // that can fail and this function is called without a storage @@ -274,6 +273,14 @@ where (Verdict::Evict { amount: _ }, None) => { Ok(None) } + (Verdict::Exempt, _) => { + let contract = ContractInfo::Alive(AliveContractInfo:: { + deduct_block: current_block_number, + ..alive_contract_info + }); + >::insert(account, &contract); + Ok(Some(contract.get_alive().expect("We just constructed it as alive. qed"))) + }, (Verdict::Charge { amount }, _) => { let contract = ContractInfo::Alive(AliveContractInfo:: { rent_allowance: alive_contract_info.rent_allowance - amount.peek(),