diff --git a/frame/evm/src/lib.rs b/frame/evm/src/lib.rs index 910030383e1ef..c837f448fca53 100644 --- a/frame/evm/src/lib.rs +++ b/frame/evm/src/lib.rs @@ -33,13 +33,12 @@ 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; +use frame_support::weights::{Weight, Pays}; use frame_support::traits::{Currency, ExistenceRequirement, Get}; +use frame_support::dispatch::DispatchResultWithPostInfo; use frame_system::RawOrigin; use sp_core::{U256, H256, H160, Hasher}; -use sp_runtime::{ - DispatchResult, AccountId32, traits::{UniqueSaturatedInto, SaturatedConversion, BadOrigin}, -}; +use sp_runtime::{AccountId32, traits::{UniqueSaturatedInto, SaturatedConversion, BadOrigin}}; use sha3::{Digest, Keccak256}; pub use evm::{ExitReason, ExitSucceed, ExitError, ExitRevert, ExitFatal}; use evm::Config; @@ -325,7 +324,7 @@ decl_module! { gas_limit: u32, gas_price: U256, nonce: Option, - ) -> DispatchResult { + ) -> DispatchResultWithPostInfo { T::CallOrigin::ensure_address_origin(&source, origin)?; match Self::execute_call( @@ -346,7 +345,7 @@ decl_module! { }, } - Ok(()) + Ok(Pays::No.into()) } /// Issue an EVM create operation. This is similar to a contract creation transaction in @@ -360,7 +359,7 @@ decl_module! { gas_limit: u32, gas_price: U256, nonce: Option, - ) -> DispatchResult { + ) -> DispatchResultWithPostInfo { T::CallOrigin::ensure_address_origin(&source, origin)?; match Self::execute_create( @@ -380,7 +379,7 @@ decl_module! { }, } - Ok(()) + Ok(Pays::No.into()) } /// Issue an EVM create2 operation. @@ -394,7 +393,7 @@ decl_module! { gas_limit: u32, gas_price: U256, nonce: Option, - ) -> DispatchResult { + ) -> DispatchResultWithPostInfo { T::CallOrigin::ensure_address_origin(&source, origin)?; match Self::execute_create2( @@ -415,7 +414,7 @@ decl_module! { }, } - Ok(()) + Ok(Pays::No.into()) } } }