Skip to content

Commit 85180ee

Browse files
committed
Use u16 for program account index
1 parent 88bf1de commit 85180ee

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

transaction-context/src/instruction.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ use {
1818
#[repr(C)]
1919
#[derive(Debug)]
2020
pub struct InstructionFrame {
21-
pub program_account_index_in_tx: u32,
21+
/// Reserved filed for alignment and potential future usage.
22+
pub reserved: u16,
23+
pub program_account_index_in_tx: u16,
2224
pub nesting_level: u16,
2325
/// This is the index of the parent instruction if this is a CPI and u16::MAX if this is a
2426
/// top-level instruction
@@ -36,6 +38,7 @@ impl Default for InstructionFrame {
3638
// Using u64::MAX as the default pointer value, since it shall never be accessible.
3739
instruction_accounts: VmSlice::new(0, 0),
3840
instruction_data: VmSlice::new(0, 0),
41+
reserved: 0,
3942
}
4043
}
4144
}

transaction-context/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ impl<'ix_data> TransactionContext<'ix_data> {
299299
.last_mut()
300300
.ok_or(InstructionError::CallDepth)?;
301301

302-
instruction.program_account_index_in_tx = program_index as u32;
302+
instruction.program_account_index_in_tx = program_index;
303303
instruction.configure_vm_slices(
304304
instruction_index as u64,
305305
instruction_accounts.len(),

0 commit comments

Comments
 (0)