Skip to content

Commit

Permalink
Clean up: simplify asserts (#34111)
Browse files Browse the repository at this point in the history
  • Loading branch information
apfitzge authored Nov 17, 2023
1 parent 3d3e7bb commit eb35a5a
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions runtime/src/bank/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9707,18 +9707,16 @@ fn test_verify_and_hash_transaction_sig_len() {
{
let tx = make_transaction(TestCase::RemoveSignature);
assert_eq!(
bank.verify_transaction(tx.into(), TransactionVerificationMode::FullVerification)
.err(),
Some(TransactionError::SanitizeFailure),
bank.verify_transaction(tx.into(), TransactionVerificationMode::FullVerification),
Err(TransactionError::SanitizeFailure),
);
}
// Too many signatures: Sanitization failure
{
let tx = make_transaction(TestCase::AddSignature);
assert_eq!(
bank.verify_transaction(tx.into(), TransactionVerificationMode::FullVerification)
.err(),
Some(TransactionError::SanitizeFailure),
bank.verify_transaction(tx.into(), TransactionVerificationMode::FullVerification),
Err(TransactionError::SanitizeFailure),
);
}
}
Expand Down Expand Up @@ -9754,9 +9752,8 @@ fn test_verify_transactions_packet_data_size() {
let tx = make_transaction(25);
assert!(bincode::serialized_size(&tx).unwrap() > PACKET_DATA_SIZE as u64);
assert_eq!(
bank.verify_transaction(tx.into(), TransactionVerificationMode::FullVerification)
.err(),
Some(TransactionError::SanitizeFailure),
bank.verify_transaction(tx.into(), TransactionVerificationMode::FullVerification),
Err(TransactionError::SanitizeFailure),
);
}
// Assert that verify fails as soon as serialized
Expand Down

0 comments on commit eb35a5a

Please sign in to comment.