contracts: Convert to framev2 macros (#8157)

* contracts: Convert to framev2

* Reduce the API surface of the crate

* Remove unused import

* Merge import block

* Use pallet::metadata to reduce metadata diff

* Remove the explicit "Null" from AccountCounter
This commit is contained in:
Alexander Theißen
2021-02-22 16:18:24 +01:00
committed by GitHub
parent 4f4a0c5b38
commit b2f393945a
15 changed files with 673 additions and 668 deletions
+3 -3
View File
@@ -18,7 +18,7 @@
//! A module responsible for computing the right amount of weight and charging it.
use crate::{
AliveContractInfo, BalanceOf, ContractInfo, ContractInfoOf, Module, RawEvent,
AliveContractInfo, BalanceOf, ContractInfo, ContractInfoOf, Module, Event,
TombstoneContractInfo, Config, CodeHash, Error,
storage::Storage, wasm::PrefabWasmModule, exec::Executable,
};
@@ -26,7 +26,7 @@ use sp_std::prelude::*;
use sp_io::hashing::blake2_256;
use sp_core::crypto::UncheckedFrom;
use frame_support::{
debug, StorageMap,
debug,
storage::child,
traits::{Currency, ExistenceRequirement, Get, OnUnbalanced, WithdrawReasons},
};
@@ -268,7 +268,7 @@ where
let tombstone_info = ContractInfo::Tombstone(tombstone);
<ContractInfoOf<T>>::insert(account, &tombstone_info);
code.drop_from_storage();
<Module<T>>::deposit_event(RawEvent::Evicted(account.clone()));
<Module<T>>::deposit_event(Event::Evicted(account.clone()));
Ok(None)
}
(Verdict::Evict { amount: _ }, None) => {