Skip to content

Commit

Permalink
add back pops
Browse files Browse the repository at this point in the history
  • Loading branch information
0xkrane committed Sep 24, 2024
1 parent 0f899c3 commit ecbf99b
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions crates/rpc/rpc/src/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ where
) -> Result<Vec<TraceResult>, Eth::Error> {
if transactions.is_empty() {
// nothing to trace
return Ok(Vec::new())
return Ok(Vec::new());
}

// replay all transactions of the block
Expand Down Expand Up @@ -310,7 +310,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 @@ -333,7 +333,7 @@ where
Ok(frame.into())
})
.await?;
return Ok(frame)
return Ok(frame);
}
GethDebugBuiltInTracerType::PreStateTracer => {
let prestate_config = tracer_config
Expand Down Expand Up @@ -361,7 +361,7 @@ where
Ok(frame)
})
.await?;
return Ok(frame.into())
return Ok(frame.into());
}
GethDebugBuiltInTracerType::NoopTracer => Ok(NoopFrame::default().into()),
GethDebugBuiltInTracerType::MuxTracer => {
Expand All @@ -388,7 +388,7 @@ where
Ok(frame.into())
})
.await?;
return Ok(frame)
return Ok(frame);
}
GethDebugBuiltInTracerType::FlatCallTracer => {
let flat_call_config = tracer_config
Expand All @@ -409,7 +409,9 @@ where
let frame = inspector
.with_transaction_gas_limit(env.tx.gas_limit)
.into_parity_builder()
.into_localized_transaction_traces(tx_info);
.into_localized_transaction_traces(tx_info)
.pop()
.unwrap();
Ok(frame)
})
.await?;
Expand Down Expand Up @@ -446,7 +448,7 @@ where

Ok(GethTrace::JS(res))
}
}
};
}

// default structlog tracer
Expand Down Expand Up @@ -482,7 +484,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 @@ -724,7 +726,7 @@ where
GethDebugBuiltInTracerType::FourByteTracer => {
let mut inspector = FourByteInspector::default();
let (res, _) = self.eth_api().inspect(db, env, &mut inspector)?;
return Ok((FourByteFrame::from(&inspector).into(), res.state))
return Ok((FourByteFrame::from(&inspector).into(), res.state));
}
GethDebugBuiltInTracerType::CallTracer => {
let call_config = tracer_config
Expand All @@ -742,7 +744,7 @@ where
.into_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 @@ -760,7 +762,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 @@ -777,7 +779,7 @@ where
let frame = inspector
.try_into_mux_frame(&res, db)
.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 @@ -827,7 +829,9 @@ where
let frame: FlatCallFrame = inspector
.with_transaction_gas_limit(env.tx.gas_limit)
.into_parity_builder()
.into_localized_transaction_traces(tx_info);
.into_localized_transaction_traces(tx_info)
.pop()
.unwrap();

return Ok((frame.into(), res.state));
}
Expand All @@ -853,7 +857,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

0 comments on commit ecbf99b

Please sign in to comment.