Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

pallet-evm: avoid double fee payment #6858

Merged
merged 3 commits into from
Aug 13, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions frame/evm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -325,7 +324,7 @@ decl_module! {
gas_limit: u32,
gas_price: U256,
nonce: Option<U256>,
) -> DispatchResult {
) -> DispatchResultWithPostInfo {
T::CallOrigin::ensure_address_origin(&source, origin)?;

match Self::execute_call(
Expand All @@ -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
Expand All @@ -360,7 +359,7 @@ decl_module! {
gas_limit: u32,
gas_price: U256,
nonce: Option<U256>,
) -> DispatchResult {
) -> DispatchResultWithPostInfo {
T::CallOrigin::ensure_address_origin(&source, origin)?;

match Self::execute_create(
Expand All @@ -380,7 +379,7 @@ decl_module! {
},
}

Ok(())
Ok(Pays::No.into())
}

/// Issue an EVM create2 operation.
Expand All @@ -394,7 +393,7 @@ decl_module! {
gas_limit: u32,
gas_price: U256,
nonce: Option<U256>,
) -> DispatchResult {
) -> DispatchResultWithPostInfo {
T::CallOrigin::ensure_address_origin(&source, origin)?;

match Self::execute_create2(
Expand All @@ -415,7 +414,7 @@ decl_module! {
},
}

Ok(())
Ok(Pays::No.into())
}
}
}
Expand Down