alloy-rs / core

High-performance, well-tested & documented core libraries for Ethereum, in Rust
https://alloy.rs
Apache License 2.0
763 stars 137 forks source link

[Feature] Implement debug for function calls #721

Closed NicolasWent closed 1 week ago

NicolasWent commented 1 week ago

Component

sol! macro

Describe the feature you would like

Hello,

When I decode some function input, I would like to be able to print debug it to see the parameters. It can be useful to debug our code.

Additional context

Example usage:


if let Ok(decoded) = myCall::abi_decode(&data.input, true) {
    // here is crashed because it doesn't implement Debug
    println!("Decoded: {decoded:?}");
}
DaniPopes commented 1 week ago

You can annotate functions and other items with normal rust attributes that will be applied in the generated code.