Skip to content

Commit

Permalink
fix: itermisses
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed May 17, 2024
1 parent 9a47666 commit 8d168fb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ape_vyper/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1049,20 +1049,20 @@ def enrich_error(self, err: ContractLogicError) -> ContractLogicError:
def trace_source(
self, contract_source: ContractSource, trace: TraceAPI, calldata: HexBytes
) -> SourceTraceback:
return self._get_traceback(contract_source, trace, calldata)
frames = trace.get_raw_frames()
return self._get_traceback(contract_source, frames, calldata)

def _get_traceback(
self,
contract_src: ContractSource,
trace: TraceAPI,
frames: Iterator[dict],
calldata: HexBytes,
previous_depth: Optional[int] = None,
) -> SourceTraceback:
traceback = SourceTraceback.model_validate([])
method_id = HexBytes(calldata[:4])
completed = False
pcmap = PCMap.model_validate({})
frames = trace.get_raw_frames()

for frame in frames:
if frame["op"] in CALL_OPCODES:
Expand All @@ -1073,7 +1073,7 @@ def _get_traceback(
if ext.endswith(".vy"):
# Called another Vyper contract.
sub_trace = self._get_traceback(
called_contract, trace, sub_calldata, previous_depth=frame["depth"]
called_contract, frames, sub_calldata, previous_depth=frame["depth"]
)
traceback.extend(sub_trace)

Expand All @@ -1082,7 +1082,7 @@ def _get_traceback(
compiler = self.compiler_manager.registered_compilers[ext]
try:
sub_trace = compiler.trace_source(
called_contract.contract_type, trace, sub_calldata
called_contract.contract_type, frames, sub_calldata
)
traceback.extend(sub_trace)
except NotImplementedError:
Expand Down

0 comments on commit 8d168fb

Please sign in to comment.