Make AccountMeta a traditional struct instead of a tuple struct

This commit is contained in:
Greg Fitzgerald
2019-03-19 15:25:48 -06:00
parent a4652a9aaf
commit 94b5835738
10 changed files with 82 additions and 54 deletions

View File

@ -39,6 +39,10 @@ impl SystemInstruction {
space: u64,
program_id: &Pubkey,
) -> Instruction {
let account_metas = vec![
AccountMeta::new(*from_id, true),
AccountMeta::new(*to_id, false),
];
Instruction::new(
system_program::id(),
&SystemInstruction::CreateAccount {
@ -46,15 +50,19 @@ impl SystemInstruction {
space,
program_id: *program_id,
},
vec![AccountMeta(*from_id, true), AccountMeta(*to_id, false)],
account_metas,
)
}
pub fn new_move(from_id: &Pubkey, to_id: &Pubkey, lamports: u64) -> Instruction {
let account_metas = vec![
AccountMeta::new(*from_id, true),
AccountMeta::new(*to_id, false),
];
Instruction::new(
system_program::id(),
&SystemInstruction::Move { lamports },
vec![AccountMeta(*from_id, true), AccountMeta(*to_id, false)],
account_metas,
)
}
}