@ -5455,12 +5455,8 @@ mod tests {
|
||||
let mut transfer_instruction =
|
||||
system_instruction::transfer(&mint_keypair.pubkey(), &key.pubkey(), 0);
|
||||
transfer_instruction.accounts[0].is_signer = false;
|
||||
|
||||
let tx = Transaction::new_signed_instructions(
|
||||
&Vec::<&Keypair>::new(),
|
||||
&[transfer_instruction],
|
||||
bank.last_blockhash(),
|
||||
);
|
||||
let message = Message::new_with_payer(&[transfer_instruction], None);
|
||||
let tx = Transaction::new(&[&Keypair::new(); 0], message, bank.last_blockhash());
|
||||
|
||||
assert_eq!(
|
||||
bank.process_transaction(&tx),
|
||||
|
@ -611,8 +611,10 @@ mod tests {
|
||||
AccountMeta::new(keys[not_owned_index], false),
|
||||
AccountMeta::new(keys[owned_index], false),
|
||||
];
|
||||
let message =
|
||||
Message::new(&[Instruction::new(program_ids[owned_index], &[0_u8], metas)]);
|
||||
let message = Message::new_with_payer(
|
||||
&[Instruction::new(program_ids[owned_index], &[0_u8], metas)],
|
||||
None,
|
||||
);
|
||||
|
||||
// modify account owned by the program
|
||||
accounts[owned_index].borrow_mut().data[0] = (MAX_DEPTH + owned_index) as u8;
|
||||
@ -1437,11 +1439,12 @@ mod tests {
|
||||
|
||||
// not owned account modified by the caller (before the invoke)
|
||||
accounts[0].borrow_mut().data[0] = 1;
|
||||
let message = Message::new(&[Instruction::new(
|
||||
let instruction = Instruction::new(
|
||||
callee_program_id,
|
||||
&MockInstruction::NoopSuccess,
|
||||
metas.clone(),
|
||||
)]);
|
||||
);
|
||||
let message = Message::new_with_payer(&[instruction], None);
|
||||
assert_eq!(
|
||||
MessageProcessor::process_cross_program_instruction(
|
||||
&message,
|
||||
@ -1469,8 +1472,8 @@ mod tests {
|
||||
];
|
||||
|
||||
for case in cases {
|
||||
let message =
|
||||
Message::new(&[Instruction::new(callee_program_id, &case.0, metas.clone())]);
|
||||
let instruction = Instruction::new(callee_program_id, &case.0, metas.clone());
|
||||
let message = Message::new_with_payer(&[instruction], None);
|
||||
assert_eq!(
|
||||
MessageProcessor::process_cross_program_instruction(
|
||||
&message,
|
||||
|
@ -125,8 +125,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn tx_uses_nonce_empty_ix_fail() {
|
||||
let tx = Transaction::new_signed_instructions(&[&Keypair::new(); 0], &[], Hash::default());
|
||||
assert!(transaction_uses_durable_nonce(&tx).is_none());
|
||||
assert!(transaction_uses_durable_nonce(&Transaction::default()).is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
Reference in New Issue
Block a user