[−][src]Trait grin_core::pow::PoWContext
Generic trait for a solver/verifier providing common interface into Cuckoo-family PoW Mostly used for verification, but also for test mining if necessary
Required Methods
fn new(
edge_bits: u8,
proof_size: usize,
max_sols: u32
) -> Result<Box<Self>, Error>
edge_bits: u8,
proof_size: usize,
max_sols: u32
) -> Result<Box<Self>, Error>
Create new instance of context with appropriate parameters
fn set_header_nonce(
&mut self,
header: Vec<u8>,
nonce: Option<u32>,
solve: bool
) -> Result<(), Error>
&mut self,
header: Vec<u8>,
nonce: Option<u32>,
solve: bool
) -> Result<(), Error>
Sets the header along with an optional nonce at the end solve: whether to set up structures for a solve (true) or just validate (false)
fn find_cycles(&mut self) -> Result<Vec<Proof>, Error>
find solutions using the stored parameters and header
fn verify(&self, proof: &Proof) -> Result<(), Error>
Verify a solution with the stored parameters
Implementors
impl<T> PoWContext<T> for CuckatooContext<T> where
T: EdgeType,
[src]
impl<T> PoWContext<T> for CuckatooContext<T> where
T: EdgeType,
fn new(
edge_bits: u8,
proof_size: usize,
max_sols: u32
) -> Result<Box<Self>, Error>
[src]
fn new(
edge_bits: u8,
proof_size: usize,
max_sols: u32
) -> Result<Box<Self>, Error>
fn set_header_nonce(
&mut self,
header: Vec<u8>,
nonce: Option<u32>,
solve: bool
) -> Result<(), Error>
[src]
fn set_header_nonce(
&mut self,
header: Vec<u8>,
nonce: Option<u32>,
solve: bool
) -> Result<(), Error>
fn find_cycles(&mut self) -> Result<Vec<Proof>, Error>
[src]
fn find_cycles(&mut self) -> Result<Vec<Proof>, Error>
fn verify(&self, proof: &Proof) -> Result<(), Error>
[src]
fn verify(&self, proof: &Proof) -> Result<(), Error>
impl<T> PoWContext<T> for CuckooContext<T> where
T: EdgeType,
[src]
impl<T> PoWContext<T> for CuckooContext<T> where
T: EdgeType,
fn new(
edge_bits: u8,
proof_size: usize,
max_sols: u32
) -> Result<Box<Self>, Error>
[src]
fn new(
edge_bits: u8,
proof_size: usize,
max_sols: u32
) -> Result<Box<Self>, Error>
fn set_header_nonce(
&mut self,
header: Vec<u8>,
nonce: Option<u32>,
solve: bool
) -> Result<(), Error>
[src]
fn set_header_nonce(
&mut self,
header: Vec<u8>,
nonce: Option<u32>,
solve: bool
) -> Result<(), Error>
fn find_cycles(&mut self) -> Result<Vec<Proof>, Error>
[src]
fn find_cycles(&mut self) -> Result<Vec<Proof>, Error>
fn verify(&self, proof: &Proof) -> Result<(), Error>
[src]
fn verify(&self, proof: &Proof) -> Result<(), Error>