diff --git a/programs/stake/src/stake_state.rs b/programs/stake/src/stake_state.rs index 4984c66ba..d193cd527 100644 --- a/programs/stake/src/stake_state.rs +++ b/programs/stake/src/stake_state.rs @@ -3455,7 +3455,10 @@ mod tests { ); } // reset balance - stake_keyed_account.account.borrow_mut().lamports = total_lamports; + stake_keyed_account + .account + .borrow_mut() + .set_lamports(total_lamports); // lockup has expired let to_keyed_account = KeyedAccount::new(&to, false, &to_account); diff --git a/runtime/src/accounts_db.rs b/runtime/src/accounts_db.rs index 7c66dbb7a..861a05d61 100644 --- a/runtime/src/accounts_db.rs +++ b/runtime/src/accounts_db.rs @@ -9965,7 +9965,7 @@ pub mod tests { if exit.load(Ordering::Relaxed) { return; } - account.lamports = slot + 1; + account.set_lamports(slot + 1); db.store_cached(slot, &[(&pubkey, &account)]); db.add_root(slot); sleep(Duration::from_millis(RACY_SLEEP_MS)); diff --git a/runtime/src/rent_collector.rs b/runtime/src/rent_collector.rs index 5d1d8dcd7..8a040b10d 100644 --- a/runtime/src/rent_collector.rs +++ b/runtime/src/rent_collector.rs @@ -173,7 +173,7 @@ mod tests { let mut collected; let pubkey = solana_sdk::pubkey::new_rand(); - account.lamports = huge_lamports; + account.set_lamports(huge_lamports); assert_eq!(account.rent_epoch(), 0); // create a tested rent collector @@ -185,7 +185,7 @@ mod tests { assert_eq!(collected, 0); // decrease the balance not to be rent-exempt - account.lamports = tiny_lamports; + account.set_lamports(tiny_lamports); // ... and trigger another rent collection on the same epoch and check that rent is working collected = rent_collector.collect_from_existing_account(&pubkey, &mut account);