Skip to content

Commit

Permalink
test: expose test provider url
Browse files Browse the repository at this point in the history
  • Loading branch information
gakonst committed May 18, 2022
1 parent 96391a0 commit 4c75e4a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions ethers-providers/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -698,13 +698,16 @@ pub mod test_provider {
Self { keys: Mutex::new(keys.iter().cycle()), network: network.to_owned() }
}

pub fn provider(&self) -> Provider<Http> {
let url = format!(
pub fn url(&self) -> String {
format!(
"https://{}.infura.io/v3/{}",
self.network,
self.keys.lock().unwrap().next().unwrap()
);
Provider::try_from(url.as_str()).unwrap()
)
}

pub fn provider(&self) -> Provider<Http> {
Provider::try_from(self.url().as_str()).unwrap()
}

#[cfg(feature = "ws")]
Expand Down

0 comments on commit 4c75e4a

Please sign in to comment.