Skip to content

Commit

Permalink
fix ctor sourcemap panic
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbertoCentonze committed Jan 28, 2025
1 parent 14c8533 commit 0018177
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions boa/contracts/vvm/vvm_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,18 @@ def stack_trace(self, computation=None):
error = error_map[pc]
break

# we only report the line for simplicity, could be more precise
lineno, *_ = error

annotated_error = vyper.utils.annotate_source_code(
self.source_code, lineno, context_lines=3, line_numbers=True
)

return StackTrace([VVMErrorDetail(annotated_error)])
# this condition is because source maps are not yet implemented for
# the ctor
if error is not None:
# we only report the line for simplicity, could be more precise
lineno, *_ = error

annotated_error = vyper.utils.annotate_source_code(
self.source_code, lineno, context_lines=3, line_numbers=True
)

return StackTrace([VVMErrorDetail(annotated_error)])
return StackTrace([])


@dataclass
Expand Down

0 comments on commit 0018177

Please sign in to comment.