nit: consistent name (#22857)
This commit is contained in:
parent
9f1f7aff2b
commit
551c24da57
|
@ -409,7 +409,7 @@ impl<'a> InvokeContext<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Current depth of the invocation stack
|
/// Current depth of the invocation stack
|
||||||
pub fn invoke_depth(&self) -> usize {
|
pub fn get_invoke_depth(&self) -> usize {
|
||||||
self.transaction_context
|
self.transaction_context
|
||||||
.get_instruction_context_stack_height()
|
.get_instruction_context_stack_height()
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,7 +102,11 @@ pub fn builtin_process_instruction(
|
||||||
|
|
||||||
let log_collector = invoke_context.get_log_collector();
|
let log_collector = invoke_context.get_log_collector();
|
||||||
let program_id = transaction_context.get_program_key()?;
|
let program_id = transaction_context.get_program_key()?;
|
||||||
stable_log::program_invoke(&log_collector, program_id, invoke_context.invoke_depth());
|
stable_log::program_invoke(
|
||||||
|
&log_collector,
|
||||||
|
program_id,
|
||||||
|
invoke_context.get_invoke_depth(),
|
||||||
|
);
|
||||||
|
|
||||||
// Copy indices_in_instruction into a HashSet to ensure there are no duplicates
|
// Copy indices_in_instruction into a HashSet to ensure there are no duplicates
|
||||||
let deduplicated_indices: HashSet<usize> = indices_in_instruction.clone().collect();
|
let deduplicated_indices: HashSet<usize> = indices_in_instruction.clone().collect();
|
||||||
|
@ -251,7 +255,7 @@ impl solana_sdk::program_stubs::SyscallStubs for SyscallStubs {
|
||||||
stable_log::program_invoke(
|
stable_log::program_invoke(
|
||||||
&log_collector,
|
&log_collector,
|
||||||
&instruction.program_id,
|
&instruction.program_id,
|
||||||
invoke_context.invoke_depth(),
|
invoke_context.get_invoke_depth(),
|
||||||
);
|
);
|
||||||
|
|
||||||
let signers = signers_seeds
|
let signers = signers_seeds
|
||||||
|
|
|
@ -307,7 +307,7 @@ fn process_instruction_common(
|
||||||
if program.executable()? {
|
if program.executable()? {
|
||||||
debug_assert_eq!(
|
debug_assert_eq!(
|
||||||
first_instruction_account,
|
first_instruction_account,
|
||||||
1 - (invoke_context.invoke_depth() > 1) as usize,
|
1 - (invoke_context.get_invoke_depth() > 1) as usize,
|
||||||
);
|
);
|
||||||
|
|
||||||
if !check_loader_id(&program.owner()?) {
|
if !check_loader_id(&program.owner()?) {
|
||||||
|
@ -1045,7 +1045,7 @@ impl Executor for BpfExecutor {
|
||||||
) -> Result<(), InstructionError> {
|
) -> Result<(), InstructionError> {
|
||||||
let log_collector = invoke_context.get_log_collector();
|
let log_collector = invoke_context.get_log_collector();
|
||||||
let compute_meter = invoke_context.get_compute_meter();
|
let compute_meter = invoke_context.get_compute_meter();
|
||||||
let invoke_depth = invoke_context.invoke_depth();
|
let invoke_depth = invoke_context.get_invoke_depth();
|
||||||
|
|
||||||
let mut serialize_time = Measure::start("serialize");
|
let mut serialize_time = Measure::start("serialize");
|
||||||
let program_id = *invoke_context.transaction_context.get_program_key()?;
|
let program_id = *invoke_context.transaction_context.get_program_key()?;
|
||||||
|
|
|
@ -28,7 +28,7 @@ pub fn process_instruction(
|
||||||
input: &[u8],
|
input: &[u8],
|
||||||
invoke_context: &mut InvokeContext,
|
invoke_context: &mut InvokeContext,
|
||||||
) -> Result<(), InstructionError> {
|
) -> Result<(), InstructionError> {
|
||||||
if invoke_context.invoke_depth() != 1 {
|
if invoke_context.get_invoke_depth() != 1 {
|
||||||
// Not supported as an inner instruction
|
// Not supported as an inner instruction
|
||||||
return Err(InstructionError::UnsupportedProgramId);
|
return Err(InstructionError::UnsupportedProgramId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ fn process_instruction_with_program_logging(
|
||||||
) -> Result<(), InstructionError> {
|
) -> Result<(), InstructionError> {
|
||||||
let logger = invoke_context.get_log_collector();
|
let logger = invoke_context.get_log_collector();
|
||||||
let program_id = invoke_context.transaction_context.get_program_key()?;
|
let program_id = invoke_context.transaction_context.get_program_key()?;
|
||||||
stable_log::program_invoke(&logger, program_id, invoke_context.invoke_depth());
|
stable_log::program_invoke(&logger, program_id, invoke_context.get_invoke_depth());
|
||||||
|
|
||||||
let result = process_instruction(first_instruction_account, instruction_data, invoke_context);
|
let result = process_instruction(first_instruction_account, instruction_data, invoke_context);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue