Browse Source

Implement set_top_level_instruction_index (#7845)

* set_top_level_instruction_index

* behind dev-context-only-utils
Pierre 2 months ago
parent
commit
8ff0febacc
1 changed files with 5 additions and 0 deletions
  1. 5 0
      transaction-context/src/lib.rs

+ 5 - 0
transaction-context/src/lib.rs

@@ -141,6 +141,11 @@ impl TransactionContext {
         }
     }
 
+    #[cfg(feature = "dev-context-only-utils")]
+    pub fn set_top_level_instruction_index(&mut self, top_level_instruction_index: usize) {
+        self.top_level_instruction_index = top_level_instruction_index;
+    }
+
     /// Used in mock_process_instruction
     #[cfg(not(target_os = "solana"))]
     pub fn deconstruct_without_keys(self) -> Result<Vec<AccountSharedData>, InstructionError> {