* Simplify account.rent_epoch handling for sysvar rent (#16049)
* Add some code for special local testing
* Add comment to store_account_and_update_capitalization
* Simplify account.rent_epoch handling for sysvar rent
* Introduce *_for_test functions
* Add deprecation messages to existing api
(cherry picked from commit 6d5c6c17c5
)
# Conflicts:
# sdk/src/native_loader.rs
* Fix conflicts
Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
This commit is contained in:
@@ -882,7 +882,9 @@ mod tests {
|
||||
message_processor::{Executors, ThisInvokeContext},
|
||||
};
|
||||
use solana_sdk::{
|
||||
account::{create_account_shared_data as create_account, AccountSharedData},
|
||||
account::{
|
||||
create_account_shared_data_for_test as create_account_for_test, AccountSharedData,
|
||||
},
|
||||
account_utils::StateMut,
|
||||
client::SyncClient,
|
||||
clock::Clock,
|
||||
@@ -2206,15 +2208,12 @@ mod tests {
|
||||
file.read_to_end(&mut elf_new).unwrap();
|
||||
assert_ne!(elf_orig.len(), elf_new.len());
|
||||
let rent = Rent::default();
|
||||
let rent_account = RefCell::new(create_account(&Rent::default(), 1));
|
||||
let rent_account = RefCell::new(create_account_for_test(&Rent::default()));
|
||||
let slot = 42;
|
||||
let clock_account = RefCell::new(create_account(
|
||||
&Clock {
|
||||
slot,
|
||||
..Clock::default()
|
||||
},
|
||||
1,
|
||||
));
|
||||
let clock_account = RefCell::new(create_account_for_test(&Clock {
|
||||
slot,
|
||||
..Clock::default()
|
||||
}));
|
||||
let min_program_balance =
|
||||
1.max(rent.minimum_balance(UpgradeableLoaderState::program_len().unwrap()));
|
||||
let min_programdata_balance = 1.max(rent.minimum_balance(
|
||||
|
Reference in New Issue
Block a user