Skip to content

Commit

Permalink
style: make fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
0xbillw committed Jan 21, 2025
1 parent 2a79c30 commit e87b04e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions client/rpc/src/eth/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -978,8 +978,8 @@ pub fn error_on_execution_failure(reason: &ExitReason, data: &[u8]) -> RpcResult
// A minimum size of error function selector (4) + offset (32) + string length (32)
// should contain a utf-8 encoded revert reason.
if data.len() > MESSAGE_START {
let message_len =
U256::from_big_endian(&data[LEN_START..MESSAGE_START]).saturated_into::<usize>();
let message_len = U256::from_big_endian(&data[LEN_START..MESSAGE_START])
.saturated_into::<usize>();
let message_end = MESSAGE_START.saturating_add(message_len);

if data.len() >= message_end {
Expand Down
5 changes: 3 additions & 2 deletions frame/ethereum/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -632,8 +632,9 @@ impl<T: Config> Pallet<T> {
let data = info.value;
let data_len = data.len();
if data_len > MESSAGE_START {
let message_len = U256::from_big_endian(&data[LEN_START..MESSAGE_START])
.saturated_into::<usize>();
let message_len =
U256::from_big_endian(&data[LEN_START..MESSAGE_START])
.saturated_into::<usize>();
let message_end = MESSAGE_START.saturating_add(
message_len.min(T::ExtraDataLength::get() as usize),
);
Expand Down
4 changes: 2 additions & 2 deletions frame/evm/precompile/dispatch/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ where
let info = call.get_dispatch_info();

if let Some(gas) = target_gas {
let valid_weight =
info.total_weight().ref_time() <= T::GasWeightMapping::gas_to_weight(gas, false).ref_time();
let valid_weight = info.total_weight().ref_time()
<= T::GasWeightMapping::gas_to_weight(gas, false).ref_time();
if !valid_weight {
return Err(PrecompileFailure::Error {
exit_status: ExitError::OutOfGas,
Expand Down
9 changes: 6 additions & 3 deletions frame/evm/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,8 @@ mod proof_size_test {
let expected_proof_size = ((read_account_metadata * 2)
+ reading_contract_len
+ reading_main_contract_len
+ is_empty_check + increase_nonce) as u64;
+ is_empty_check
+ increase_nonce) as u64;

let actual_proof_size = result
.weight_info
Expand Down Expand Up @@ -295,7 +296,8 @@ mod proof_size_test {
let expected_proof_size = (basic_account_size
+ read_account_metadata
+ reading_main_contract_len
+ is_empty_check + increase_nonce) as u64;
+ is_empty_check
+ increase_nonce) as u64;

let actual_proof_size = result
.weight_info
Expand Down Expand Up @@ -520,7 +522,8 @@ mod proof_size_test {
let expected_proof_size = ((read_account_metadata * 2)
+ reading_callee_contract_len
+ reading_main_contract_len
+ is_empty_check + increase_nonce) as u64;
+ is_empty_check
+ increase_nonce) as u64;

let actual_proof_size = result
.weight_info
Expand Down

0 comments on commit e87b04e

Please # to comment.