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

@@ -60,7 +60,7 @@ impl AsyncClient for BankClient {
instruction: Instruction,
recent_blockhash: Hash,
) -> Result<Signature> {
let message = Message::new(&[instruction]);
let message = Message::new(&[instruction], Some(&keypair.pubkey()));
self.async_send_message(&[keypair], message, recent_blockhash)
}
@@ -88,7 +88,7 @@ impl SyncClient for BankClient {
/// Create and process a transaction from a single instruction.
fn send_instruction(&self, keypair: &Keypair, instruction: Instruction) -> Result<Signature> {
let message = Message::new(&[instruction]);
let message = Message::new(&[instruction], Some(&keypair.pubkey()));
self.send_message(&[keypair], message)
}
@@ -306,7 +306,7 @@ mod tests {
.accounts
.push(AccountMeta::new(jane_pubkey, true));
let message = Message::new(&[transfer_instruction]);
let message = Message::new(&[transfer_instruction], Some(&john_pubkey));
bank_client.send_message(&doe_keypairs, message).unwrap();
assert_eq!(bank_client.get_balance(&bob_pubkey).unwrap(), 42);
}