lamports = -> .set_lamports() (#16980)
This commit is contained in:
parent
5e74cede4e
commit
763c04adf3
|
@ -1950,7 +1950,7 @@ mod tests {
|
||||||
&AccountSharedData::new(u64::MAX / 2, 0, &system_program::id()),
|
&AccountSharedData::new(u64::MAX / 2, 0, &system_program::id()),
|
||||||
);
|
);
|
||||||
let mut modified_buffer_account = buffer_account.clone();
|
let mut modified_buffer_account = buffer_account.clone();
|
||||||
modified_buffer_account.lamports = u64::MAX / 2;
|
modified_buffer_account.set_lamports(u64::MAX / 2);
|
||||||
bank.store_account(&buffer_address, &modified_buffer_account);
|
bank.store_account(&buffer_address, &modified_buffer_account);
|
||||||
bank.store_account(&program_keypair.pubkey(), &AccountSharedData::default());
|
bank.store_account(&program_keypair.pubkey(), &AccountSharedData::default());
|
||||||
bank.store_account(&programdata_address, &AccountSharedData::default());
|
bank.store_account(&programdata_address, &AccountSharedData::default());
|
||||||
|
|
|
@ -4364,7 +4364,10 @@ mod tests {
|
||||||
);
|
);
|
||||||
|
|
||||||
// split account already has way enough lamports
|
// split account already has way enough lamports
|
||||||
split_stake_keyed_account.account.borrow_mut().lamports = 10_000_000;
|
split_stake_keyed_account
|
||||||
|
.account
|
||||||
|
.borrow_mut()
|
||||||
|
.set_lamports(10_000_000);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
stake_keyed_account.split(
|
stake_keyed_account.split(
|
||||||
stake_lamports - (rent_exempt_reserve + 1), // leave rent_exempt_reserve + 1 in original account
|
stake_lamports - (rent_exempt_reserve + 1), // leave rent_exempt_reserve + 1 in original account
|
||||||
|
@ -4489,7 +4492,10 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
// reset
|
// reset
|
||||||
stake_keyed_account.account.borrow_mut().lamports = stake_lamports;
|
stake_keyed_account
|
||||||
|
.account
|
||||||
|
.borrow_mut()
|
||||||
|
.set_lamports(stake_lamports);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4899,7 +4905,10 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
// reset
|
// reset
|
||||||
stake_keyed_account.account.borrow_mut().lamports = stake_lamports;
|
stake_keyed_account
|
||||||
|
.account
|
||||||
|
.borrow_mut()
|
||||||
|
.set_lamports(stake_lamports);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7308,7 +7308,7 @@ pub mod tests {
|
||||||
let mut i = 0;
|
let mut i = 0;
|
||||||
loop {
|
loop {
|
||||||
let account_bal = thread_rng().gen_range(1, 99);
|
let account_bal = thread_rng().gen_range(1, 99);
|
||||||
account.lamports = account_bal;
|
account.set_lamports(account_bal);
|
||||||
db.store_uncached(slot, &[(&pubkey, &account)]);
|
db.store_uncached(slot, &[(&pubkey, &account)]);
|
||||||
|
|
||||||
let (account, slot) = db
|
let (account, slot) = db
|
||||||
|
|
|
@ -12135,7 +12135,7 @@ pub(crate) mod tests {
|
||||||
// Modify staked vote account owner; a vote account owned by another program could be
|
// Modify staked vote account owner; a vote account owned by another program could be
|
||||||
// freely modified with malicious data
|
// freely modified with malicious data
|
||||||
let bogus_vote_program = Pubkey::new_unique();
|
let bogus_vote_program = Pubkey::new_unique();
|
||||||
vote_account.lamports = original_lamports;
|
vote_account.set_lamports(original_lamports);
|
||||||
vote_account.set_owner(bogus_vote_program);
|
vote_account.set_owner(bogus_vote_program);
|
||||||
bank.store_account(
|
bank.store_account(
|
||||||
&validator_vote_keypairs0.vote_keypair.pubkey(),
|
&validator_vote_keypairs0.vote_keypair.pubkey(),
|
||||||
|
|
|
@ -108,7 +108,9 @@ fn test_bad_bank_hash() {
|
||||||
existing.insert(idx);
|
existing.insert(idx);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
accounts_keys[idx].1.lamports = thread_rng().gen_range(0, 1000);
|
accounts_keys[idx]
|
||||||
|
.1
|
||||||
|
.set_lamports(thread_rng().gen_range(0, 1000));
|
||||||
});
|
});
|
||||||
|
|
||||||
let account_refs: Vec<_> = existing
|
let account_refs: Vec<_> = existing
|
||||||
|
|
Loading…
Reference in New Issue