Ensures STORE_META_OVERHEAD remains accurate (#35053)

This commit is contained in:
Brooks 2024-02-02 13:00:54 -05:00 committed by GitHub
parent 97d994ee6f
commit 4b528e890c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 0 deletions

View File

@ -44,6 +44,14 @@ pub mod test_utils;
/// we need to add data len and align it to get the actual stored size
pub const STORE_META_OVERHEAD: usize = 136;
// Ensure the STORE_META_OVERHEAD constant remains accurate
const _: () = assert!(
STORE_META_OVERHEAD
== mem::size_of::<StoredMeta>()
+ mem::size_of::<AccountMeta>()
+ mem::size_of::<AccountHash>()
);
/// Returns the size this item will take to store plus possible alignment padding bytes before the next entry.
/// fixed-size portion of per-account data written
/// plus 'data_len', aligned to next boundary