Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
names fields in RentResullt::CollectRent enum variant (#26449)
Browse files Browse the repository at this point in the history
Avoiding ambiguous raw tuple:
    CollectRent((Epoch, u64))

Using named fields instead:
    CollectRent {
        new_rent_epoch: Epoch,
        rent_due: u64,
    },

(cherry picked from commit d7201a8)

# Conflicts:
#	runtime/src/bank.rs
#	runtime/src/expected_rent_collection.rs
#	runtime/src/rent_collector.rs
  • Loading branch information
behzadnouri authored and mergify[bot] committed Jul 10, 2022
1 parent 4be121e commit 0d5851a
Show file tree
Hide file tree
Showing 5 changed files with 1,358 additions and 51 deletions.
4 changes: 2 additions & 2 deletions runtime/src/accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1680,9 +1680,9 @@ mod tests {
feature_set.deactivate(&tx_wide_compute_cap::id());
let rent_collector = RentCollector::new(
0,
&EpochSchedule::default(),
EpochSchedule::default(),
500_000.0,
&Rent {
Rent {
lamports_per_byte_year: 42,
..Rent::default()
},
Expand Down
7 changes: 4 additions & 3 deletions runtime/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5260,7 +5260,8 @@ impl AccountsDb {
)
}

pub fn update_accounts_hash_test(&self, slot: Slot, ancestors: &Ancestors) -> (Hash, u64) {
#[cfg(test)]
fn update_accounts_hash_test(&self, slot: Slot, ancestors: &Ancestors) -> (Hash, u64) {
self.update_accounts_hash_with_index_option(
true, true, slot, ancestors, None, false, None, false,
)
Expand Down Expand Up @@ -6972,9 +6973,9 @@ impl AccountsDb {
let schedule = genesis_config.epoch_schedule;
let rent_collector = RentCollector::new(
schedule.get_epoch(max_slot),
&schedule,
schedule,
genesis_config.slots_per_year(),
&genesis_config.rent,
genesis_config.rent,
);
let accounts_data_len = AtomicU64::new(0);

Expand Down
6 changes: 5 additions & 1 deletion runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3224,9 +3224,13 @@ impl Bank {

self.rent_collector = RentCollector::new(
self.epoch,
<<<<<<< HEAD
&self.epoch_schedule,
=======
*self.epoch_schedule(),
>>>>>>> d7201a8d1 (names fields in RentResullt::CollectRent enum variant (#26449))
self.slots_per_year,
&genesis_config.rent,
genesis_config.rent,
);

// Add additional builtin programs specified in the genesis config
Expand Down
Loading

0 comments on commit 0d5851a

Please sign in to comment.