Use static memory layout for all sysvars (#249)

Co-authored-by: Richard Patel <ripatel@jumptrading.com>
This commit is contained in:
ripatel-fd 2024-03-15 21:59:41 +01:00 committed by GitHub
parent 4425dbea91
commit fb01ab28ec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 0 deletions

View File

@ -7,6 +7,8 @@
//! [`sysvar::epoch_rewards`]: crate::sysvar::epoch_rewards
use std::ops::AddAssign;
#[repr(C)]
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Default, Clone, Copy, AbiExample)]
pub struct EpochRewards {
/// total rewards for the current epoch, in lamports

View File

@ -6,6 +6,7 @@ use {
log::*,
};
#[repr(C)]
#[derive(Serialize, Deserialize, Default, PartialEq, Eq, Clone, Copy, Debug, AbiExample)]
#[serde(rename_all = "camelCase")]
pub struct FeeCalculator {

View File

@ -11,6 +11,7 @@ use std::ops::Deref;
pub const MAX_ENTRIES: usize = 512; // it should never take as many as 512 epochs to warm up or cool down
#[repr(C)]
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Default, Clone, AbiExample)]
pub struct StakeHistoryEntry {
pub effective: u64, // effective stake at this epoch