Skip to content

Commit

Permalink
Add RpcClient constructor with timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
t-nelson authored and mergify[bot] committed Jul 23, 2020
1 parent 8b1b392 commit bece8cf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion client/src/rpc_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ impl RpcClient {
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 {
Self::new_sender(MockSender::new(url))
}
Expand All @@ -66,7 +70,7 @@ impl RpcClient {

pub fn new_socket_with_timeout(addr: SocketAddr, timeout: Duration) -> Self {
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> {
Expand Down

0 comments on commit bece8cf

Please sign in to comment.