Cap CPI signers (bp #14021) (#14023)

* Cap CPI signers (#14021)

(cherry picked from commit e1a4251b07)

# Conflicts:
#	programs/bpf/tests/programs.rs

* resolve conflicts

Co-authored-by: Jack May <jack@solana.com>
This commit is contained in:
mergify[bot]
2020-12-09 11:46:46 +00:00
committed by GitHub
parent a46d14a2d7
commit f52feddfcd
4 changed files with 138 additions and 27 deletions

View File

@@ -22,6 +22,7 @@ const TEST_PRIVILEGE_ESCALATION_WRITABLE: u8 = 3;
const TEST_PPROGRAM_NOT_EXECUTABLE: u8 = 4;
const TEST_EMPTY_ACCOUNTS_SLICE: u8 = 5;
const TEST_CAP_SEEDS: u8 = 6;
const TEST_CAP_SIGNERS: u8 = 7;
// const MINT_INDEX: usize = 0;
const ARGUMENT_INDEX: usize = 1;
@@ -375,6 +376,33 @@ fn process_instruction(
]],
)?;
}
TEST_CAP_SIGNERS => {
msg!("Test program max signers");
let instruction = create_instruction(*accounts[INVOKED_PROGRAM_INDEX].key, &[], vec![]);
invoke_signed(
&instruction,
accounts,
&[
&[b"1"],
&[b"2"],
&[b"3"],
&[b"4"],
&[b"5"],
&[b"6"],
&[b"7"],
&[b"8"],
&[b"9"],
&[b"0"],
&[b"1"],
&[b"2"],
&[b"3"],
&[b"4"],
&[b"5"],
&[b"6"],
&[b"7"],
],
)?;
}
_ => panic!(),
}