alloy-rs / core

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

[Feature] Implement debug for function calls #721

Closed NicolasWent closed 2 months ago

NicolasWent commented 2 months 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 2 months ago

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