Struct loki::sender::AdversaryFragmentSender
source · pub struct AdversaryFragmentSender<'a, S: SyncNode + Send> {
block0_hash: Hash,
fees: LinearFee,
setup: AdversaryFragmentSenderSetup<'a, S>,
expiry_generator: BlockDateGenerator,
}
Fields§
§block0_hash: Hash
§fees: LinearFee
§setup: AdversaryFragmentSenderSetup<'a, S>
§expiry_generator: BlockDateGenerator
Implementations§
source§impl<'a, S: SyncNode + Send> AdversaryFragmentSender<'a, S>
impl<'a, S: SyncNode + Send> AdversaryFragmentSender<'a, S>
pub fn try_from_jormungandr( process: &JormungandrProcess, block0: BlockDate, setup: AdversaryFragmentSenderSetup<'a, S> ) -> Result<Self, RestError>
source§impl<'a, S: SyncNode + Send> AdversaryFragmentSender<'a, S>
impl<'a, S: SyncNode + Send> AdversaryFragmentSender<'a, S>
pub fn from_settings( settings: SettingsDto, block0: BlockDate, setup: AdversaryFragmentSenderSetup<'a, S> ) -> Self
source§impl<'a, S: SyncNode + Send> AdversaryFragmentSender<'a, S>
impl<'a, S: SyncNode + Send> AdversaryFragmentSender<'a, S>
pub fn new( block0_hash: Hash, fees: LinearFee, expiry_generator: BlockDateGenerator, setup: AdversaryFragmentSenderSetup<'a, S> ) -> Self
pub fn block0_hash(&self) -> Hash
pub fn fees(&self) -> LinearFee
pub fn send_random_faulty_transaction<A: FragmentNode + SyncNode + Sized + Send>( &self, from: &mut Wallet, to: &Wallet, via: &A ) -> Result<MemPoolCheck, AdversaryFragmentSenderError>
fn random_faulty_transaction(&self, from: &Wallet, to: &Wallet) -> Fragment
pub fn send_transactions_with_invalid_counter<A: FragmentNode + SyncNode + Sized + Send>( &self, n: usize, from: &mut Wallet, to: &Wallet, via: &A ) -> Result<Vec<MemPoolCheck>, AdversaryFragmentSenderError>
pub fn send_all_faulty_transactions<A: FragmentNode + SyncNode + Sized + Send>( &self, from: &mut Wallet, to: &Wallet, via: &A ) -> Result<Vec<MemPoolCheck>, AdversaryFragmentSenderError>
pub fn send_faulty_full_delegation<A: FragmentNode + SyncNode + Sized + Send>( &self, valid_until: BlockDate, from: &mut Wallet, to: PoolId, via: &A ) -> Result<MemPoolCheck, AdversaryFragmentSenderError>
fn random_faulty_cert( &self, from: &Wallet, valid_until: BlockDate, cert: Certificate ) -> Result<Fragment, FragmentBuilderError>
pub fn send_faulty_transactions<A: FragmentNode + SyncNode + Sized + Send>( &self, n: u32, wallet1: &mut Wallet, wallet2: &Wallet, node: &A ) -> Result<Vec<MemPoolCheck>, AdversaryFragmentSenderError>
pub fn send_faulty_transactions_with_iteration_delay<A: FragmentNode + SyncNode + Sized + Send>( &self, n: u32, wallet1: &mut Wallet, wallet2: &Wallet, node: &A, duration: Duration ) -> Result<Vec<MemPoolCheck>, AdversaryFragmentSenderError>
fn verify<A: FragmentNode + SyncNode + Sized + Send>( &self, check: &MemPoolCheck, node: &A ) -> Result<(), AdversaryFragmentSenderError>
fn dump_fragment_if_enabled( &self, sender: &Wallet, fragment: &Fragment, via: &dyn FragmentNode ) -> Result<(), AdversaryFragmentSenderError>
pub fn send_fragment<A: FragmentNode + SyncNode + Sized + Send>( &self, fragment: Fragment, node: &A ) -> Result<MemPoolCheck, AdversaryFragmentSenderError>
fn wait_for_node_sync_if_enabled<A: FragmentNode + SyncNode + Sized + Send>( &self, node: &A ) -> Result<(), SyncNodeError>
Trait Implementations§
Auto Trait Implementations§
impl<'a, S> RefUnwindSafe for AdversaryFragmentSender<'a, S>where S: RefUnwindSafe,
impl<'a, S> Send for AdversaryFragmentSender<'a, S>where S: Sync,
impl<'a, S> Sync for AdversaryFragmentSender<'a, S>where S: Sync,
impl<'a, S> Unpin for AdversaryFragmentSender<'a, S>
impl<'a, S> UnwindSafe for AdversaryFragmentSender<'a, S>where S: RefUnwindSafe,
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Wrap the input message
T
in a tonic::Request