Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
jackcmay committed Jan 19, 2022
1 parent 1355eaf commit b1aab0d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
10 changes: 7 additions & 3 deletions programs/bpf_loader/src/syscalls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use {
sol_log_data_syscall_enabled, update_syscall_base_costs,
},
hash::{Hasher, HASH_BYTES},
instruction::{AccountMeta, InnerMeta, Instruction, InstructionError},
instruction::{AccountMeta, Instruction, InstructionError, ProcessedInnerInstruction},
keccak, native_loader,
precompiles::is_precompile,
program::MAX_RETURN_DATA,
Expand Down Expand Up @@ -3034,12 +3034,16 @@ impl<'a, 'b> SyscallObject<BpfError> for SyscallGetProcessedInnerInstruction<'a,
if let Some((stack_depth, instruction)) =
invoke_context.get_processed_inner_instruction(index as usize)
{
let InnerMeta {
let ProcessedInnerInstruction {
data_len,
accounts_len,
depth,
} = question_mark!(
translate_type_mut::<InnerMeta>(memory_mapping, meta_addr, &loader_id),
translate_type_mut::<ProcessedInnerInstruction>(
memory_mapping,
meta_addr,
&loader_id
),
result
);
if *data_len >= instruction.data.len() && *accounts_len >= instruction.accounts.len() {
Expand Down
6 changes: 3 additions & 3 deletions sdk/program/src/instruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ impl CompiledInstruction {
/// when calling the `sol_get_processed_inner_instruction` syscall.
#[repr(C)]
#[derive(Default, Debug, Clone, Copy)]
pub struct InnerMeta {
pub struct ProcessedInnerInstruction {
pub data_len: usize,
pub accounts_len: usize,
pub depth: usize,
Expand All @@ -673,14 +673,14 @@ pub fn get_processed_inner_instruction(index: usize) -> Option<(usize, Instructi
extern "C" {
fn sol_get_processed_inner_instruction(
index: u64,
meta: *mut InnerMeta,
meta: *mut ProcessedInnerInstruction,
program_id: *mut Pubkey,
data: *mut u8,
accounts: *mut AccountMeta,
) -> u64;
}

let mut meta = InnerMeta::default();
let mut meta = ProcessedInnerInstruction::default();
let mut program_id = Pubkey::default();

if 1 == unsafe {
Expand Down

0 comments on commit b1aab0d

Please sign in to comment.