Skip to content

Commit bfa789f

Browse files
committed
update test_ssa_generation property check
1 parent eab4128 commit bfa789f

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

tests/unit/slithir/test_ssa_generation.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,36 @@
33
from argparse import ArgumentTypeError
44
from collections import defaultdict
55
from inspect import getsourcefile
6-
from typing import Union, List, Dict, Callable
6+
from typing import Callable, Dict, List, Union
77

88
import pytest
99
from solc_select.solc_select import valid_version as solc_valid_version
1010

1111
from slither import Slither
1212
from slither.core.cfg.node import Node, NodeType
13-
from slither.core.declarations import Function, Contract
13+
from slither.core.declarations import Contract, Function
1414
from slither.core.solidity_types import ArrayType, ElementaryType
1515
from slither.core.variables.local_variable import LocalVariable, VariableLocation
1616
from slither.core.variables.state_variable import StateVariable
1717
from slither.slithir.operations import (
18-
OperationWithLValue,
19-
Phi,
2018
Assignment,
21-
HighLevelCall,
22-
Return,
23-
Operation,
2419
Binary,
2520
BinaryType,
26-
InternalCall,
21+
HighLevelCall,
2722
Index,
2823
InitArray,
24+
InternalCall,
2925
NewArray,
26+
Operation,
27+
OperationWithLValue,
28+
Phi,
29+
Return,
3030
)
3131
from slither.slithir.utils.ssa import is_used_later
3232
from slither.slithir.variables import (
3333
Constant,
34-
ReferenceVariable,
3534
LocalIRVariable,
35+
ReferenceVariable,
3636
StateIRVariable,
3737
TemporaryVariableSSA,
3838
)
@@ -120,7 +120,7 @@ def ssa_basic_properties(function: Function) -> None:
120120
if v and v.name:
121121
ssa_defs[v.name] += 1
122122

123-
for (k, count) in lvalue_assignments.items():
123+
for k, count in lvalue_assignments.items():
124124
assert ssa_defs[k] >= count
125125

126126
# Helper 5/6
@@ -134,7 +134,7 @@ def check_property_5_and_6(
134134
assert var.is_storage == ssa_var.is_storage
135135
if ssa_var.is_storage:
136136
assert len(ssa_var.refers_to) == 1
137-
assert ssa_var.refers_to[0].location == VariableLocation.REFERENCE_TO_STORAGE
137+
assert ssa_var.refers_to[0].location == VariableLocation.REFERENCE_TO_STORAGE.value
138138

139139
# 5
140140
check_property_5_and_6(function.parameters, function.parameters_ssa)

0 commit comments

Comments
 (0)