From 4baf5319beece1d998a66f2829d83e36e7cc846c Mon Sep 17 00:00:00 2001 From: Andrew Fitzgerald Date: Thu, 16 Nov 2023 15:17:27 +0000 Subject: [PATCH] Clean up: simplify .err() usage --- runtime/src/bank/tests.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/runtime/src/bank/tests.rs b/runtime/src/bank/tests.rs index 5851f3a2bb3d8a..7d224478b9aa68 100644 --- a/runtime/src/bank/tests.rs +++ b/runtime/src/bank/tests.rs @@ -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), ); } } @@ -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