snarkvm_ledger_puzzle

Trait PuzzleTrait

Source
pub trait PuzzleTrait<N: Network>: Send + Sync {
    // Required methods
    fn new() -> Self
       where Self: Sized;
    fn to_leaves(
        &self,
        epoch_hash: N::BlockHash,
        rng: &mut ChaChaRng,
    ) -> Result<Vec<Vec<bool>>>;
    fn to_all_leaves(
        &self,
        epoch_hash: N::BlockHash,
        rngs: Vec<ChaChaRng>,
    ) -> Result<Vec<Vec<Vec<bool>>>>;
}
Expand description

The puzzle trait.

Required Methods§

Source

fn new() -> Self
where Self: Sized,

Initializes a new instance of the puzzle.

Source

fn to_leaves( &self, epoch_hash: N::BlockHash, rng: &mut ChaChaRng, ) -> Result<Vec<Vec<bool>>>

Returns the leaves for the puzzle, given the epoch hash and seeded RNG.

Source

fn to_all_leaves( &self, epoch_hash: N::BlockHash, rngs: Vec<ChaChaRng>, ) -> Result<Vec<Vec<Vec<bool>>>>

Returns the batches of leaves for the puzzle, given the epoch hash and seeded RNGs.

Implementors§