Open peter-jim opened 2 years ago
I believe that the current implementation runs only in async.
One way you could run it in blocking code is e.g. using the futures
crate: https://docs.rs/futures/latest/futures/executor/fn.block_on.html
or even better, with the exactly the same function exported by web3:
https://docs.rs/web3/latest/web3/fn.block_on.html
I want to try not use #[tokio::main] in my project . it show error follow this.
{unknown} no method named
push
found for structCallFuture
in the current scope method not found inCallFuture<Vec<H160>, Pin<Box<dyn std::future::Future<Output = Result<serde_json::value::Value, web3::Error>> + std::marker::Send>>>
rustcE0599my code is
let mut accounts = web3.eth().accounts(); accounts.push(hex!("0x5940C8F24c1c6ee04e0F7E1f44546d71859Cc3b7").into());
Is there a way I can run successfully without # [tokio::main] and async?