Add Instruction::new_with_bincode
Programs can now prepare for the deprecation of `Instruction::new` in v1.6
This commit is contained in:
committed by
mergify[bot]
parent
7a08d47588
commit
39a2fbe2bf
@ -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>(
|
pub fn new_with_borsh<T: BorshSerialize>(
|
||||||
program_id: Pubkey,
|
program_id: Pubkey,
|
||||||
data: &T,
|
data: &T,
|
||||||
|
Reference in New Issue
Block a user