chore: fix typo in provider readme

supersedes https://github.com/gakonst/ethers-rs/pull/1203
This commit is contained in:
Georgios Konstantopoulos 2022-05-02 22:47:42 +03:00
parent b0d33a7486
commit f5de81e783
1 changed files with 3 additions and 1 deletions

View File

@ -10,6 +10,7 @@ For more documentation on the available calls, refer to the
# Examples
```no_run
use ethers_core::types::Address;
use ethers_providers::{Provider, Http, Middleware};
use std::convert::TryFrom;
@ -21,7 +22,8 @@ let provider = Provider::<Http>::try_from(
let block = provider.get_block(100u64).await?;
println!("Got block: {}", serde_json::to_string(&block)?);
let code = provider.get_code("0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359", None).await?;
let addr = "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359".parse::<Address>()?;
let code = provider.get_code(addr, None).await?;
println!("Got code: {}", serde_json::to_string(&code)?);
# Ok(())
# }