fix account index (#21041)
This commit is contained in:
@ -386,6 +386,21 @@ fn process_instruction(
|
||||
))
|
||||
);
|
||||
}
|
||||
|
||||
msg!("Test accounts re-ordering");
|
||||
{
|
||||
let instruction = create_instruction(
|
||||
*accounts[INVOKED_PROGRAM_INDEX].key,
|
||||
&[(accounts[FROM_INDEX].key, true, true)],
|
||||
vec![RETURN_OK],
|
||||
);
|
||||
// put the relavant account at the end of a larger account list
|
||||
let mut reordered_accounts = accounts.to_vec();
|
||||
let ai = reordered_accounts.remove(FROM_INDEX);
|
||||
reordered_accounts.push(accounts[0].clone());
|
||||
reordered_accounts.push(ai);
|
||||
invoke(&instruction, &reordered_accounts)?;
|
||||
}
|
||||
}
|
||||
TEST_PRIVILEGE_ESCALATION_SIGNER => {
|
||||
msg!("Test privilege escalation signer");
|
||||
|
@ -953,6 +953,7 @@ fn test_program_bpf_invoke_sanity() {
|
||||
invoked_program_id.clone(),
|
||||
system_program::id(),
|
||||
invoked_program_id.clone(),
|
||||
invoked_program_id.clone(),
|
||||
],
|
||||
};
|
||||
assert_eq!(invoked_programs.len(), expected_invoked_programs.len());
|
||||
|
Reference in New Issue
Block a user