62
62
inline_spl_associated_token_account, inline_spl_token,
63
63
message_processor:: MessageProcessor ,
64
64
rent_collector:: { CollectedInfo , RentCollector } ,
65
+ rent_debits:: RentDebits ,
65
66
runtime_config:: RuntimeConfig ,
66
67
serde_snapshot:: { SerdeAccountsHash , SerdeIncrementalAccountsHash } ,
67
68
snapshot_hash:: SnapshotHash ,
@@ -216,26 +217,6 @@ struct RentMetrics {
216
217
count : AtomicUsize ,
217
218
}
218
219
219
- #[ derive( Clone , Debug , PartialEq , Eq ) ]
220
- pub struct RentDebit {
221
- rent_collected : u64 ,
222
- post_balance : u64 ,
223
- }
224
-
225
- impl RentDebit {
226
- fn try_into_reward_info ( self ) -> Option < RewardInfo > {
227
- let rent_debit = i64:: try_from ( self . rent_collected )
228
- . ok ( )
229
- . and_then ( |r| r. checked_neg ( ) ) ;
230
- rent_debit. map ( |rent_debit| RewardInfo {
231
- reward_type : RewardType :: Rent ,
232
- lamports : rent_debit,
233
- post_balance : self . post_balance ,
234
- commission : None , // Not applicable
235
- } )
236
- }
237
- }
238
-
239
220
/// Incremental snapshots only calculate their accounts hash based on the account changes WITHIN the incremental slot range.
240
221
/// So, we need to keep track of the full snapshot expected accounts hash results.
241
222
/// We also need to keep track of the hash and capitalization specific to the incremental snapshot slot range.
@@ -255,35 +236,6 @@ pub struct BankIncrementalSnapshotPersistence {
255
236
pub incremental_capitalization : u64 ,
256
237
}
257
238
258
- #[ derive( Clone , Debug , Default , PartialEq , Eq ) ]
259
- pub struct RentDebits ( HashMap < Pubkey , RentDebit > ) ;
260
- impl RentDebits {
261
- fn get_account_rent_debit ( & self , address : & Pubkey ) -> u64 {
262
- self . 0
263
- . get ( address)
264
- . map ( |r| r. rent_collected )
265
- . unwrap_or_default ( )
266
- }
267
-
268
- pub fn insert ( & mut self , address : & Pubkey , rent_collected : u64 , post_balance : u64 ) {
269
- if rent_collected != 0 {
270
- self . 0 . insert (
271
- * address,
272
- RentDebit {
273
- rent_collected,
274
- post_balance,
275
- } ,
276
- ) ;
277
- }
278
- }
279
-
280
- pub fn into_unordered_rewards_iter ( self ) -> impl Iterator < Item = ( Pubkey , RewardInfo ) > {
281
- self . 0
282
- . into_iter ( )
283
- . filter_map ( |( address, rent_debit) | Some ( ( address, rent_debit. try_into_reward_info ( ) ?) ) )
284
- }
285
- }
286
-
287
239
pub type BankStatusCache = StatusCache < Result < ( ) > > ;
288
240
#[ frozen_abi( digest = "GBTLfFjModD9ykS9LV4pGi4S8eCrUj2JjWSDQLf8tMwV" ) ]
289
241
pub type BankSlotDelta = SlotDelta < Result < ( ) > > ;
0 commit comments