Struct grin_core::pow::cuckatoo::CuckatooContext
source · pub struct CuckatooContext { /* private fields */ }
Expand description
Cuckatoo solver context
Implementations§
source§impl CuckatooContext
impl CuckatooContext
sourcepub fn new_impl(
edge_bits: u8,
proof_size: usize,
max_sols: u32
) -> Result<CuckatooContext, Error>
pub fn new_impl( edge_bits: u8, proof_size: usize, max_sols: u32 ) -> Result<CuckatooContext, Error>
New Solver context
sourcepub fn sipkey_hex(&self, index: usize) -> Result<String, Error>
pub fn sipkey_hex(&self, index: usize) -> Result<String, Error>
Get a siphash key as a hex string (for display convenience)
sourcepub fn byte_count(&self) -> Result<u64, Error>
pub fn byte_count(&self) -> Result<u64, Error>
Return number of bytes used by the graph
sourcepub fn set_header_nonce_impl(
&mut self,
header: Vec<u8>,
nonce: Option<u32>,
solve: bool
) -> Result<(), Error>
pub fn set_header_nonce_impl( &mut self, header: Vec<u8>, nonce: Option<u32>, solve: bool ) -> Result<(), Error>
Set the header and optional nonce in the last part of the header
Trait Implementations§
source§impl PoWContext for CuckatooContext
impl PoWContext for CuckatooContext
source§fn set_header_nonce(
&mut self,
header: Vec<u8>,
nonce: Option<u32>,
solve: bool
) -> Result<(), Error>
fn set_header_nonce( &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)
Auto Trait Implementations§
impl Freeze for CuckatooContext
impl RefUnwindSafe for CuckatooContext
impl Send for CuckatooContext
impl Sync for CuckatooContext
impl Unpin for CuckatooContext
impl UnwindSafe for CuckatooContext
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