Add Instruction::new_with_bincode

Programs can now prepare for the deprecation of `Instruction::new` in v1.6
This commit is contained in:
Michael Vines
2021-03-15 20:14:25 -07:00
committed by mergify[bot]
parent 7a08d47588
commit 39a2fbe2bf

View File

@ -218,6 +218,14 @@ impl Instruction {
}
}
pub fn new_with_bincode<T: Serialize>(
program_id: Pubkey,
data: &T,
accounts: Vec<AccountMeta>,
) -> Self {
Self::new(program_id, data, accounts)
}
pub fn new_with_borsh<T: BorshSerialize>(
program_id: Pubkey,
data: &T,