Fixes a bug in MockInvokeContext::get_compute_meter() and adjusts the test assert_instruction_count accordingly. (#20854)

The get_compute_meter() method created a reference to a clone instead of cloning the reference.
This commit is contained in:
Alexander Meißner
2021-10-22 09:46:47 +02:00
committed by GitHub
parent 0d4dbd5588
commit e7c9b9329d
4 changed files with 33 additions and 33 deletions

View File

@ -1328,7 +1328,7 @@ mod tests {
keyed_accounts.insert(0, (false, false, &program_key, &processor_account));
let mut invoke_context =
MockInvokeContext::new(&program_key, create_keyed_accounts_unified(&keyed_accounts));
invoke_context.compute_meter = MockComputeMeter::default();
invoke_context.compute_meter = Rc::new(RefCell::new(MockComputeMeter::default()));
assert_eq!(
Err(InstructionError::ProgramFailedToComplete),
super::process_instruction(1, &[], &mut invoke_context)