Invoke with empty account slice (bp #13931) (#13940)

* Invoke with empty account slice (#13931)


(cherry picked from commit 1c51711c75)

* nudge ci

Co-authored-by: Jack May <jack@solana.com>
This commit is contained in:
mergify[bot]
2020-12-03 09:52:08 -08:00
committed by GitHub
parent e313cf8332
commit f705340971
5 changed files with 97 additions and 46 deletions

View File

@@ -20,6 +20,7 @@ const TEST_SUCCESS: u8 = 1;
const TEST_PRIVILEGE_ESCALATION_SIGNER: u8 = 2;
const TEST_PRIVILEGE_ESCALATION_WRITABLE: u8 = 3;
const TEST_PPROGRAM_NOT_EXECUTABLE: u8 = 4;
const TEST_EMPTY_ACCOUNTS_SLICE: u8 = 5;
// const MINT_INDEX: usize = 0;
const ARGUMENT_INDEX: usize = 1;
@@ -356,6 +357,11 @@ fn process_instruction(
);
invoke(&instruction, accounts)?;
}
TEST_EMPTY_ACCOUNTS_SLICE => {
msg!("Empty accounts slice");
let instruction = create_instruction(*accounts[INVOKED_PROGRAM_INDEX].key, &[], vec![]);
invoke(&instruction, &[])?;
}
_ => panic!(),
}