From 4c75e4ae191bf713006e1b3e8b41dfa273d7c26e Mon Sep 17 00:00:00 2001 From: Georgios Konstantopoulos Date: Wed, 18 May 2022 13:40:56 -0700 Subject: [PATCH] test: expose test provider url --- ethers-providers/src/lib.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ethers-providers/src/lib.rs b/ethers-providers/src/lib.rs index 010eaab9..9b7afed0 100644 --- a/ethers-providers/src/lib.rs +++ b/ethers-providers/src/lib.rs @@ -698,13 +698,16 @@ pub mod test_provider { Self { keys: Mutex::new(keys.iter().cycle()), network: network.to_owned() } } - pub fn provider(&self) -> Provider { - 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 { + Provider::try_from(self.url().as_str()).unwrap() } #[cfg(feature = "ws")]