Deprecate FunctionOf and remove its users (#6340)

* Deprecate FunctionOf and remove users

* Remove unused import
This commit is contained in:
Alexander Theißen
2020-06-12 15:21:39 +02:00
committed by GitHub
parent 56e2cec02c
commit 7d3f1fe6ea
9 changed files with 53 additions and 127 deletions
+4 -19
View File
@@ -30,7 +30,7 @@ use codec::{Encode, Decode};
#[cfg(feature = "std")]
use serde::{Serialize, Deserialize};
use frame_support::{ensure, decl_module, decl_storage, decl_event, decl_error};
use frame_support::weights::{Weight, DispatchClass, FunctionOf, Pays};
use frame_support::weights::Weight;
use frame_support::traits::{Currency, WithdrawReason, ExistenceRequirement, Get};
use frame_system::{self as system, ensure_signed};
use sp_runtime::ModuleId;
@@ -273,12 +273,7 @@ decl_module! {
}
/// Issue an EVM call operation. This is similar to a message call transaction in Ethereum.
#[weight = FunctionOf(
|(_, _, _, gas_limit, gas_price, _): (&H160, &Vec<u8>, &U256, &u32, &U256, &Option<U256>)|
(*gas_price).saturated_into::<Weight>().saturating_mul(*gas_limit as Weight),
DispatchClass::Normal,
Pays::Yes,
)]
#[weight = (*gas_price).saturated_into::<Weight>().saturating_mul(*gas_limit as Weight)]
fn call(
origin,
target: H160,
@@ -306,12 +301,7 @@ decl_module! {
/// Issue an EVM create operation. This is similar to a contract creation transaction in
/// Ethereum.
#[weight = FunctionOf(
|(_, _, gas_limit, gas_price, _): (&Vec<u8>, &U256, &u32, &U256, &Option<U256>)|
(*gas_price).saturated_into::<Weight>().saturating_mul(*gas_limit as Weight),
DispatchClass::Normal,
Pays::Yes,
)]
#[weight = (*gas_price).saturated_into::<Weight>().saturating_mul(*gas_limit as Weight)]
fn create(
origin,
init: Vec<u8>,
@@ -339,12 +329,7 @@ decl_module! {
}
/// Issue an EVM create2 operation.
#[weight = FunctionOf(
|(_, _, _, gas_limit, gas_price, _): (&Vec<u8>, &H256, &U256, &u32, &U256, &Option<U256>)|
(*gas_price).saturated_into::<Weight>().saturating_mul(*gas_limit as Weight),
DispatchClass::Normal,
Pays::Yes,
)]
#[weight = (*gas_price).saturated_into::<Weight>().saturating_mul(*gas_limit as Weight)]
fn create2(
origin,
init: Vec<u8>,