浏览代码

Implement set_top_level_instruction_index (#7845)

* set_top_level_instruction_index

* behind dev-context-only-utils
Pierre 2 月之前
父节点
当前提交
8ff0febacc
共有 1 个文件被更改,包括 5 次插入0 次删除
  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
     /// Used in mock_process_instruction
     #[cfg(not(target_os = "solana"))]
     #[cfg(not(target_os = "solana"))]
     pub fn deconstruct_without_keys(self) -> Result<Vec<AccountSharedData>, InstructionError> {
     pub fn deconstruct_without_keys(self) -> Result<Vec<AccountSharedData>, InstructionError> {