Skip to content

Commit

Permalink
TEST: revert test changes for above
Browse files Browse the repository at this point in the history
  • Loading branch information
2501babe committed Oct 30, 2024
1 parent 8ed49b2 commit 4628fc0
Showing 1 changed file with 52 additions and 16 deletions.
68 changes: 52 additions & 16 deletions svm/src/transaction_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2052,7 +2052,10 @@ mod tests {
let result = TransactionBatchProcessor::<TestForkGraph>::validate_transaction_fee_payer(
&mut account_loader,
&message,
None,
CheckedTransactionDetails {
nonce: None,
lamports_per_signature: 5000,
},
&FeatureSet::default(),
&FeeStructure::default(),
&rent_collector,
Expand Down Expand Up @@ -2126,7 +2129,10 @@ mod tests {
let result = TransactionBatchProcessor::<TestForkGraph>::validate_transaction_fee_payer(
&mut account_loader,
&message,
None,
CheckedTransactionDetails {
nonce: None,
lamports_per_signature: 5000,
},
&FeatureSet::default(),
&FeeStructure::default(),
&rent_collector,
Expand Down Expand Up @@ -2172,7 +2178,10 @@ mod tests {
let result = TransactionBatchProcessor::<TestForkGraph>::validate_transaction_fee_payer(
&mut account_loader,
&message,
None,
CheckedTransactionDetails {
nonce: None,
lamports_per_signature: 5000,
},
&FeatureSet::default(),
&FeeStructure::default(),
&RentCollector::default(),
Expand Down Expand Up @@ -2201,7 +2210,10 @@ mod tests {
let result = TransactionBatchProcessor::<TestForkGraph>::validate_transaction_fee_payer(
&mut account_loader,
&message,
None,
CheckedTransactionDetails {
nonce: None,
lamports_per_signature: 5000,
},
&FeatureSet::default(),
&FeeStructure::default(),
&RentCollector::default(),
Expand Down Expand Up @@ -2235,7 +2247,10 @@ mod tests {
let result = TransactionBatchProcessor::<TestForkGraph>::validate_transaction_fee_payer(
&mut account_loader,
&message,
None,
CheckedTransactionDetails {
nonce: None,
lamports_per_signature: 5000,
},
&FeatureSet::default(),
&FeeStructure::default(),
&rent_collector,
Expand Down Expand Up @@ -2266,7 +2281,10 @@ mod tests {
let result = TransactionBatchProcessor::<TestForkGraph>::validate_transaction_fee_payer(
&mut account_loader,
&message,
None,
CheckedTransactionDetails {
nonce: None,
lamports_per_signature: 5000,
},
&FeatureSet::default(),
&FeeStructure::default(),
&RentCollector::default(),
Expand All @@ -2293,7 +2311,10 @@ mod tests {
let result = TransactionBatchProcessor::<TestForkGraph>::validate_transaction_fee_payer(
&mut account_loader,
&message,
None,
CheckedTransactionDetails {
nonce: None,
lamports_per_signature: 5000,
},
&FeatureSet::default(),
&FeeStructure::default(),
&RentCollector::default(),
Expand Down Expand Up @@ -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::<TestForkGraph>::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::<TestForkGraph>::validate_transaction_fee_payer(
&mut account_loader,
&message,
Some(future_nonce.clone()),
tx_details,
&feature_set,
&FeeStructure::default(),
&rent_collector,
Expand Down Expand Up @@ -2427,7 +2454,10 @@ mod tests {
let result = TransactionBatchProcessor::<TestForkGraph>::validate_transaction_fee_payer(
&mut account_loader,
&message,
None,
CheckedTransactionDetails {
nonce: None,
lamports_per_signature: 5000,
},
&feature_set,
&FeeStructure::default(),
&rent_collector,
Expand Down Expand Up @@ -2482,7 +2512,10 @@ mod tests {
let result = TransactionBatchProcessor::<TestForkGraph>::validate_transaction_fee_payer(
&mut account_loader,
&message,
None,
CheckedTransactionDetails {
nonce: None,
lamports_per_signature: 5000,
},
&FeatureSet::default(),
&FeeStructure::default(),
&rent_collector,
Expand Down Expand Up @@ -2525,7 +2558,10 @@ mod tests {
TransactionBatchProcessor::<TestForkGraph>::validate_transaction_fee_payer(
&mut account_loader,
&message,
None,
CheckedTransactionDetails {
nonce: None,
lamports_per_signature: 5000,
},
&FeatureSet::default(),
&FeeStructure::default(),
&RentCollector::default(),
Expand Down

0 comments on commit 4628fc0

Please sign in to comment.