ethabi icon indicating copy to clipboard operation
ethabi copied to clipboard

Function Deprecated `constant` field

Open r0wdiggity opened this issue 3 years ago • 1 comments

warning: use of deprecated field `ethabi::Function::constant`: The constant attribute was removed in Solidity 0.5.0 and has been replaced with stateMutability.
    |
    |         constant: None,
    |         ^^^^^^^^^^^^^^
    |
    = note: `#[warn(deprecated)]` on by default

the constant field has been marked deprecated in favor of state_mutability for the Function struct. However, the field is still required to instantiate the struct, so we have to use it.

r0wdiggity avatar Sep 28 '22 02:09 r0wdiggity

Hmm, that is annoying... For now, you could #[allow(deprecated)], but I agree that the development ergonomics around this is not great.

I think the correct solution would be to remove it for the Function struct, but allow it at de-serialization time (converting it to the appropirate state_mutability value).

nlordell avatar Oct 17 '22 15:10 nlordell