@@ -25,7 +25,7 @@ pub use crate::backend::{Account, Log, Vicinity, Backend};
25
25
26
26
use sp_std:: { vec:: Vec , marker:: PhantomData } ;
27
27
use frame_support:: { ensure, decl_module, decl_storage, decl_event, decl_error} ;
28
- use frame_support:: weights:: { Weight , DispatchClass , FunctionOf } ;
28
+ use frame_support:: weights:: { Weight , MINIMUM_WEIGHT , DispatchClass , FunctionOf } ;
29
29
use frame_support:: traits:: { Currency , WithdrawReason , ExistenceRequirement } ;
30
30
use frame_system:: { self as system, ensure_signed} ;
31
31
use sp_runtime:: ModuleId ;
@@ -191,7 +191,7 @@ decl_module! {
191
191
fn deposit_event( ) = default ;
192
192
193
193
/// Deposit balance from currency/balances module into EVM.
194
- #[ weight = SimpleDispatchInfo :: FixedNormal ( 10_000 ) ]
194
+ #[ weight = SimpleDispatchInfo :: FixedNormal ( MINIMUM_WEIGHT ) ]
195
195
fn deposit_balance( origin, value: BalanceOf <T >) {
196
196
let sender = ensure_signed( origin) ?;
197
197
@@ -212,7 +212,7 @@ decl_module! {
212
212
}
213
213
214
214
/// Withdraw balance from EVM into currency/balances module.
215
- #[ weight = SimpleDispatchInfo :: FixedNormal ( 10_000 ) ]
215
+ #[ weight = SimpleDispatchInfo :: FixedNormal ( MINIMUM_WEIGHT ) ]
216
216
fn withdraw_balance( origin, value: BalanceOf <T >) {
217
217
let sender = ensure_signed( origin) ?;
218
218
let address = T :: ConvertAccountId :: convert_account_id( & sender) ;
@@ -236,7 +236,7 @@ decl_module! {
236
236
}
237
237
238
238
/// Issue an EVM call operation. This is similar to a message call transaction in Ethereum.
239
- #[ weight = FunctionOf ( |( _, _, _, gas_limit, gas_price, _) : ( & H160 , & Vec <u8 >, & U256 , & u32 , & U256 , & Option <U256 >) | ( * gas_price) . saturated_into:: <Weight >( ) . saturating_mul( * gas_limit) , DispatchClass :: Normal , true ) ]
239
+ #[ 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 , true ) ]
240
240
fn call(
241
241
origin,
242
242
target: H160 ,
@@ -267,7 +267,7 @@ decl_module! {
267
267
268
268
/// Issue an EVM create operation. This is similar to a contract creation transaction in
269
269
/// Ethereum.
270
- #[ weight = FunctionOf ( |( _, _, gas_limit, gas_price, _) : ( & Vec <u8 >, & U256 , & u32 , & U256 , & Option <U256 >) | ( * gas_price) . saturated_into:: <Weight >( ) . saturating_mul( * gas_limit) , DispatchClass :: Normal , true ) ]
270
+ #[ 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 , true ) ]
271
271
fn create(
272
272
origin,
273
273
init: Vec <u8 >,
@@ -302,7 +302,7 @@ decl_module! {
302
302
}
303
303
304
304
/// Issue an EVM create2 operation.
305
- #[ weight = FunctionOf ( |( _, _, _, gas_limit, gas_price, _) : ( & Vec <u8 >, & H256 , & U256 , & u32 , & U256 , & Option <U256 >) | ( * gas_price) . saturated_into:: <Weight >( ) . saturating_mul( * gas_limit) , DispatchClass :: Normal , true ) ]
305
+ #[ 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 , true ) ]
306
306
fn create2(
307
307
origin,
308
308
init: Vec <u8 >,
0 commit comments