Skip to content

Commit

Permalink
support failed create traces
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcgroul committed Dec 12, 2023
1 parent c634513 commit 6d6d56f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/firehose.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,16 +504,20 @@ impl TryFrom<Trace> for pbcodec::Call {
match value.r#type {
TraceType::Create => {
let action = value.action.context("no action")?;
let result = value.result.context("no result")?;
let result = value.result.unwrap_or(TraceResult {
gas_used: None,
address: None,
output: None,
});
let gas = action.gas.context("no gas")?;
let gas_used = result.gas_used.context("no gas_used")?;
let gas_used = result.gas_used.unwrap_or("0x0".to_string());

Ok(pbcodec::Call {
call_type: 5,
caller: try_decode_hex("trace from", &action.from.context("no from")?)?,
address: try_decode_hex(
"trace address",
&result.address.context("no address")?,
&result.address.unwrap_or("0x0000000000000000000000000000000000000000".to_string())
)?,
value: action
.value
Expand Down

0 comments on commit 6d6d56f

Please sign in to comment.