solana_sdk/
example_mocks.rs1#![doc(hidden)]
14#![cfg(feature = "full")]
15
16pub mod solana_rpc_client {
17 pub mod rpc_client {
18 use {
19 super::super::solana_rpc_client_api::client_error::Result as ClientResult,
20 crate::{hash::Hash, signature::Signature, transaction::Transaction},
21 };
22
23 pub struct RpcClient;
24
25 impl RpcClient {
26 pub fn new(_url: String) -> Self {
27 RpcClient
28 }
29 pub fn get_latest_blockhash(&self) -> ClientResult<Hash> {
30 Ok(Hash::default())
31 }
32 pub fn send_and_confirm_transaction(
33 &self,
34 _transaction: &Transaction,
35 ) -> ClientResult<Signature> {
36 Ok(Signature::default())
37 }
38 }
39 }
40}
41
42pub mod solana_rpc_client_api {
43 pub mod client_error {
44 use thiserror::Error;
45
46 #[derive(Error, Debug)]
47 #[error("mock-error")]
48 pub struct ClientError;
49 pub type Result<T> = std::result::Result<T, ClientError>;
50 }
51}