Use Rent sysvar directly for stake split instruction (#24008)

* Use Rent sysvar directly for stake split ix

* Add feature to gate rent sysvar change

* fix tests

* cargo clippy
This commit is contained in:
Justin Starry
2022-03-31 16:46:35 +08:00
committed by GitHub
parent 210d98bc06
commit cb5e67d327
8 changed files with 264 additions and 81 deletions

View File

@ -1135,6 +1135,7 @@ pub fn mock_process_instruction(
instruction_data: &[u8],
transaction_accounts: Vec<TransactionAccount>,
instruction_accounts: Vec<AccountMeta>,
sysvar_cache_override: Option<&SysvarCache>,
expected_result: Result<(), InstructionError>,
process_instruction: ProcessInstructionWithContext,
) -> Vec<AccountSharedData> {
@ -1151,6 +1152,9 @@ pub fn mock_process_instruction(
1,
);
let mut invoke_context = InvokeContext::new_mock(&mut transaction_context, &[]);
if let Some(sysvar_cache) = sysvar_cache_override {
invoke_context.sysvar_cache = Cow::Borrowed(sysvar_cache);
}
let result = invoke_context
.push(
&preparation.instruction_accounts,