feat(provider): expose url for http (#1550)

This commit is contained in:
Matthias Seitz 2022-08-02 21:35:28 +02:00 committed by GitHub
parent e2754dee4f
commit 555cbb16e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 0 deletions

View File

@ -1345,6 +1345,18 @@ impl Provider<crate::Ipc> {
}
}
impl Provider<HttpProvider> {
/// The Url to which requests are made
pub fn url(&self) -> &Url {
self.inner.url()
}
/// Mutable access to the Url to which requests are made
pub fn url_mut(&mut self) -> &mut Url {
self.inner.url_mut()
}
}
impl<Read, Write> Provider<RwClient<Read, Write>>
where
Read: JsonRpcClient + 'static,

View File

@ -115,6 +115,16 @@ impl Provider {
Self::new_with_client(url, Client::new())
}
/// The Url to which requests are made
pub fn url(&self) -> &Url {
&self.url
}
/// Mutable access to the Url to which requests are made
pub fn url_mut(&mut self) -> &mut Url {
&mut self.url
}
/// Initializes a new HTTP Client with authentication
///
/// # Example