Clean up sanitized tx creation for tests (#21006)
This commit is contained in:
@@ -163,16 +163,11 @@ mod tests {
|
||||
hash::Hash, message::Message, pubkey::Pubkey, signature::Keypair, signer::Signer,
|
||||
transaction::Transaction,
|
||||
};
|
||||
use std::convert::TryInto;
|
||||
|
||||
fn sanitize_tx(tx: Transaction) -> SanitizedTransaction {
|
||||
tx.try_into().unwrap()
|
||||
}
|
||||
|
||||
macro_rules! test {
|
||||
( $instructions: expr, $expected_error: expr, $expected_budget: expr ) => {
|
||||
let payer_keypair = Keypair::new();
|
||||
let tx = sanitize_tx(Transaction::new(
|
||||
let tx = SanitizedTransaction::from_transaction_for_tests(Transaction::new(
|
||||
&[&payer_keypair],
|
||||
Message::new($instructions, Some(&payer_keypair.pubkey())),
|
||||
Hash::default(),
|
||||
|
Reference in New Issue
Block a user