#[repr(C)]pub struct Snapshot {
pub seal_merkle_root: [u8; 32],
pub epoch: u64,
pub epoch_hash: [u8; 32],
pub created_at: i64,
pub customer_reward_pool: u64,
pub merchant_reward_pool: u64,
pub customer_participants: u32,
pub merchant_participants: u32,
pub total_customer_activity: u32,
pub total_merchant_activity: u32,
}
Expand description
Snapshot data for the current epoch This is the current equivalent of the HistoricalSnapshot structure
Fields§
§seal_merkle_root: [u8; 32]
The seal merkle root of all historical payment merkle roots This is the root of the incremental seal merkle tree containing all payment roots
epoch: u64
Current epoch number.
epoch_hash: [u8; 32]
Current epoch hash for tamper detection in the Epoch Hash Chain security solution
Epoch 0: hashv(b"MIRACLE_EPOCH_0_EXTREME_WAYS")
Epoch 1+: hashv(previous_epoch_hash + current_epoch_number + current_payment_merkle_root)
Fallback: If previous epoch hash is missing, use genesis hash as fallback
Empty Payment Support: Epoch numbers ensure uniqueness even with identical payment roots
created_at: i64
Timestamp when this epoch was created (oracle updates once per day)
customer_reward_pool: u64
Customer reward pool for this epoch
merchant_reward_pool: u64
Merchant reward pool for this epoch
customer_participants: u32
Total customer participants in this epoch
merchant_participants: u32
Total merchant participants in this epoch
total_customer_activity: u32
Total customer activity in this epoch (for accurate reward calculation)
total_merchant_activity: u32
Total merchant activity in this epoch (for accurate reward calculation)
Implementations§
Trait Implementations§
Source§impl AccountValidation for Snapshot
impl AccountValidation for Snapshot
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>
Source§impl Discriminator for Snapshot
impl Discriminator for Snapshot
fn discriminator() -> u8
impl Copy for Snapshot
impl Pod for Snapshot
impl StructuralPartialEq for Snapshot
Auto Trait Implementations§
impl Freeze for Snapshot
impl RefUnwindSafe for Snapshot
impl Send for Snapshot
impl Sync for Snapshot
impl Unpin for Snapshot
impl UnwindSafe for Snapshot
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>
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
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,
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