Switch to Instruction::new_with_bincode
This commit is contained in:
parent
82a385b7c3
commit
c63d854ac7
|
@ -33,7 +33,7 @@ async fn test_cross_program_invocation() {
|
||||||
let (mut banks_client, payer, recent_blockhash) = program_test.start().await;
|
let (mut banks_client, payer, recent_blockhash) = program_test.start().await;
|
||||||
|
|
||||||
let mut transaction = Transaction::new_with_payer(
|
let mut transaction = Transaction::new_with_payer(
|
||||||
&[Instruction::new(
|
&[Instruction::new_with_bincode(
|
||||||
program_id,
|
program_id,
|
||||||
&[bump_seed],
|
&[bump_seed],
|
||||||
vec![
|
vec![
|
||||||
|
|
|
@ -15,7 +15,7 @@ async fn test_custom_heap() {
|
||||||
.start()
|
.start()
|
||||||
.await;
|
.await;
|
||||||
let mut transaction = Transaction::new_with_payer(
|
let mut transaction = Transaction::new_with_payer(
|
||||||
&[Instruction::new(
|
&[Instruction::new_with_bincode(
|
||||||
program_id,
|
program_id,
|
||||||
&[10_u8, 11, 12, 13, 14],
|
&[10_u8, 11, 12, 13, 14],
|
||||||
vec![],
|
vec![],
|
||||||
|
|
|
@ -18,7 +18,7 @@ async fn test_logging() {
|
||||||
.start()
|
.start()
|
||||||
.await;
|
.await;
|
||||||
let mut transaction = Transaction::new_with_payer(
|
let mut transaction = Transaction::new_with_payer(
|
||||||
&[Instruction::new(
|
&[Instruction::new_with_bincode(
|
||||||
program_id,
|
program_id,
|
||||||
&[10_u8, 11, 12, 13, 14],
|
&[10_u8, 11, 12, 13, 14],
|
||||||
vec![AccountMeta::new(Pubkey::new_unique(), false)],
|
vec![AccountMeta::new(Pubkey::new_unique(), false)],
|
||||||
|
|
|
@ -20,7 +20,7 @@ async fn test_sysvar() {
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
let mut transaction = Transaction::new_with_payer(
|
let mut transaction = Transaction::new_with_payer(
|
||||||
&[Instruction::new(
|
&[Instruction::new_with_bincode(
|
||||||
program_id,
|
program_id,
|
||||||
&(),
|
&(),
|
||||||
vec![
|
vec![
|
||||||
|
|
|
@ -35,7 +35,7 @@ async fn test_lamport_transfer() {
|
||||||
let (mut banks_client, payer, recent_blockhash) = program_test.start().await;
|
let (mut banks_client, payer, recent_blockhash) = program_test.start().await;
|
||||||
|
|
||||||
let mut transaction = Transaction::new_with_payer(
|
let mut transaction = Transaction::new_with_payer(
|
||||||
&[Instruction::new(
|
&[Instruction::new_with_bincode(
|
||||||
program_id,
|
program_id,
|
||||||
&(),
|
&(),
|
||||||
vec![
|
vec![
|
||||||
|
|
|
@ -406,7 +406,7 @@ pub fn split_only(
|
||||||
AccountMeta::new_readonly(*authorized_pubkey, true),
|
AccountMeta::new_readonly(*authorized_pubkey, true),
|
||||||
];
|
];
|
||||||
|
|
||||||
Instruction::new(id(), &StakeInstruction::Split(lamports), account_metas)
|
Instruction::new_with_bincode(id(), &StakeInstruction::Split(lamports), account_metas)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// FIXME copied from the stake program
|
/// FIXME copied from the stake program
|
||||||
|
@ -422,7 +422,7 @@ pub fn authorize(
|
||||||
AccountMeta::new_readonly(*authorized_pubkey, true),
|
AccountMeta::new_readonly(*authorized_pubkey, true),
|
||||||
];
|
];
|
||||||
|
|
||||||
Instruction::new(
|
Instruction::new_with_bincode(
|
||||||
id(),
|
id(),
|
||||||
&StakeInstruction::Authorize(*new_authorized_pubkey, stake_authorize),
|
&StakeInstruction::Authorize(*new_authorized_pubkey, stake_authorize),
|
||||||
account_metas,
|
account_metas,
|
||||||
|
@ -443,7 +443,7 @@ pub fn merge(
|
||||||
AccountMeta::new_readonly(*authorized_pubkey, true),
|
AccountMeta::new_readonly(*authorized_pubkey, true),
|
||||||
];
|
];
|
||||||
|
|
||||||
Instruction::new(id(), &StakeInstruction::Merge, account_metas)
|
Instruction::new_with_bincode(id(), &StakeInstruction::Merge, account_metas)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// FIXME copied from the stake program
|
/// FIXME copied from the stake program
|
||||||
|
@ -468,7 +468,7 @@ pub fn create_account(
|
||||||
|
|
||||||
/// FIXME copied from the stake program
|
/// FIXME copied from the stake program
|
||||||
pub fn initialize(stake_pubkey: &Pubkey, authorized: &Authorized, lockup: &Lockup) -> Instruction {
|
pub fn initialize(stake_pubkey: &Pubkey, authorized: &Authorized, lockup: &Lockup) -> Instruction {
|
||||||
Instruction::new(
|
Instruction::new_with_bincode(
|
||||||
id(),
|
id(),
|
||||||
&StakeInstruction::Initialize(*authorized, *lockup),
|
&StakeInstruction::Initialize(*authorized, *lockup),
|
||||||
vec![
|
vec![
|
||||||
|
@ -492,5 +492,5 @@ pub fn delegate_stake(
|
||||||
AccountMeta::new_readonly(Pubkey::from_str(STAKE_CONFIG).unwrap(), false),
|
AccountMeta::new_readonly(Pubkey::from_str(STAKE_CONFIG).unwrap(), false),
|
||||||
AccountMeta::new_readonly(*authorized_pubkey, true),
|
AccountMeta::new_readonly(*authorized_pubkey, true),
|
||||||
];
|
];
|
||||||
Instruction::new(id(), &StakeInstruction::DelegateStake, account_metas)
|
Instruction::new_with_bincode(id(), &StakeInstruction::DelegateStake, account_metas)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue