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

Commit f2b31bd

Browse files
joncinquewillhickey
authored andcommitted
v1.18: sdk: Rederive Copy on Rent and EpochSchedule (#1744)
sdk: Rederive Clone on Rent and EpochSchedule
1 parent 70ad347 commit f2b31bd

File tree

17 files changed

+26
-2
lines changed

17 files changed

+26
-2
lines changed

accounts-db/src/accounts_db.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8997,8 +8997,10 @@ impl AccountsDb {
89978997
let schedule = &genesis_config.epoch_schedule;
89988998
let rent_collector = RentCollector::new(
89998999
schedule.get_epoch(max_slot),
9000+
#[allow(clippy::clone_on_copy)]
90009001
schedule.clone(),
90019002
genesis_config.slots_per_year(),
9003+
#[allow(clippy::clone_on_copy)]
90029004
genesis_config.rent.clone(),
90039005
);
90049006
let accounts_data_len = AtomicU64::new(0);

core/src/repair/ancestor_hashes_service.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,6 +1349,7 @@ mod test {
13491349
fn new(bank_forks: Arc<RwLock<BankForks>>) -> Self {
13501350
let ancestor_hashes_request_statuses = Arc::new(DashMap::new());
13511351
let ancestor_hashes_request_socket = Arc::new(UdpSocket::bind("0.0.0.0:0").unwrap());
1352+
#[allow(clippy::clone_on_copy)]
13521353
let epoch_schedule = bank_forks
13531354
.read()
13541355
.unwrap()

core/src/repair/repair_weight.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2553,6 +2553,7 @@ mod test {
25532553
let stake = 100;
25542554
let (bank, vote_pubkeys) = bank_utils::setup_bank_and_vote_pubkeys_for_tests(10, stake);
25552555
let mut epoch_stakes = bank.epoch_stakes_map().clone();
2556+
#[allow(clippy::clone_on_copy)]
25562557
let mut epoch_schedule = bank.epoch_schedule().clone();
25572558

25582559
// Simulate epoch boundary at slot 10, where half of the stake deactivates

core/src/shred_fetch_stage.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ pub(crate) struct ShredFetchStage {
3636

3737
impl ShredFetchStage {
3838
// updates packets received on a channel and sends them on another channel
39+
#[allow(clippy::clone_on_copy)]
3940
fn modify_packets(
4041
recvr: PacketBatchReceiver,
4142
sendr: Sender<PacketBatch>,

core/src/tvu.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ impl Tvu {
200200
let (dumped_slots_sender, dumped_slots_receiver) = unbounded();
201201
let (popular_pruned_forks_sender, popular_pruned_forks_receiver) = unbounded();
202202
let window_service = {
203+
#[allow(clippy::clone_on_copy)]
203204
let epoch_schedule = bank_forks
204205
.read()
205206
.unwrap()

genesis/src/stakes.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ mod tests {
246246
let total_lamports = staker_reserve + reserve * 2 + 1;
247247
create_and_check_stakes(
248248
&mut GenesisConfig {
249+
#[allow(clippy::clone_on_copy)]
249250
rent: rent.clone(),
250251
..GenesisConfig::default()
251252
},
@@ -272,6 +273,7 @@ mod tests {
272273
let total_lamports = staker_reserve + reserve * 2 + 1;
273274
create_and_check_stakes(
274275
&mut GenesisConfig {
276+
#[allow(clippy::clone_on_copy)]
275277
rent: rent.clone(),
276278
..GenesisConfig::default()
277279
},
@@ -298,6 +300,7 @@ mod tests {
298300
let total_lamports = staker_reserve + (granularity + reserve) * 2;
299301
create_and_check_stakes(
300302
&mut GenesisConfig {
303+
#[allow(clippy::clone_on_copy)]
301304
rent: rent.clone(),
302305
..GenesisConfig::default()
303306
},
@@ -323,6 +326,7 @@ mod tests {
323326
let total_lamports = staker_reserve + (granularity + reserve + 1) * 2;
324327
create_and_check_stakes(
325328
&mut GenesisConfig {
329+
#[allow(clippy::clone_on_copy)]
326330
rent: rent.clone(),
327331
..GenesisConfig::default()
328332
},

ledger/src/blockstore_processor.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3887,6 +3887,7 @@ pub mod tests {
38873887
AccountSecondaryIndexes::default(),
38883888
AccountShrinkThreshold::default(),
38893889
);
3890+
#[allow(clippy::clone_on_copy)]
38903891
bank.epoch_schedule().clone()
38913892
}
38923893

ledger/src/leader_schedule_cache.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ pub struct LeaderScheduleCache {
4040

4141
impl LeaderScheduleCache {
4242
pub fn new_from_bank(bank: &Bank) -> Self {
43+
#[allow(clippy::clone_on_copy)]
4344
Self::new(bank.epoch_schedule().clone(), bank)
4445
}
4546

programs/bpf_loader/src/syscalls/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3362,8 +3362,10 @@ mod tests {
33623362

33633363
let mut sysvar_cache = SysvarCache::default();
33643364
sysvar_cache.set_clock(src_clock.clone());
3365+
#[allow(clippy::clone_on_copy)]
33653366
sysvar_cache.set_epoch_schedule(src_epochschedule.clone());
33663367
sysvar_cache.set_fees(src_fees.clone());
3368+
#[allow(clippy::clone_on_copy)]
33673369
sysvar_cache.set_rent(src_rent.clone());
33683370
sysvar_cache.set_epoch_rewards(src_rewards);
33693371

programs/vote/src/vote_state/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,6 +1298,7 @@ mod tests {
12981298
let processor_account = AccountSharedData::new(0, 0, &solana_sdk::native_loader::id());
12991299
let transaction_context = TransactionContext::new(
13001300
vec![(id(), processor_account), (node_pubkey, vote_account)],
1301+
#[allow(clippy::clone_on_copy)]
13011302
rent.clone(),
13021303
0,
13031304
0,

0 commit comments

Comments
 (0)