lamports= -> .set_lamports() (#16978)

This commit is contained in:
Jeff Washington (jwash) 2021-04-30 13:20:54 -05:00 committed by GitHub
parent ac87bc40ca
commit 0af84bb91e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 4 deletions

View File

@ -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);

View File

@ -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));

View File

@ -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);