Label tuple with AccountMeta

This commit is contained in:
Greg Fitzgerald
2019-03-19 13:03:20 -06:00
parent 7246d72f03
commit a4652a9aaf
10 changed files with 83 additions and 68 deletions

View File

@ -2,7 +2,7 @@ use crate::id;
use crate::ConfigState;
use solana_sdk::pubkey::Pubkey;
use solana_sdk::system_instruction::SystemInstruction;
use solana_sdk::transaction::Instruction;
use solana_sdk::transaction::{AccountMeta, Instruction};
pub struct ConfigInstruction {}
@ -28,10 +28,10 @@ impl ConfigInstruction {
config_account_pubkey: &Pubkey,
data: &T,
) -> Instruction {
Instruction::new(
id(),
data,
vec![(*from_account_pubkey, true), (*config_account_pubkey, true)],
)
let account_metas = vec![
AccountMeta(*from_account_pubkey, true),
AccountMeta(*config_account_pubkey, true),
];
Instruction::new(id(), data, account_metas)
}
}