#[repr(C)]pub struct RoundV4 {Show 13 fields
pub id: u64,
pub deployed: [u64; 25],
pub mass: [u64; 25],
pub count: [u64; 25],
pub slot_hash: [u8; 32],
pub expires_at: u64,
pub motherlode: u64,
pub rent_payer: Pubkey,
pub rewards: [u64; 25],
pub total_vaulted: u64,
pub total_winnings: u64,
pub total_miners: u64,
pub top_miner: Pubkey,
}Fields§
§id: u64The round number.
deployed: [u64; 25]The amount of SOL deployed in each square. TODO: Rename to sol.
mass: [u64; 25]The amount of mass deployed in each square.
count: [u64; 25]The number of unique miners on each square. TODO rename to miners.
slot_hash: [u8; 32]The entropy value. TODO: Rename to entropy.
expires_at: u64The slot after which this account may be closed. TODO: Rename to closes_at.
motherlode: u64The amount of ORE distributed as the motherlode reward.
rent_payer: PubkeyThe account to which rent should be returned to when this account is closed.
rewards: [u64; 25]The amount of ORE to distribute to miners.
total_vaulted: u64The total SOL collected by the protocol. TODO: Rename to protocol_fee.
total_winnings: u64The total SOL returned to miners. TODO: Rename to total_returned.
total_miners: u64The total number of unique miners that played in the round. TODO rename to unique_miners.
top_miner: PubkeyThe winner of the solo reward. TODO: Rename to winner.
Implementations§
Source§impl RoundV4
impl RoundV4
pub fn pda(&self) -> (Pubkey, u8)
pub fn rng(&self) -> Option<u64>
pub fn winning_square(&self, rng: u64) -> usize
pub fn top_miner_sample(&self, rng: u64, winning_square: usize) -> u64
pub fn calculate_total_winnings(&self, winning_square: usize) -> u64
pub fn is_split_reward(&self, rng: u64) -> bool
pub fn did_hit_motherlode(&self, rng: u64) -> bool
pub fn total_deployed(&self) -> u64
pub fn top_miner_reward(&self) -> u64
Trait Implementations§
Source§impl AccountValidation for RoundV4
impl AccountValidation for RoundV4
fn assert<F>(&self, condition: F) -> Result<&Self, ProgramError>
fn assert_err<F>( &self, condition: F, err: ProgramError, ) -> Result<&Self, ProgramError>
fn assert_msg<F>(&self, condition: F, msg: &str) -> Result<&Self, ProgramError>
fn assert_mut<F>(&mut self, condition: F) -> Result<&mut Self, ProgramError>
fn assert_mut_err<F>( &mut self, condition: F, err: ProgramError, ) -> Result<&mut Self, ProgramError>
fn assert_mut_msg<F>( &mut self, condition: F, msg: &str, ) -> Result<&mut Self, ProgramError>
impl Copy for RoundV4
Source§impl<'de> Deserialize<'de> for RoundV4
impl<'de> Deserialize<'de> for RoundV4
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>,
Source§impl Discriminator for RoundV4
impl Discriminator for RoundV4
fn discriminator() -> u8
impl Pod for RoundV4
impl StructuralPartialEq for RoundV4
Auto Trait Implementations§
impl Freeze for RoundV4
impl RefUnwindSafe for RoundV4
impl Send for RoundV4
impl Sync for RoundV4
impl Unpin for RoundV4
impl UnsafeUnpin for RoundV4
impl UnwindSafe for RoundV4
Blanket Implementations§
Source§impl<T> AccountDeserialize for Twhere
T: Discriminator + Pod,
impl<T> AccountDeserialize for Twhere
T: Discriminator + Pod,
fn try_from_bytes(data: &[u8]) -> Result<&T, ProgramError>
fn try_from_bytes_mut(data: &mut [u8]) -> Result<&mut T, ProgramError>
Source§impl<T> AccountHeaderDeserialize for Twhere
T: Discriminator + Pod,
impl<T> AccountHeaderDeserialize for Twhere
T: Discriminator + Pod,
fn try_header_from_bytes(data: &[u8]) -> Result<(&T, &[u8]), ProgramError>
fn try_header_from_bytes_mut( data: &mut [u8], ) -> Result<(&mut T, &mut [u8]), ProgramError>
impl<T> AnyBitPattern for Twhere
T: Pod,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self.Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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>
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>
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