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
This commit is contained in:
Ryo Onodera
2021-03-25 15:23:20 +09:00
committed by GitHub
parent 7f0ac6a67c
commit 6d5c6c17c5
16 changed files with 206 additions and 104 deletions

View File

@@ -370,11 +370,11 @@ mod tests {
.iter()
.map(|meta| {
RefCell::new(if sysvar::clock::check_id(&meta.pubkey) {
account::create_account_shared_data(&Clock::default(), 1)
account::create_account_shared_data_for_test(&Clock::default())
} else if sysvar::slot_hashes::check_id(&meta.pubkey) {
account::create_account_shared_data(&SlotHashes::default(), 1)
account::create_account_shared_data_for_test(&SlotHashes::default())
} else if sysvar::rent::check_id(&meta.pubkey) {
account::create_account_shared_data(&Rent::free(), 1)
account::create_account_shared_data_for_test(&Rent::free())
} else if meta.pubkey == invalid_vote_state_pubkey() {
AccountSharedData::from(Account {
owner: invalid_vote_state_pubkey(),