Add RpcClient constructor with timeout
This commit is contained in:
parent
8b1b392be9
commit
bece8cfbc2
|
@ -52,6 +52,10 @@ impl RpcClient {
|
||||||
Self::new_sender(HttpSender::new(url))
|
Self::new_sender(HttpSender::new(url))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn new_with_timeout(url: String, timeout: Duration) -> Self {
|
||||||
|
Self::new_sender(HttpSender::new_with_timeout(url, timeout))
|
||||||
|
}
|
||||||
|
|
||||||
pub fn new_mock(url: String) -> Self {
|
pub fn new_mock(url: String) -> Self {
|
||||||
Self::new_sender(MockSender::new(url))
|
Self::new_sender(MockSender::new(url))
|
||||||
}
|
}
|
||||||
|
@ -66,7 +70,7 @@ impl RpcClient {
|
||||||
|
|
||||||
pub fn new_socket_with_timeout(addr: SocketAddr, timeout: Duration) -> Self {
|
pub fn new_socket_with_timeout(addr: SocketAddr, timeout: Duration) -> Self {
|
||||||
let url = get_rpc_request_str(addr, false);
|
let url = get_rpc_request_str(addr, false);
|
||||||
Self::new_sender(HttpSender::new_with_timeout(url, timeout))
|
Self::new_with_timeout(url, timeout)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn confirm_transaction(&self, signature: &Signature) -> ClientResult<bool> {
|
pub fn confirm_transaction(&self, signature: &Signature) -> ClientResult<bool> {
|
||||||
|
|
Loading…
Reference in New Issue