Skip to content

Commit

Permalink
suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
siosw committed Feb 9, 2025
1 parent acc8dfe commit c35e754
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions crates/rpc/rpc/src/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ use alloy_rpc_types_trace::geth::{
};
use async_trait::async_trait;
use jsonrpsee::core::RpcResult;
use reth_chainspec::EthChainSpec;
use reth_chainspec::EthereumHardforks;
use reth_chainspec::{EthChainSpec, EthereumHardforks};
use reth_evm::{
env::EvmEnv,
execute::{BlockExecutorProvider, Executor},
Expand Down Expand Up @@ -295,7 +294,7 @@ where
Ok(inspector)
})
.await?;
return Ok(FourByteFrame::from(&inspector).into());
return Ok(FourByteFrame::from(&inspector).into())
}
GethDebugBuiltInTracerType::CallTracer => {
let call_config = tracer_config
Expand All @@ -318,7 +317,7 @@ where
Ok(frame.into())
})
.await?;
return Ok(frame);
return Ok(frame)
}
GethDebugBuiltInTracerType::PreStateTracer => {
let prestate_config = tracer_config
Expand Down Expand Up @@ -349,7 +348,7 @@ where
Ok(frame)
})
.await?;
return Ok(frame.into());
return Ok(frame.into())
}
GethDebugBuiltInTracerType::NoopTracer => Ok(NoopFrame::default().into()),
GethDebugBuiltInTracerType::MuxTracer => {
Expand Down Expand Up @@ -392,7 +391,7 @@ where
Ok(frame.into())
})
.await?;
return Ok(frame);
return Ok(frame)
}
GethDebugBuiltInTracerType::FlatCallTracer => {
let flat_call_config = tracer_config
Expand All @@ -418,7 +417,7 @@ where
})
.await?;

return Ok(frame.into());
return Ok(frame.into())
}
},
#[cfg(not(feature = "js-tracer"))]
Expand Down Expand Up @@ -494,7 +493,7 @@ where
opts: Option<GethDebugTracingCallOptions>,
) -> Result<Vec<Vec<GethTrace>>, Eth::Error> {
if bundles.is_empty() {
return Err(EthApiError::InvalidParams(String::from("bundles are empty.")).into());
return Err(EthApiError::InvalidParams(String::from("bundles are empty.")).into())
}

let StateContext { transaction_index, block_number } = state_context.unwrap_or_default();
Expand Down Expand Up @@ -727,7 +726,7 @@ where
.geth_builder()
.geth_call_traces(call_config, res.result.gas_used());

return Ok((frame.into(), res.state));
return Ok((frame.into(), res.state))
}
GethDebugBuiltInTracerType::PreStateTracer => {
let prestate_config = tracer_config
Expand All @@ -749,7 +748,7 @@ where
.geth_prestate_traces(&res, &prestate_config, db)
.map_err(Eth::Error::from_eth_err)?;

return Ok((frame.into(), res.state));
return Ok((frame.into(), res.state))
}
GethDebugBuiltInTracerType::NoopTracer => {
Ok((NoopFrame::default().into(), Default::default()))
Expand All @@ -768,7 +767,7 @@ where
let frame = inspector
.try_into_mux_frame(&res, db, tx_info)
.map_err(Eth::Error::from_eth_err)?;
return Ok((frame.into(), res.state));
return Ok((frame.into(), res.state))
}
GethDebugBuiltInTracerType::FlatCallTracer => {
let flat_call_config = tracer_config
Expand Down Expand Up @@ -817,7 +816,7 @@ where
inspector.json_result(res, &env, db).map_err(Eth::Error::from_eth_err)?;
Ok((GethTrace::JS(result), state))
}
};
}
}

// default structlog tracer
Expand Down Expand Up @@ -1038,7 +1037,7 @@ where
}

async fn debug_chain_config(&self) -> RpcResult<ChainConfig> {
Ok(self.provider().chain_spec().genesis().clone().config)
Ok(self.provider().chain_spec().genesis().config.clone())
}

async fn debug_chaindb_property(&self, _property: String) -> RpcResult<()> {
Expand Down

0 comments on commit c35e754

Please sign in to comment.