perf(lez)!: borrow account data in the guests instead of cloning

BREAKING CHANGE: six guest image ids move.
This commit is contained in:
moudyellaz
2026-08-16 23:41:00 +02:00
parent c3a40b299f
commit 073c9baa2d
8 changed files with 23 additions and 25 deletions
@@ -63,10 +63,10 @@ fn main() {
// Check the clock account is the system clock account
assert_eq!(clock_pre.account_id, CLOCK_01_PROGRAM_ACCOUNT_ID);
let clock_data = ClockAccountData::from_bytes(&clock_pre.account.data.clone().into_inner());
let clock_data = ClockAccountData::from_bytes(&clock_pre.account.data);
let current_timestamp = clock_data.timestamp;
let pinata_state = PinataState::from_bytes(&pinata.account.data.clone().into_inner());
let pinata_state = PinataState::from_bytes(&pinata.account.data);
// Enforce cooldown: the elapsed time since the last claim must exceed the cooldown period.
let elapsed = current_timestamp.saturating_sub(pinata_state.last_claim_timestamp);
@@ -34,7 +34,7 @@ fn main() {
assert_eq!(clock_pre.account_id, CLOCK_01_PROGRAM_ACCOUNT_ID);
// Read the current timestamp from the clock account.
let clock_data = ClockAccountData::from_bytes(&clock_pre.account.data.clone().into_inner());
let clock_data = ClockAccountData::from_bytes(&clock_pre.account.data);
assert!(
clock_data.timestamp >= deadline,