Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadkaouk committed Dec 8, 2023
1 parent 351f007 commit 2f74d52
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 20 deletions.
15 changes: 3 additions & 12 deletions client/rpc/src/eth/submit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ use sp_api::{ApiExt, ProvideRuntimeApi};
use sp_block_builder::BlockBuilder as BlockBuilderApi;
use sp_blockchain::HeaderBackend;
use sp_inherents::CreateInherentDataProviders;
use sp_runtime::{traits::Block as BlockT, transaction_validity::TransactionSource,
};
use sp_runtime::{traits::Block as BlockT, transaction_validity::TransactionSource};
// Frontier
use fc_rpc_core::types::*;
use fp_rpc::{ConvertTransaction, ConvertTransactionRuntimeApi, EthereumRuntimeRPCApi};
Expand Down Expand Up @@ -149,11 +148,7 @@ where
let extrinsic = self.convert_transaction(block_hash, transaction)?;

self.pool
.submit_one(
block_hash,
TransactionSource::Local,
extrinsic,
)
.submit_one(block_hash, TransactionSource::Local, extrinsic)
.map_ok(move |_| transaction_hash)
.map_err(|err| internal_err(format::Geth::pool_error(err)))
.await
Expand All @@ -176,11 +171,7 @@ where
let extrinsic = self.convert_transaction(block_hash, transaction)?;

self.pool
.submit_one(
block_hash,
TransactionSource::Local,
extrinsic,
)
.submit_one(block_hash, TransactionSource::Local, extrinsic)
.map_ok(move |_| transaction_hash)
.map_err(|err| internal_err(format::Geth::pool_error(err)))
.await
Expand Down
16 changes: 8 additions & 8 deletions frame/ethereum/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ mod mock;
#[cfg(all(feature = "std", test))]
mod tests;

pub use catch_exec_info::catch_exec_info;
pub use ethereum::{
AccessListItem, BlockV2 as Block, LegacyTransactionMessage, Log, ReceiptV3 as Receipt,
TransactionAction, TransactionV2 as Transaction,
};
pub use catch_exec_info::catch_exec_info;

use ethereum_types::{Bloom, BloomInput, H160, H256, H64, U256};
use evm::ExitReason;
Expand Down Expand Up @@ -361,13 +361,13 @@ pub mod pallet {
}

impl<T: Config> Pallet<T> {
/// The call wrapped in the extrinsic is part of the PoV, record this as a base cost for the size of the proof.
fn proof_size_base_cost(transaction: &Transaction) -> u64 {
transaction
.encoded_size()
// pallet index + call index
.saturating_add(2) as u64
}
/// The call wrapped in the extrinsic is part of the PoV, record this as a base cost for the size of the proof.
fn proof_size_base_cost(transaction: &Transaction) -> u64 {
transaction
.encoded_size()
// pallet index + call index
.saturating_add(2) as u64
}

pub fn transaction_weight(transaction_data: &TransactionData) -> (Option<Weight>, Option<u64>) {
match <T as pallet_evm::Config>::GasWeightMapping::gas_to_weight(
Expand Down

0 comments on commit 2f74d52

Please sign in to comment.