File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 14
14
Tuple ,
15
15
Type ,
16
16
)
17
+ from typing import Set # noqa: F401
17
18
18
19
import rlp
19
20
@@ -756,19 +757,29 @@ def get_transaction_class(cls) -> Type[BaseTransaction]:
756
757
#
757
758
@classmethod
758
759
def validate_receipt (cls , receipt : Receipt ) -> None :
760
+ already_checked = set () # type: Set[Hash32]
761
+
759
762
for log_idx , log in enumerate (receipt .logs ):
760
- if log .address not in receipt .bloom_filter :
763
+ if log .address in already_checked :
764
+ continue
765
+ elif log .address not in receipt .bloom_filter :
761
766
raise ValidationError (
762
767
"The address from the log entry at position {0} is not "
763
768
"present in the provided bloom filter." .format (log_idx )
764
769
)
770
+ already_checked .add (log .address )
771
+
772
+ for log_idx , log in enumerate (receipt .logs ):
765
773
for topic_idx , topic in enumerate (log .topics ):
766
- if uint32 .serialize (topic ) not in receipt .bloom_filter :
774
+ if topic in already_checked :
775
+ continue
776
+ elif uint32 .serialize (topic ) not in receipt .bloom_filter :
767
777
raise ValidationError (
768
778
"The topic at position {0} from the log entry at "
769
779
"position {1} is not present in the provided bloom "
770
780
"filter." .format (topic_idx , log_idx )
771
781
)
782
+ already_checked .add (topic )
772
783
773
784
def validate_block (self , block : BaseBlock ) -> None :
774
785
"""
You can’t perform that action at this time.
0 commit comments