Struct snarkvm_ledger_coinbase::ProverSolution
source · pub struct ProverSolution<N: Network> { /* private fields */ }
Expand description
The prover solution for the coinbase puzzle from a prover.
Implementations§
source§impl<N: Network> ProverSolution<N>
impl<N: Network> ProverSolution<N>
sourcepub const fn new(
partial_solution: PartialSolution<N>,
proof: PuzzleProof<N>
) -> Self
pub const fn new( partial_solution: PartialSolution<N>, proof: PuzzleProof<N> ) -> Self
Initializes a new instance of the prover solution.
sourcepub fn verify(
&self,
verifying_key: &CoinbaseVerifyingKey<N>,
epoch_challenge: &EpochChallenge<N>,
proof_target: u64
) -> Result<bool>
pub fn verify( &self, verifying_key: &CoinbaseVerifyingKey<N>, epoch_challenge: &EpochChallenge<N>, proof_target: u64 ) -> Result<bool>
Returns true
if the prover solution is valid.
sourcepub const fn commitment(&self) -> PuzzleCommitment<N>
pub const fn commitment(&self) -> PuzzleCommitment<N>
Returns the commitment for the solution.
sourcepub const fn proof(&self) -> &PuzzleProof<N>
pub const fn proof(&self) -> &PuzzleProof<N>
Returns the proof for the solution.
sourcepub fn to_prover_polynomial(
&self,
epoch_challenge: &EpochChallenge<N>
) -> Result<DensePolynomial<<N::PairingCurve as PairingEngine>::Fr>>
pub fn to_prover_polynomial( &self, epoch_challenge: &EpochChallenge<N> ) -> Result<DensePolynomial<<N::PairingCurve as PairingEngine>::Fr>>
Returns the prover polynomial.
Trait Implementations§
source§impl<N: Clone + Network> Clone for ProverSolution<N>
impl<N: Clone + Network> Clone for ProverSolution<N>
source§fn clone(&self) -> ProverSolution<N>
fn clone(&self) -> ProverSolution<N>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<N: Network> Debug for ProverSolution<N>
impl<N: Network> Debug for ProverSolution<N>
source§impl<'de, N: Network> Deserialize<'de> for ProverSolution<N>
impl<'de, N: Network> Deserialize<'de> for ProverSolution<N>
source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserializes the prover solution from a JSON-string or buffer.
source§impl<N: Network> Display for ProverSolution<N>
impl<N: Network> Display for ProverSolution<N>
source§impl<N: Network> FromBytes for ProverSolution<N>
impl<N: Network> FromBytes for ProverSolution<N>
source§impl<N: Network> FromStr for ProverSolution<N>
impl<N: Network> FromStr for ProverSolution<N>
source§impl<N: Hash + Network> Hash for ProverSolution<N>
impl<N: Hash + Network> Hash for ProverSolution<N>
source§impl<N: PartialEq + Network> PartialEq for ProverSolution<N>
impl<N: PartialEq + Network> PartialEq for ProverSolution<N>
source§fn eq(&self, other: &ProverSolution<N>) -> bool
fn eq(&self, other: &ProverSolution<N>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<N: Network> Serialize for ProverSolution<N>
impl<N: Network> Serialize for ProverSolution<N>
source§impl<N: Network> ToBytes for ProverSolution<N>
impl<N: Network> ToBytes for ProverSolution<N>
impl<N: Copy + Network> Copy for ProverSolution<N>
impl<N: Eq + Network> Eq for ProverSolution<N>
impl<N: Network> StructuralEq for ProverSolution<N>
impl<N: Network> StructuralPartialEq for ProverSolution<N>
Auto Trait Implementations§
impl<N> RefUnwindSafe for ProverSolution<N>where <N as Environment>::Field: RefUnwindSafe, <<N as Environment>::PairingCurve as PairingEngine>::G1Affine: RefUnwindSafe, <N as Environment>::Projective: RefUnwindSafe,
impl<N> Send for ProverSolution<N>
impl<N> Sync for ProverSolution<N>
impl<N> Unpin for ProverSolution<N>where <N as Environment>::Field: Unpin, <<N as Environment>::PairingCurve as PairingEngine>::G1Affine: Unpin, <N as Environment>::Projective: Unpin,
impl<N> UnwindSafe for ProverSolution<N>where <N as Environment>::Field: UnwindSafe, <<N as Environment>::PairingCurve as PairingEngine>::G1Affine: UnwindSafe, <N as Environment>::Projective: UnwindSafe,
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
source§impl<'de, T> DeserializeExt<'de> for Twhere
T: DeserializeOwned,
impl<'de, T> DeserializeExt<'de> for Twhere T: DeserializeOwned,
fn take_from_value<D>( value: &mut Value, field: &str ) -> Result<T, <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.