rust-web3 icon indicating copy to clipboard operation
rust-web3 copied to clipboard

InvalidOutputType("Expected single element, got an empty list")

Open sergeyT2 opened this issue 3 years ago • 5 comments

Hey everyone,

referencing this, obiously https://github.com/tomusdrw/rust-web3/issues/115

The contract I'm querying doesn't have explicit return value. Therefore I'm getting an error of InvalidOutputType("Expected single element, got a list: []")

How do I type it correctly? web3::contract::Result of something?

sergeyT2 avatar Jul 04 '22 13:07 sergeyT2

Provide a PR for this: https://github.com/tomusdrw/rust-web3/pull/656

sergeyT2 avatar Jul 06 '22 13:07 sergeyT2

The no-value return type is (), have you tried that?

tomusdrw avatar Jul 06 '22 21:07 tomusdrw

The no-value return type is (), have you tried that?

Yeah, it says trait web3::contract::tokens::Tokenizable not implemented for ()

sergeyT2 avatar Jul 06 '22 21:07 sergeyT2

@tomusdrw anything happening?

sergeyT2 avatar Jul 14 '22 09:07 sergeyT2

Do you mind providing a full example? I don't think parsing an empty value into an empty list as proposed in #656 is the correct behavior.

tomusdrw avatar Jun 02 '23 19:06 tomusdrw