solana-rpc-client 2.3.7
Legitimate Solana RPC client
“Solana RPC Client”
Contains an unbounded block loopRust test marker or harness
SHA-25640231712d6f1e5833ff1e101954786cbd0b5301098ea42384f7bb3e553085852
MaleculeH₂(Cm₂Os)Md(Pa)
Evidence
1:5… Nonblocking [`RpcSender`] over HTTP.
2
3use {
4 crate::rpc_sender::*,
5 async_trait::async_trait,
6 log::*,
7 reqwest::{
8 self,
9 header::{self, CONTENT_TYPE, RETRY_AFTER},
10 StatusCode,
11 },
12 solana_rpc_client_api::{
13 client_error::Result,
14 custom_error,
15 error_object::RpcErrorObject,
16 request::{RpcError, RpcRequest, RpcResponseErrorData},
17 response::RpcSimulateTransactionResult,
18 },
19 std::{
20 sync::{
21 atomic::{AtomicU64, Ordering},
22 Arc, RwLock,
23 },
24 time::{Duration, Instant},
25 },
26 tokio::time::sleep,
27};
28
⋯4 lines
38:4… /// Create an HTTP RPC sender.
39 ///
40 /// The URL is an HTTP URL, usually for port 8899, as in
41 /// "http://localhost:8899". The sender has a default timeout of 30 seconds.
42 pub fn new<U: ToString>(url: U) -> Self {
43 Self::new_with_timeout(url, Duration::from_secs(30))
⋯5 lines
49:75… f {
50 Self::new_with_client(
51 url,
52 reqwest::Client::builder()
53 .default_headers(Self::default_headers())
54 .timeout(timeout)
55 .pool_idle_timeout( …
145:72… s).to_string();
146
147 let mut too_many_requests_retries = 5;
148 loop {
149 let response = {
150 let client = self.client.clone();
151 let request_json = request_json. …
232 fn url(&self) -> String {
233 self.url.clone()
234 }
235}
236
237#[cfg(test)]
238mod tests {
239 use super::*;
240
241 #[tokio::test(flavor = "multi_thread")]
242 async fn http_sender_on_tokio_multi_thread() {
243 let http_sender = HttpSender::new("http://localhost:1234".to_string( …
No evidence locations were recorded for this file. Raw result