From f6c95b23f217809007f1d86c92992a748637d406 Mon Sep 17 00:00:00 2001 From: tserg <8017125+tserg@users.noreply.github.com> Date: Wed, 21 Feb 2024 18:37:49 +0800 Subject: [PATCH] revert merge conflict --- vyper/builtins/functions.py | 4 ++-- vyper/semantics/analysis/local.py | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/vyper/builtins/functions.py b/vyper/builtins/functions.py index 1dac583ee6..c1290b77fc 100644 --- a/vyper/builtins/functions.py +++ b/vyper/builtins/functions.py @@ -49,7 +49,7 @@ UnfoldableNode, ZeroDivisionException, ) -from vyper.semantics.analysis.base import Modifiability, VarInfo +from vyper.semantics.analysis.base import Modifiability, StateMutability, VarInfo from vyper.semantics.analysis.utils import ( get_common_types, get_exact_type_from_node, @@ -1247,7 +1247,7 @@ class BlockHash(BuiltinFunctionT): _id = "blockhash" _inputs = [("block_num", UINT256_T)] _return_type = BYTES32_T - _modifiability = Modifiability.RUNTIME_CONSTANT + mutability = StateMutability.VIEW @process_inputs def build_IR(self, expr, args, kwargs, contact): diff --git a/vyper/semantics/analysis/local.py b/vyper/semantics/analysis/local.py index 0ce966d1c6..88cf153406 100644 --- a/vyper/semantics/analysis/local.py +++ b/vyper/semantics/analysis/local.py @@ -743,6 +743,9 @@ def visit_Call(self, node: vy_ast.Call, typ: VyperType) -> None: self.visit(arg, arg_type) else: # builtin functions + if self.function_analyzer: + self._check_call_mutability(func_type.mutability) # type: ignore + arg_types = func_type.infer_arg_types(node, expected_return_typ=typ) # type: ignore for arg, arg_type in zip(node.args, arg_types): self.visit(arg, arg_type)