Struct resource_proof::ResourceProof
[−]
[src]
pub struct ResourceProof { /* fields omitted */ }
Holds the prover requirements
Methods
impl ResourceProof
[src]
fn new(min_size: usize, difficulty: u8) -> ResourceProof
Rounds will factor how large the message to send is. It also has a slight impact on the hash power required, but this is minimal.
fn create_proof(&self, data: &mut VecDeque<u8>) -> u64
Requires the proof datato be passed in.
fn create_proof_data(&self, nonce: &[u8]) -> VecDeque<u8>
Create the proof data.
fn validate_all(&self,
nonce: &[u8],
received_data: &VecDeque<u8>,
claim: u64)
-> bool
nonce: &[u8],
received_data: &VecDeque<u8>,
claim: u64)
-> bool
validate the data and proof claim (this is the number of zeros to be pushed onto the data)
fn validate_data(&self, nonce: &[u8], data: &VecDeque<u8>) -> bool
Validate the data only. Useful to confirm the
fn validate_proof(&self, nonce: &[u8], claim: u64) -> bool
Validate the proof claim only.