Skip to main content

TestBridge

Struct TestBridge 

Source
pub struct TestBridge<M>
where M: Copy,
{ /* private fields */ }

Implementations§

Source§

impl<M> TestBridge<M>
where M: Copy,

Source

pub fn new(worker_count: usize, worker_req_cap: usize) -> Self

Source

pub fn tx_count(&self) -> usize

Source

pub fn contains_tx(&self, key: TransactionKey) -> bool

Source

pub fn queue_progress(&mut self, progress: ProgressMessage)

Source

pub fn queue_tpu(&mut self, tx: &VersionedTransaction)

Source

pub fn queue_check_response_ok( &mut self, batch: &ScheduleBatch<Vec<KeyedTransactionMeta<M>>>, index: usize, keys: Option<Vec<Pubkey>>, )

Source

pub fn queue_check_response( &mut self, batch: &ScheduleBatch<Vec<KeyedTransactionMeta<M>>>, index: usize, keys: Option<Vec<Pubkey>>, response: CheckResponse, )

Source

pub fn queue_all_checks_ok(&mut self)

Source

pub fn queue_execute_response( &mut self, batch: &ScheduleBatch<Vec<KeyedTransactionMeta<M>>>, index: usize, response: ExecutionResponse, )

Source

pub fn queue_unprocessed_response( &mut self, batch: &ScheduleBatch<Vec<KeyedTransactionMeta<M>>>, index: usize, )

Source

pub fn pop_schedule( &mut self, ) -> Option<ScheduleBatch<Vec<KeyedTransactionMeta<M>>>>

Source

pub fn check_ok(&self) -> CheckResponse

Source

pub fn execute_ok(&self) -> ExecutionResponse

Source

pub fn execute_err(&self, reason: u8) -> ExecutionResponse

Methods from Deref<Target = SchedulerBindingsBridge<M>>§

Source

pub fn allocator(&self) -> &Allocator

Source

pub fn state(&self) -> &SlotMap<TransactionKey, TransactionState>

Source

pub fn runtime(&self) -> &RuntimeState

Source

pub fn progress(&self) -> &ProgressMessage

Source

pub fn worker_count(&self) -> usize

Source

pub fn worker(&mut self, id: usize) -> &mut SchedulerWorker

Looks up the given worker by ID.

§Panics
  • If the worker does not exist.
Source

pub fn transaction(&self, key: TransactionKey) -> &TransactionState

Looks up the given transaction key.

§Panics
  • If the transaction does not exist.
Source

pub fn insert_transaction( &mut self, tx: &[u8], ) -> Result<TransactionKey, TransactionInsertError>

Inserts a non TPU transaction into the bridge.

§Panics
  • If the transaction exceeds 4096 bytes.
Source

pub fn drop_transaction(&mut self, key: TransactionKey)

Source

pub fn drain_progress(&mut self) -> Option<ProgressMessage>

Source

pub fn tpu_len(&mut self) -> usize

Source

pub fn drain_tpu( &mut self, callback: impl FnMut(&mut Self, TransactionKey) -> TxDecision, max_count: usize, ) -> usize

Source

pub fn drain_worker( &mut self, worker: usize, callback: impl FnMut(&mut Self, WorkerResponse<'_, M>) -> TxDecision, max_count: usize, )

Source

pub fn schedule( &mut self, _: ScheduleBatch<&[KeyedTransactionMeta<M>]>, ) -> Result<(), ScheduleError>

Builds & schedules the provided batch.

§Panics
  • If the worker index does not exist.
  • If any transaction in the batch does not exist.
  • If the batch size exceeds MAX_TRANSACTIONS_PER_MESSAGE.

Trait Implementations§

Source§

impl<M> Deref for TestBridge<M>
where M: Copy,

Source§

type Target = SchedulerBindingsBridge<M>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<M> DerefMut for TestBridge<M>
where M: Copy,

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V