Skip to content

Commit ecc8075

Browse files
authored
chain/ethereum: Include contract address and block number in ABI decode error messages
Add contract address and block number context to ABI decode error messages to help debugging. Fixes #3404
1 parent e1cd469 commit ecc8075

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

chain/ethereum/src/data_source.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -857,8 +857,10 @@ impl DataSource {
857857
.abi_decode_input(&call.input.0[4..])
858858
.with_context(|| {
859859
format!(
860-
"Generating function inputs for the call {:?} failed, raw input: {}",
860+
"Generating function inputs for the call {:?} failed, contract: {:#x}, block: {}, raw input: 0x{}",
861861
&function_abi,
862+
call.to,
863+
call.block_number,
862864
hex::encode(&call.input.0)
863865
)
864866
}) {
@@ -889,8 +891,11 @@ impl DataSource {
889891
.abi_decode_output(&call.output.0)
890892
.with_context(|| {
891893
format!(
892-
"Decoding function outputs for the call {:?} failed, raw output: {}",
894+
"Decoding function outputs for the call {:?} failed, contract: {:#x}, block: {}, input: 0x{}, raw output: 0x{}",
893895
&function_abi,
896+
call.to,
897+
call.block_number,
898+
hex::encode(&call.input.0),
894899
hex::encode(&call.output.0)
895900
)
896901
})?;

0 commit comments

Comments
 (0)