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

@@ -592,11 +592,14 @@ fn do_main(matches: &ArgMatches<'_>) -> Result<(), Box<dyn error::Error>> {
}
("verify", Some(matches)) => {
let keypair = get_keypair_from_matches(matches, config, &mut wallet_manager)?;
let simple_message = Message::new(&[Instruction::new(
Pubkey::default(),
&0,
vec![AccountMeta::new(keypair.pubkey(), true)],
)])
let simple_message = Message::new(
&[Instruction::new(
Pubkey::default(),
&0,
vec![AccountMeta::new(keypair.pubkey(), true)],
)],
Some(&keypair.pubkey()),
)
.serialize();
let signature = keypair.try_sign_message(&simple_message)?;
let pubkey_bs58 = matches.value_of("pubkey").unwrap();