Skip to main content

TestableLeaf

Trait TestableLeaf 

Source
pub trait TestableLeaf {
    type NodeType: NodeType;

    // Required method
    fn create_random_transaction(
        &self,
        rng: &mut dyn RngCore,
        padding: u64,
    ) -> <<Self::NodeType as NodeType>::BlockPayload as BlockPayload<Self::NodeType>>::Transaction;
}
Expand description

Additional functions required to use a Leaf with hotshot-testing.

Required Associated Types§

Source

type NodeType: NodeType

Type of nodes participating in the network.

Required Methods§

Source

fn create_random_transaction( &self, rng: &mut dyn RngCore, padding: u64, ) -> <<Self::NodeType as NodeType>::BlockPayload as BlockPayload<Self::NodeType>>::Transaction

Create a transaction that can be added to the block contained in this leaf.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<TYPES: NodeType> TestableLeaf for Leaf2<TYPES>
where TYPES::ValidatedState: TestableState<TYPES>, TYPES::BlockPayload: TestableBlock<TYPES>,

Source§

type NodeType = TYPES

Source§

impl<TYPES: NodeType> TestableLeaf for Leaf<TYPES>
where TYPES::ValidatedState: TestableState<TYPES>, TYPES::BlockPayload: TestableBlock<TYPES>,

Source§

type NodeType = TYPES