Clean up sanitized tx creation for tests (#21006)

This commit is contained in:
Justin Starry
2021-10-27 13:09:16 -04:00
committed by GitHub
parent 9d330fc638
commit 036d7fcc81
11 changed files with 134 additions and 144 deletions

View File

@@ -1868,7 +1868,7 @@ mod tests {
system_transaction,
transaction::SanitizedTransaction,
};
use std::{convert::TryFrom, mem::size_of};
use std::mem::size_of;
#[test]
fn test_serialize_snapshot_data_file_under_limit() {
@@ -3042,13 +3042,12 @@ mod tests {
let slot = slot + 1;
let bank2 = Arc::new(Bank::new_from_parent(&bank1, &collector, slot));
let tx = SanitizedTransaction::try_from(system_transaction::transfer(
let tx = SanitizedTransaction::from_transaction_for_tests(system_transaction::transfer(
&key1,
&key2.pubkey(),
lamports_to_transfer,
bank2.last_blockhash(),
))
.unwrap();
));
let fee = bank2.get_fee_for_message(tx.message());
let tx = system_transaction::transfer(
&key1,