From 4628fc0eb6cda9345b672a19d2473dccd8e550f8 Mon Sep 17 00:00:00 2001 From: hana <81144685+2501babe@users.noreply.github.com> Date: Wed, 30 Oct 2024 00:13:23 -0700 Subject: [PATCH] TEST: revert test changes for above --- svm/src/transaction_processor.rs | 68 ++++++++++++++++++++++++-------- 1 file changed, 52 insertions(+), 16 deletions(-) diff --git a/svm/src/transaction_processor.rs b/svm/src/transaction_processor.rs index 3d56f8909f6762..68a48b96720247 100644 --- a/svm/src/transaction_processor.rs +++ b/svm/src/transaction_processor.rs @@ -2052,7 +2052,10 @@ mod tests { let result = TransactionBatchProcessor::::validate_transaction_fee_payer( &mut account_loader, &message, - None, + CheckedTransactionDetails { + nonce: None, + lamports_per_signature: 5000, + }, &FeatureSet::default(), &FeeStructure::default(), &rent_collector, @@ -2126,7 +2129,10 @@ mod tests { let result = TransactionBatchProcessor::::validate_transaction_fee_payer( &mut account_loader, &message, - None, + CheckedTransactionDetails { + nonce: None, + lamports_per_signature: 5000, + }, &FeatureSet::default(), &FeeStructure::default(), &rent_collector, @@ -2172,7 +2178,10 @@ mod tests { let result = TransactionBatchProcessor::::validate_transaction_fee_payer( &mut account_loader, &message, - None, + CheckedTransactionDetails { + nonce: None, + lamports_per_signature: 5000, + }, &FeatureSet::default(), &FeeStructure::default(), &RentCollector::default(), @@ -2201,7 +2210,10 @@ mod tests { let result = TransactionBatchProcessor::::validate_transaction_fee_payer( &mut account_loader, &message, - None, + CheckedTransactionDetails { + nonce: None, + lamports_per_signature: 5000, + }, &FeatureSet::default(), &FeeStructure::default(), &RentCollector::default(), @@ -2235,7 +2247,10 @@ mod tests { let result = TransactionBatchProcessor::::validate_transaction_fee_payer( &mut account_loader, &message, - None, + CheckedTransactionDetails { + nonce: None, + lamports_per_signature: 5000, + }, &FeatureSet::default(), &FeeStructure::default(), &rent_collector, @@ -2266,7 +2281,10 @@ mod tests { let result = TransactionBatchProcessor::::validate_transaction_fee_payer( &mut account_loader, &message, - None, + CheckedTransactionDetails { + nonce: None, + lamports_per_signature: 5000, + }, &FeatureSet::default(), &FeeStructure::default(), &RentCollector::default(), @@ -2293,7 +2311,10 @@ mod tests { let result = TransactionBatchProcessor::::validate_transaction_fee_payer( &mut account_loader, &message, - None, + CheckedTransactionDetails { + nonce: None, + lamports_per_signature: 5000, + }, &FeatureSet::default(), &FeeStructure::default(), &RentCollector::default(), @@ -2350,26 +2371,32 @@ mod tests { let mut error_counters = TransactionErrorMetrics::default(); - let next_durable_nonce = DurableNonce::from_blockhash(&Hash::new_unique()); + let environment_blockhash = Hash::new_unique(); + let next_durable_nonce = DurableNonce::from_blockhash(&environment_blockhash); let mut future_nonce = NonceInfo::new(*fee_payer_address, fee_payer_account.clone()); future_nonce - .try_advance_nonce(next_durable_nonce, 0) + .try_advance_nonce(next_durable_nonce, lamports_per_signature) .unwrap(); + let tx_details = CheckedTransactionDetails { + nonce: Some(future_nonce.clone()), + lamports_per_signature, + }; + let result = TransactionBatchProcessor::::validate_transaction_nonce( &mut account_loader, &message, - future_nonce.clone(), - next_durable_nonce, + &tx_details, + &environment_blockhash, &mut error_counters, ); - assert_eq!(result, Ok(future_nonce.clone())); + assert_eq!(result, Ok(())); let result = TransactionBatchProcessor::::validate_transaction_fee_payer( &mut account_loader, &message, - Some(future_nonce.clone()), + tx_details, &feature_set, &FeeStructure::default(), &rent_collector, @@ -2427,7 +2454,10 @@ mod tests { let result = TransactionBatchProcessor::::validate_transaction_fee_payer( &mut account_loader, &message, - None, + CheckedTransactionDetails { + nonce: None, + lamports_per_signature: 5000, + }, &feature_set, &FeeStructure::default(), &rent_collector, @@ -2482,7 +2512,10 @@ mod tests { let result = TransactionBatchProcessor::::validate_transaction_fee_payer( &mut account_loader, &message, - None, + CheckedTransactionDetails { + nonce: None, + lamports_per_signature: 5000, + }, &FeatureSet::default(), &FeeStructure::default(), &rent_collector, @@ -2525,7 +2558,10 @@ mod tests { TransactionBatchProcessor::::validate_transaction_fee_payer( &mut account_loader, &message, - None, + CheckedTransactionDetails { + nonce: None, + lamports_per_signature: 5000, + }, &FeatureSet::default(), &FeeStructure::default(), &RentCollector::default(),