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

* 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

(cherry picked from commit 1c498369b5)

# Conflicts:
#	cli/src/nonce.rs
#	core/src/rpc.rs
#	ledger/src/blockstore.rs
#	programs/bpf/tests/programs.rs

* Fix merge

Co-authored-by: Greg Fitzgerald <greg@solana.com>
This commit is contained in:
mergify[bot]
2020-06-25 01:10:23 +00:00
committed by GitHub
parent 835bacce4f
commit 55b92c16da
47 changed files with 520 additions and 502 deletions

View File

@@ -218,9 +218,9 @@ fn new_update_manifest(
lamports,
vec![], // additional keys
);
let mut transaction = Transaction::new_unsigned_instructions(&instructions);
let message = Message::new(&instructions, Some(&from_keypair.pubkey()));
let signers = [from_keypair, update_manifest_keypair];
transaction.sign(&signers, recent_blockhash);
let transaction = Transaction::new(&signers, message, recent_blockhash);
rpc_client.send_and_confirm_transaction(&transaction)?;
}
Ok(())
@@ -243,7 +243,7 @@ fn store_update_manifest(
update_manifest,
);
let message = Message::new_with_payer(&[instruction], Some(&from_keypair.pubkey()));
let message = Message::new(&[instruction], Some(&from_keypair.pubkey()));
let transaction = Transaction::new(&signers, message, recent_blockhash);
rpc_client.send_and_confirm_transaction(&transaction)?;
Ok(())