From 6498cb421441918cb8631398b960044f3a81f1fe Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Mon, 1 Jun 2020 21:44:07 -0700 Subject: [PATCH] Remove some unused RpcClient and ThinClient methods --- client/src/rpc_client.rs | 32 +------------------------------- client/src/thin_client.rs | 37 ------------------------------------- 2 files changed, 1 insertion(+), 68 deletions(-) diff --git a/client/src/rpc_client.rs b/client/src/rpc_client.rs index 26ae8a6109..f2470ad103 100644 --- a/client/src/rpc_client.rs +++ b/client/src/rpc_client.rs @@ -655,7 +655,7 @@ impl RpcClient { Ok(hash) } - pub fn poll_balance_with_timeout_and_commitment( + fn poll_balance_with_timeout_and_commitment( &self, pubkey: &Pubkey, polling_frequency: &Duration, @@ -750,36 +750,6 @@ impl RpcClient { Ok(()) } - /// Check a signature in the bank. - pub fn check_signature(&self, signature: &Signature) -> bool { - trace!("check_signature: {:?}", signature); - - for _ in 0..30 { - let response = - self.confirm_transaction_with_commitment(signature, CommitmentConfig::recent()); - match response { - Ok(Response { - value: signature_status, - .. - }) => { - if signature_status { - trace!("Response found signature"); - } else { - trace!("Response signature not found"); - } - - return signature_status; - } - Err(err) => { - debug!("check_signature request failed: {:?}", err); - } - }; - sleep(Duration::from_millis(250)); - } - - panic!("Couldn't check signature of {}", signature); - } - /// Poll the server to confirm a transaction. pub fn poll_for_signature_confirmation( &self, diff --git a/client/src/thin_client.rs b/client/src/thin_client.rs index 036eef1d75..48d1db9708 100644 --- a/client/src/thin_client.rs +++ b/client/src/thin_client.rs @@ -254,37 +254,6 @@ impl ThinClient { .into()) } - pub fn poll_balance_with_timeout_and_commitment( - &self, - pubkey: &Pubkey, - polling_frequency: &Duration, - timeout: &Duration, - commitment_config: CommitmentConfig, - ) -> TransportResult { - self.rpc_client() - .poll_balance_with_timeout_and_commitment( - pubkey, - polling_frequency, - timeout, - commitment_config, - ) - .map_err(|e| e.into()) - } - - pub fn poll_balance_with_timeout( - &self, - pubkey: &Pubkey, - polling_frequency: &Duration, - timeout: &Duration, - ) -> TransportResult { - self.poll_balance_with_timeout_and_commitment( - pubkey, - polling_frequency, - timeout, - CommitmentConfig::default(), - ) - } - pub fn poll_get_balance(&self, pubkey: &Pubkey) -> TransportResult { self.poll_get_balance_with_commitment(pubkey, CommitmentConfig::default()) } @@ -330,12 +299,6 @@ impl ThinClient { .map_err(|e| e.into()) } - /// Check a signature in the bank. This method blocks - /// until the server sends a response. - pub fn check_signature(&self, signature: &Signature) -> bool { - self.rpc_client().check_signature(signature) - } - pub fn validator_exit(&self) -> TransportResult { self.rpc_client().validator_exit().map_err(|e| e.into()) }