Skip to content

Commit

Permalink
wip, clippy on client/evm-tracing, box topic
Browse files Browse the repository at this point in the history
  • Loading branch information
neutrinoks committed Aug 23, 2023
1 parent da40ec1 commit ef987be
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion client/evm-tracing/src/formatters/blockscout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl super::ResponseFormatter for Formatter {
fn format(listener: Listener) -> Option<TransactionTrace> {
if let Some(entry) = listener.entries.last() {
return Some(TransactionTrace::CallList(
entry.iter().map(|(_, value)| Call::Blockscout(value.clone())).collect(),
entry.iter().map(|(_, &value)| Call::Blockscout(Box::new(value))).collect(),
))
}
None
Expand Down
6 changes: 3 additions & 3 deletions client/evm-tracing/src/formatters/call_tracer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl super::ResponseFormatter for Formatter {
let gas = it.gas;
let gas_used = it.gas_used;
let inner = it.inner.clone();
Call::CallTracer(CallTracerCall {
Call::CallTracer(Box::new(CallTracerCall {
from,
gas,
gas_used,
Expand Down Expand Up @@ -98,7 +98,7 @@ impl super::ResponseFormatter for Formatter {
},
},
calls: Vec::new(),
})
}))
})
.collect();
// Geth's `callTracer` expects a tree of nested calls and we have a stack.
Expand Down Expand Up @@ -201,7 +201,7 @@ impl super::ResponseFormatter for Formatter {
}
}
// Remove `trace_address` from result.
if let Some(Call::CallTracer(CallTracerCall { trace_address, .. })) = result.get_mut(0)
if let Some(Call::CallTracer(Box::new(CallTracerCall { trace_address, .. }))) = result.get_mut(0)
{
*trace_address = None;
}
Expand Down
4 changes: 2 additions & 2 deletions client/evm-tracing/src/types/single.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ use sp_std::{collections::btree_map::BTreeMap, vec::Vec};
#[derive(Clone, Eq, PartialEq, Debug, Encode, Decode, Serialize)]
#[serde(rename_all = "camelCase", untagged)]
pub enum Call {
Blockscout(crate::formatters::blockscout::BlockscoutCall),
CallTracer(crate::formatters::call_tracer::CallTracerCall),
Blockscout(Box<crate::formatters::blockscout::BlockscoutCall>),
CallTracer(Box<crate::formatters::call_tracer::CallTracerCall>),
}

#[derive(Clone, Copy, Eq, PartialEq, Debug, Encode, Decode)]
Expand Down

0 comments on commit ef987be

Please sign in to comment.