Struct solana_test_validator::TestValidator
source · pub struct TestValidator { /* private fields */ }
Implementations§
source§impl TestValidator
impl TestValidator
sourcepub fn with_no_fees(
mint_address: Pubkey,
faucet_addr: Option<SocketAddr>,
socket_addr_space: SocketAddrSpace
) -> Self
pub fn with_no_fees( mint_address: Pubkey, faucet_addr: Option<SocketAddr>, socket_addr_space: SocketAddrSpace ) -> Self
Create and start a TestValidator
with no transaction fees and minimal rent.
Faucet optional.
This function panics on initialization failure.
sourcepub fn with_no_fees_udp(
mint_address: Pubkey,
faucet_addr: Option<SocketAddr>,
socket_addr_space: SocketAddrSpace
) -> Self
pub fn with_no_fees_udp( mint_address: Pubkey, faucet_addr: Option<SocketAddr>, socket_addr_space: SocketAddrSpace ) -> Self
Create a test validator using udp for TPU.
sourcepub fn with_custom_fees(
mint_address: Pubkey,
target_lamports_per_signature: u64,
faucet_addr: Option<SocketAddr>,
socket_addr_space: SocketAddrSpace
) -> Self
pub fn with_custom_fees( mint_address: Pubkey, target_lamports_per_signature: u64, faucet_addr: Option<SocketAddr>, socket_addr_space: SocketAddrSpace ) -> Self
Create and start a TestValidator
with custom transaction fees and minimal rent.
Faucet optional.
This function panics on initialization failure.
sourcepub fn set_startup_verification_complete_for_tests(&self)
pub fn set_startup_verification_complete_for_tests(&self)
allow tests to indicate that validator has completed initialization
sourcepub fn tpu(&self) -> &SocketAddr
pub fn tpu(&self) -> &SocketAddr
Return the validator’s TPU address
sourcepub fn gossip(&self) -> &SocketAddr
pub fn gossip(&self) -> &SocketAddr
Return the validator’s Gossip address
sourcepub fn rpc_pubsub_url(&self) -> String
pub fn rpc_pubsub_url(&self) -> String
Return the validator’s JSON RPC PubSub URL
sourcepub fn vote_account_address(&self) -> Pubkey
pub fn vote_account_address(&self) -> Pubkey
Return the validator’s vote account address
sourcepub fn rpc_client(&self) -> (RpcClient, Hash, FeeCalculator)
👎Deprecated since 1.9.0: Please use get_rpc_client
instead
pub fn rpc_client(&self) -> (RpcClient, Hash, FeeCalculator)
get_rpc_client
insteadReturn an RpcClient for the validator. As a convenience, also return a recent blockhash and associated fee calculator
sourcepub fn get_rpc_client(&self) -> RpcClient
pub fn get_rpc_client(&self) -> RpcClient
Return an RpcClient for the validator.
sourcepub fn get_async_rpc_client(&self) -> RpcClient
pub fn get_async_rpc_client(&self) -> RpcClient
Return a nonblocking RpcClient for the validator.
pub fn join(self)
pub fn cluster_info(&self) -> Arc<ClusterInfo>
pub fn bank_forks(&self) -> Arc<RwLock<BankForks>>
pub fn repair_whitelist(&self) -> Arc<RwLock<HashSet<Pubkey>>>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for TestValidator
impl !RefUnwindSafe for TestValidator
impl Send for TestValidator
impl Sync for TestValidator
impl Unpin for TestValidator
impl !UnwindSafe for TestValidator
Blanket Implementations§
source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request