Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
librelois committed Dec 8, 2023
1 parent 4cff09c commit f5de33c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 17 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
6 changes: 2 additions & 4 deletions frame/ethereum/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -514,8 +514,7 @@ impl<T: Config> Pallet<T> {
.map_err(|e| e.0)?;

use pallet_evm::OnChargeEVMTransaction;
let max_withdraw = check_transaction.max_withdraw_amount()
.map_err(|e| e.0)?;
let max_withdraw = check_transaction.max_withdraw_amount().map_err(|e| e.0)?;
<T as pallet_evm::Config>::OnChargeTransaction::can_withdraw(&origin, max_withdraw)
.map_err(|_| InvalidTransaction::Payment)?;

Expand Down Expand Up @@ -889,8 +888,7 @@ impl<T: Config> Pallet<T> {
.map_err(|e| TransactionValidityError::Invalid(e.0))?;

use pallet_evm::OnChargeEVMTransaction;
let max_withdraw = check_transaction.max_withdraw_amount()
.map_err(|e| e.0)?;
let max_withdraw = check_transaction.max_withdraw_amount().map_err(|e| e.0)?;
<T as pallet_evm::Config>::OnChargeTransaction::can_withdraw(&origin, max_withdraw)
.map_err(|_| InvalidTransaction::Payment)?;

Expand Down
2 changes: 1 addition & 1 deletion primitives/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ sp_api::decl_runtime_apis! {
/// Initialize the pending block.
/// The behavior should be the same as the runtime api Core_initialize_block but
/// for a "pending" block.
/// If your project don't need to have a different behavior to initialize "pending" blocks,
/// If your project don't need to have a different behavior to initialize "pending" blocks,
/// you can copy your Core_initialize_block implementation.
fn initialize_pending_block(header: &<Block as BlockT>::Header);
}
Expand Down

0 comments on commit f5de33c

Please sign in to comment.