Trait hotshot::traits::TestableNodeImplementation
pub trait TestableNodeImplementation<TYPES>: NodeImplementation<TYPES>where
TYPES: NodeType,{
// Required methods
fn state_create_random_transaction(
state: Option<&<TYPES as NodeType>::ValidatedState>,
rng: &mut dyn RngCore,
padding: u64
) -> <<TYPES as NodeType>::BlockPayload as BlockPayload<TYPES>>::Transaction;
fn leaf_create_random_transaction(
leaf: &Leaf<TYPES>,
rng: &mut dyn RngCore,
padding: u64
) -> <<TYPES as NodeType>::BlockPayload as BlockPayload<TYPES>>::Transaction;
fn block_genesis() -> <TYPES as NodeType>::BlockPayload;
fn txn_count(block: &<TYPES as NodeType>::BlockPayload) -> u64;
fn gen_networks(
expected_node_count: usize,
num_bootstrap: usize,
da_committee_size: usize,
reliability_config: Option<Box<dyn NetworkReliability>>,
secondary_network_delay: Duration
) -> Pin<Box<dyn Fn(u64) -> Pin<Box<dyn Future<Output = Arc<Self::Network>>>>>>;
}
Expand description
extra functions required on a node implementation to be usable by hotshot-testing
Required Methods§
fn state_create_random_transaction(
state: Option<&<TYPES as NodeType>::ValidatedState>,
rng: &mut dyn RngCore,
padding: u64
) -> <<TYPES as NodeType>::BlockPayload as BlockPayload<TYPES>>::Transaction
fn state_create_random_transaction( state: Option<&<TYPES as NodeType>::ValidatedState>, rng: &mut dyn RngCore, padding: u64 ) -> <<TYPES as NodeType>::BlockPayload as BlockPayload<TYPES>>::Transaction
Creates random transaction if possible
otherwise panics
padding
is the bytes of padding to add to the transaction
fn leaf_create_random_transaction(
leaf: &Leaf<TYPES>,
rng: &mut dyn RngCore,
padding: u64
) -> <<TYPES as NodeType>::BlockPayload as BlockPayload<TYPES>>::Transaction
fn leaf_create_random_transaction( leaf: &Leaf<TYPES>, rng: &mut dyn RngCore, padding: u64 ) -> <<TYPES as NodeType>::BlockPayload as BlockPayload<TYPES>>::Transaction
Creates random transaction if possible
otherwise panics
padding
is the bytes of padding to add to the transaction
fn block_genesis() -> <TYPES as NodeType>::BlockPayload
fn block_genesis() -> <TYPES as NodeType>::BlockPayload
generate a genesis block
fn gen_networks(
expected_node_count: usize,
num_bootstrap: usize,
da_committee_size: usize,
reliability_config: Option<Box<dyn NetworkReliability>>,
secondary_network_delay: Duration
) -> Pin<Box<dyn Fn(u64) -> Pin<Box<dyn Future<Output = Arc<Self::Network>>>>>>
fn gen_networks( expected_node_count: usize, num_bootstrap: usize, da_committee_size: usize, reliability_config: Option<Box<dyn NetworkReliability>>, secondary_network_delay: Duration ) -> Pin<Box<dyn Fn(u64) -> Pin<Box<dyn Future<Output = Arc<Self::Network>>>>>>
Generate the communication channels for testing
Object Safety§
This trait is not object safe.