Struct subspace_core_primitives::Solution
source · pub struct Solution<PublicKey, RewardAddress> {
pub public_key: PublicKey,
pub reward_address: RewardAddress,
pub sector_index: SectorIndex,
pub history_size: HistorySize,
pub piece_offset: PieceOffset,
pub record_commitment: RecordCommitment,
pub record_witness: RecordWitness,
pub chunk: Scalar,
pub chunk_witness: ChunkWitness,
pub proof_of_space: PosProof,
}
Expand description
Farmer solution for slot challenge.
Fields§
§public_key: PublicKey
Public key of the farmer that created the solution
reward_address: RewardAddress
Address for receiving block reward
sector_index: SectorIndex
Index of the sector where solution was found
history_size: HistorySize
Size of the blockchain history at time of sector creation
piece_offset: PieceOffset
Pieces offset within sector
record_commitment: RecordCommitment
Record commitment that can use used to verify that piece was included in blockchain history
record_witness: RecordWitness
Witness for above record commitment
chunk: Scalar
Chunk at above offset
chunk_witness: ChunkWitness
Witness for above chunk
proof_of_space: PosProof
Proof of space for piece offset
Implementations§
source§impl<PublicKey, RewardAddressA> Solution<PublicKey, RewardAddressA>
impl<PublicKey, RewardAddressA> Solution<PublicKey, RewardAddressA>
sourcepub fn into_reward_address_format<T, RewardAddressB>(
self,
) -> Solution<PublicKey, RewardAddressB>
pub fn into_reward_address_format<T, RewardAddressB>( self, ) -> Solution<PublicKey, RewardAddressB>
Transform solution with one reward address type into solution with another compatible reward address type.
source§impl<PublicKey, RewardAddress> Solution<PublicKey, RewardAddress>
impl<PublicKey, RewardAddress> Solution<PublicKey, RewardAddress>
sourcepub fn genesis_solution(
public_key: PublicKey,
reward_address: RewardAddress,
) -> Self
pub fn genesis_solution( public_key: PublicKey, reward_address: RewardAddress, ) -> Self
Dummy solution for the genesis block
Trait Implementations§
source§impl<PublicKey, RewardAddress> Decode for Solution<PublicKey, RewardAddress>where
PublicKey: Decode,
RewardAddress: Decode,
impl<PublicKey, RewardAddress> Decode for Solution<PublicKey, RewardAddress>where
PublicKey: Decode,
RewardAddress: Decode,
source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy,
) -> Result<Self, Error>
fn decode<__CodecInputEdqy: Input>( __codec_input_edqy: &mut __CodecInputEdqy, ) -> Result<Self, Error>
Attempt to deserialise the value from input.
§fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
I: Input,
fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
I: Input,
Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
§fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
Attempt to skip the encoded value from input. Read more
§fn encoded_fixed_size() -> Option<usize>
fn encoded_fixed_size() -> Option<usize>
Returns the fixed encoded size of the type. Read more
source§impl<'de, PublicKey, RewardAddress> Deserialize<'de> for Solution<PublicKey, RewardAddress>where
PublicKey: Deserialize<'de>,
RewardAddress: Deserialize<'de>,
impl<'de, PublicKey, RewardAddress> Deserialize<'de> for Solution<PublicKey, RewardAddress>where
PublicKey: Deserialize<'de>,
RewardAddress: Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<PublicKey, RewardAddress> Encode for Solution<PublicKey, RewardAddress>where
PublicKey: Encode,
RewardAddress: Encode,
impl<PublicKey, RewardAddress> Encode for Solution<PublicKey, RewardAddress>where
PublicKey: Encode,
RewardAddress: Encode,
source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
If possible give a hint of expected size of the encoding. Read more
source§fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy,
)
fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy, )
Convert self to a slice and append it to the destination.
§fn using_encoded<R, F>(&self, f: F) -> R
fn using_encoded<R, F>(&self, f: F) -> R
Convert self to a slice and then invoke the given closure with it.
§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Calculates the encoded size. Read more
source§impl<PublicKey: PartialEq, RewardAddress: PartialEq> PartialEq for Solution<PublicKey, RewardAddress>
impl<PublicKey: PartialEq, RewardAddress: PartialEq> PartialEq for Solution<PublicKey, RewardAddress>
source§impl<PublicKey, RewardAddress> TypeInfo for Solution<PublicKey, RewardAddress>where
PublicKey: TypeInfo + 'static,
RewardAddress: TypeInfo + 'static,
impl<PublicKey, RewardAddress> TypeInfo for Solution<PublicKey, RewardAddress>where
PublicKey: TypeInfo + 'static,
RewardAddress: TypeInfo + 'static,
impl<PublicKey, RewardAddress> EncodeLike for Solution<PublicKey, RewardAddress>where
PublicKey: Encode,
RewardAddress: Encode,
impl<PublicKey: Eq, RewardAddress: Eq> Eq for Solution<PublicKey, RewardAddress>
impl<PublicKey, RewardAddress> StructuralPartialEq for Solution<PublicKey, RewardAddress>
Auto Trait Implementations§
impl<PublicKey, RewardAddress> Freeze for Solution<PublicKey, RewardAddress>
impl<PublicKey, RewardAddress> RefUnwindSafe for Solution<PublicKey, RewardAddress>where
PublicKey: RefUnwindSafe,
RewardAddress: RefUnwindSafe,
impl<PublicKey, RewardAddress> Send for Solution<PublicKey, RewardAddress>
impl<PublicKey, RewardAddress> Sync for Solution<PublicKey, RewardAddress>
impl<PublicKey, RewardAddress> Unpin for Solution<PublicKey, RewardAddress>
impl<PublicKey, RewardAddress> UnwindSafe for Solution<PublicKey, RewardAddress>where
PublicKey: UnwindSafe,
RewardAddress: 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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> DecodeAll for Twhere
T: Decode,
impl<T> DecodeAll for Twhere
T: Decode,
§fn decode_all(input: &mut &[u8]) -> Result<T, Error>
fn decode_all(input: &mut &[u8]) -> Result<T, Error>
Decode
Self
and consume all of the given input data. Read more§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere
T: Decode,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> KeyedVec for Twhere
T: Codec,
impl<T> KeyedVec for Twhere
T: Codec,
§fn to_keyed_vec(&self, prepend_key: &[u8]) -> Vec<u8>
fn to_keyed_vec(&self, prepend_key: &[u8]) -> Vec<u8>
Return an encoding of
Self
prepended by given slice.