tomusdrw / rust-web3

Ethereum JSON-RPC multi-transport client. Rust implementation of web3 library. ENS address: rust-web3.eth
MIT License
1.45k stars 465 forks source link

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

Open sergeyT2 opened 2 years ago

sergeyT2 commented 2 years ago

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 commented 2 years ago

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

tomusdrw commented 2 years ago

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

sergeyT2 commented 2 years ago

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

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

sergeyT2 commented 2 years ago

@tomusdrw anything happening?

tomusdrw commented 1 year ago

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.