Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extract rpc-sender crate from rpc-client #2147

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@ solana-rent = { path = "sdk/rent", version = "=2.2.0", default-features = false
solana-rent-debits = { path = "sdk/rent-debits", version = "=2.2.0" }
solana-reserved-account-keys = { path = "sdk/reserved-account-keys", version = "=2.2.0", default-features = false }
solana-reward-info = { path = "sdk/reward-info", version = "=2.2.0" }
solana-rpc-sender = { path = "rpc-sender", version = "=2.2.0" }
solana-sanitize = { path = "sdk/sanitize", version = "=2.2.0" }
solana-secp256r1-program = { path = "sdk/secp256r1-program", version = "=2.2.0", default-features = false }
solana-seed-derivable = { path = "sdk/seed-derivable", version = "=2.2.0" }
Expand Down
1 change: 1 addition & 0 deletions client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ solana-quic-definitions = { workspace = true }
solana-rpc-client = { workspace = true, features = ["default"] }
solana-rpc-client-api = { workspace = true }
solana-rpc-client-nonce-utils = { workspace = true }
solana-rpc-sender = { workspace = true }
solana-signature = { workspace = true }
solana-signer = { workspace = true }
solana-streamer = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ pub mod rpc_response {
}
/// A transport for RPC calls.
pub mod rpc_sender {
pub use solana_rpc_client::rpc_sender::*;
pub use solana_rpc_sender::*;
}
11 changes: 11 additions & 0 deletions programs/sbf/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions rpc-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ solana-instruction = { workspace = true }
solana-message = { workspace = true }
solana-pubkey = { workspace = true }
solana-rpc-client-api = { workspace = true }
solana-rpc-sender = { workspace = true }
solana-signature = { workspace = true }
solana-transaction = { workspace = true, features = ["bincode"] }
solana-transaction-error = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion rpc-client/src/http_sender.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! Nonblocking [`RpcSender`] over HTTP.
use {
crate::rpc_sender::*,
async_trait::async_trait,
log::*,
reqwest::{
Expand All @@ -16,6 +15,7 @@ use {
request::{RpcError, RpcRequest, RpcResponseErrorData},
response::RpcSimulateTransactionResult,
},
solana_rpc_sender::*,
std::{
sync::{
atomic::{AtomicU64, Ordering},
Expand Down
3 changes: 2 additions & 1 deletion rpc-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ pub mod http_sender;
pub mod mock_sender;
pub mod nonblocking;
pub mod rpc_client;
pub mod rpc_sender;
pub mod spinner;
#[deprecated(since = "2.2.0", note = "Use `solana-rpc-sender` crate instead.")]
pub use solana_rpc_sender as rpc_sender;

pub mod mock_sender_for_cli {
/// Magic `SIGNATURE` value used by `solana-cli` unit tests.
Expand Down
2 changes: 1 addition & 1 deletion rpc-client/src/mock_sender.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! A nonblocking [`RpcSender`] used for unit testing [`RpcClient`](crate::rpc_client::RpcClient).

use {
crate::rpc_sender::*,
async_trait::async_trait,
base64::{prelude::BASE64_STANDARD, Engine},
serde_json::{json, Number, Value},
Expand All @@ -25,6 +24,7 @@ use {
RpcVoteAccountStatus,
},
},
solana_rpc_sender::*,
solana_signature::Signature,
solana_transaction::{versioned::TransactionVersion, Transaction},
solana_transaction_error::{TransactionError, TransactionResult},
Expand Down
2 changes: 1 addition & 1 deletion rpc-client/src/nonblocking/rpc_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ use {
GetConfirmedSignaturesForAddress2Config, RpcClientConfig, SerializableMessage,
SerializableTransaction,
},
rpc_sender::*,
},
base64::{prelude::BASE64_STANDARD, Engine},
bincode::serialize,
Expand All @@ -42,6 +41,7 @@ use {
request::{RpcError, RpcRequest, RpcResponseErrorData, TokenAccountsFilter},
response::*,
},
solana_rpc_sender::*,
solana_signature::Signature,
solana_transaction_error::TransactionResult,
solana_transaction_status_client_types::{
Expand Down
2 changes: 1 addition & 1 deletion rpc-client/src/rpc_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ use {
http_sender::HttpSender,
mock_sender::{mock_encoded_account, MockSender},
nonblocking::{self, rpc_client::get_rpc_request_str},
rpc_sender::*,
},
serde::Serialize,
serde_json::Value,
Expand All @@ -35,6 +34,7 @@ use {
request::{RpcRequest, TokenAccountsFilter},
response::*,
},
solana_rpc_sender::*,
solana_signature::Signature,
solana_transaction::{uses_durable_nonce, versioned::VersionedTransaction, Transaction},
solana_transaction_error::TransactionResult,
Expand Down
18 changes: 18 additions & 0 deletions rpc-sender/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[package]
name = "solana-rpc-sender"
description = "Solana RpcSender trait"
documentation = "https://docs.rs/solana-rpc-sender"
version = { workspace = true }
authors = { workspace = true }
repository = { workspace = true }
homepage = { workspace = true }
license = { workspace = true }
edition = { workspace = true }

[dependencies]
async-trait = { workspace = true }
serde_json = { workspace = true }
solana-rpc-client-api = { workspace = true }

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
2 changes: 1 addition & 1 deletion rpc-client/src/rpc_sender.rs → rpc-sender/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub struct RpcTransportStats {
/// `RpcSender` implements the underlying transport of requests to, and
/// responses from, a Solana node, and is used primarily by [`RpcClient`].
///
/// [`RpcClient`]: crate::rpc_client::RpcClient
/// [`RpcClient`]: https://docs.rs/solana-rpc-client/latest/solana_rpc_client/rpc_client/struct.RpcClient.html
#[async_trait]
pub trait RpcSender {
async fn send(
Expand Down
11 changes: 11 additions & 0 deletions svm/examples/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading