diff --git a/client/src/rpc_request.rs b/client/src/rpc_request.rs index f1518258e7..94af49a766 100644 --- a/client/src/rpc_request.rs +++ b/client/src/rpc_request.rs @@ -53,14 +53,14 @@ impl RpcClient { Ok(res) } - pub fn get_account_data(&self, pubkey: &Pubkey) -> io::Result>> { + pub fn get_account_data(&self, pubkey: &Pubkey) -> io::Result> { let params = json!([format!("{}", pubkey)]); let response = self.make_rpc_request(RpcRequest::GetAccountInfo, Some(params)); match response { Ok(account_json) => { let account: Account = serde_json::from_value(account_json).expect("deserialize account"); - Ok(Some(account.data)) + Ok(account.data) } Err(error) => { debug!("get_account_data failed: {:?}", error); diff --git a/client/src/thin_client.rs b/client/src/thin_client.rs index 74a657db1c..9b39b6e46c 100644 --- a/client/src/thin_client.rs +++ b/client/src/thin_client.rs @@ -133,7 +133,7 @@ impl ThinClient { result } - pub fn get_account_data(&self, pubkey: &Pubkey) -> io::Result>> { + pub fn get_account_data(&self, pubkey: &Pubkey) -> io::Result> { self.rpc_client.get_account_data(pubkey) } diff --git a/core/src/local_cluster.rs b/core/src/local_cluster.rs index 6d03f67a16..6c97ad3009 100644 --- a/core/src/local_cluster.rs +++ b/core/src/local_cluster.rs @@ -251,7 +251,7 @@ impl LocalCluster { info!("Checking for vote account registration"); let vote_account_user_data = client.get_account_data(&vote_account_pubkey); - if let Ok(Some(vote_account_user_data)) = vote_account_user_data { + if let Ok(vote_account_user_data) = vote_account_user_data { if let Ok(vote_state) = VoteState::deserialize(&vote_account_user_data) { if vote_state.delegate_id == delegate_id { return Ok(()); diff --git a/tests/thin_client.rs b/tests/thin_client.rs index aa87303eb3..0404d17d36 100644 --- a/tests/thin_client.rs +++ b/tests/thin_client.rs @@ -114,8 +114,7 @@ fn test_register_vote_account() { for run in 0..=LAST { let account_user_data = client .get_account_data(&vote_account_id) - .expect("Expected valid response for account data") - .expect("Expected valid account data to exist after account creation"); + .expect("Expected valid response for account data"); let vote_state = VoteState::deserialize(&account_user_data);