Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up: simplify asserts #34111

Merged
merged 1 commit into from
Nov 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions runtime/src/bank/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9710,18 +9710,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 @@ -9757,9 +9755,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