Remove fee-payer guesswork from Message and Transaction (#10776)

* Make Message::new_with_payer the default constructor

* Remove Transaction::new_[un]signed_instructions

These guess the fee-payer instead of stating it explicitly
This commit is contained in:
Greg Fitzgerald
2020-06-24 14:52:38 -06:00
committed by GitHub
parent d5d5ad0071
commit 1c498369b5
47 changed files with 516 additions and 497 deletions

View File

@@ -11,6 +11,7 @@ use solana_sdk::{
clock::MAX_RECENT_BLOCKHASHES,
genesis_config::create_genesis_config,
instruction::InstructionError,
message::Message,
pubkey::Pubkey,
signature::{Keypair, Signer},
transaction::Transaction,
@@ -52,7 +53,8 @@ pub fn create_builtin_transactions(
let instruction = create_invoke_instruction(rando0.pubkey(), program_id, &1u8);
let (blockhash, _fee_calculator) = bank_client.get_recent_blockhash().unwrap();
Transaction::new_signed_instructions(&[&rando0], &[instruction], blockhash)
let message = Message::new(&[instruction], Some(&mint_keypair.pubkey()));
Transaction::new(&[&rando0], message, blockhash)
})
.collect()
}
@@ -73,7 +75,8 @@ pub fn create_native_loader_transactions(
let instruction = create_invoke_instruction(rando0.pubkey(), program_id, &1u8);
let (blockhash, _fee_calculator) = bank_client.get_recent_blockhash().unwrap();
Transaction::new_signed_instructions(&[&rando0], &[instruction], blockhash)
let message = Message::new(&[instruction], Some(&mint_keypair.pubkey()));
Transaction::new(&[&rando0], message, blockhash)
})
.collect()
}