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

@ -28,7 +28,7 @@ pub fn load_program<T: Client>(
bank_client
.send_message(
&[from_keypair, &program_keypair],
Message::new(&[instruction]),
Message::new(&[instruction], Some(&from_keypair.pubkey())),
)
.unwrap();
@ -37,7 +37,7 @@ pub fn load_program<T: Client>(
for chunk in program.chunks(chunk_size) {
let instruction =
loader_instruction::write(&program_pubkey, loader_pubkey, offset, chunk.to_vec());
let message = Message::new_with_payer(&[instruction], Some(&from_keypair.pubkey()));
let message = Message::new(&[instruction], Some(&from_keypair.pubkey()));
bank_client
.send_message(&[from_keypair, &program_keypair], message)
.unwrap();
@ -45,7 +45,7 @@ pub fn load_program<T: Client>(
}
let instruction = loader_instruction::finalize(&program_pubkey, loader_pubkey);
let message = Message::new_with_payer(&[instruction], Some(&from_keypair.pubkey()));
let message = Message::new(&[instruction], Some(&from_keypair.pubkey()));
bank_client
.send_message(&[from_keypair, &program_keypair], message)
.unwrap();