From 229e5ad16eaeeac194d72f6f1144945dfa33e0b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Walter?= Date: Tue, 10 Dec 2024 21:52:05 +0100 Subject: [PATCH] Remove wront replacement of relocatable by None --- src/starkware/cairo/lang/vm/vm_core.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/starkware/cairo/lang/vm/vm_core.py b/src/starkware/cairo/lang/vm/vm_core.py index dfb31d35..cda5c1a5 100644 --- a/src/starkware/cairo/lang/vm/vm_core.py +++ b/src/starkware/cairo/lang/vm/vm_core.py @@ -39,7 +39,7 @@ class RunContext(RunContextBase): fp: MaybeRelocatable prime: int - def get_instruction_encoding(self) -> Tuple[int, Optional[int]]: + def get_instruction_encoding(self) -> Tuple[int, Optional[MaybeRelocatable]]: """ Returns the encoded instruction (the value at pc) and the immediate value (the value at pc + 1, if it exists in the memory). @@ -52,8 +52,6 @@ def get_instruction_encoding(self) -> Tuple[int, Optional[int]]: imm_addr = (self.pc + 1) % self.prime optional_imm = self.memory.get(imm_addr) - if not isinstance(optional_imm, int): - optional_imm = None return instruction_encoding, optional_imm def compute_dst_addr(self, instruction: Instruction): @@ -276,7 +274,9 @@ def compute_res( else: raise NotImplementedError("Invalid res value") - def compute_operands(self, instruction: Instruction) -> Tuple[Operands, List[int]]: + def compute_operands( + self, instruction: Instruction + ) -> Tuple[Operands, List[MaybeRelocatable]]: """ Computes the values of the operands. Deduces dst if needed. Returns: