19
19
20
20
from hathor .conf import HathorSettings
21
21
from hathor .feature_activation .feature import Feature
22
- from hathor .feature_activation .feature_service import FeatureService
22
+ from hathor .feature_activation .feature_service import (
23
+ BlockIsMissingSignal ,
24
+ BlockIsSignaling ,
25
+ BlockSignalingState ,
26
+ FeatureService ,
27
+ )
23
28
from hathor .feature_activation .model .criteria import Criteria
24
29
from hathor .feature_activation .model .feature_description import FeatureDescription
25
30
from hathor .feature_activation .model .feature_state import FeatureState
@@ -655,29 +660,29 @@ def test_get_ancestor_at_height_voided(
655
660
656
661
657
662
@pytest .mark .parametrize (
658
- ['bit' , 'threshold' , 'block_height' , 'is_signaling ' ],
663
+ ['bit' , 'threshold' , 'block_height' , 'signaling_state ' ],
659
664
[
660
- (0 , 4 , 0 , True ),
661
- (0 , 4 , 3 , True ),
662
- (0 , 4 , 7 , True ),
663
- (0 , 4 , 8 , True ),
664
- (0 , 4 , 11 , True ),
665
- (0 , 4 , 12 , True ),
666
-
667
- (1 , 4 , 0 , True ),
668
- (1 , 4 , 3 , True ),
669
- (1 , 4 , 7 , True ),
670
- (1 , 4 , 8 , True ),
671
- (1 , 4 , 9 , True ),
672
- (1 , 4 , 10 , False ),
673
- (1 , 4 , 11 , False ),
674
- (1 , 4 , 12 , True ),
675
-
676
- (2 , 2 , 8 , True ),
677
- (2 , 2 , 9 , True ),
678
- (2 , 2 , 10 , True ),
679
- (2 , 2 , 11 , False ),
680
- (2 , 2 , 12 , True ),
665
+ (0 , 4 , 0 , BlockIsSignaling () ),
666
+ (0 , 4 , 3 , BlockIsSignaling () ),
667
+ (0 , 4 , 7 , BlockIsSignaling () ),
668
+ (0 , 4 , 8 , BlockIsSignaling () ),
669
+ (0 , 4 , 11 , BlockIsSignaling () ),
670
+ (0 , 4 , 12 , BlockIsSignaling () ),
671
+
672
+ (1 , 4 , 0 , BlockIsSignaling () ),
673
+ (1 , 4 , 3 , BlockIsSignaling () ),
674
+ (1 , 4 , 7 , BlockIsSignaling () ),
675
+ (1 , 4 , 8 , BlockIsSignaling () ),
676
+ (1 , 4 , 9 , BlockIsSignaling () ),
677
+ (1 , 4 , 10 , BlockIsMissingSignal ( feature = Feature . NOP_FEATURE_1 ) ),
678
+ (1 , 4 , 11 , BlockIsMissingSignal ( feature = Feature . NOP_FEATURE_1 ) ),
679
+ (1 , 4 , 12 , BlockIsSignaling () ),
680
+
681
+ (2 , 2 , 8 , BlockIsSignaling () ),
682
+ (2 , 2 , 9 , BlockIsSignaling () ),
683
+ (2 , 2 , 10 , BlockIsSignaling () ),
684
+ (2 , 2 , 11 , BlockIsMissingSignal ( feature = Feature . NOP_FEATURE_1 ) ),
685
+ (2 , 2 , 12 , BlockIsSignaling () ),
681
686
]
682
687
)
683
688
def test_check_must_signal (
@@ -686,7 +691,7 @@ def test_check_must_signal(
686
691
bit : int ,
687
692
threshold : int ,
688
693
block_height : int ,
689
- is_signaling : bool
694
+ signaling_state : BlockSignalingState
690
695
) -> None :
691
696
feature_settings = FeatureSettings (
692
697
evaluation_interval = 4 ,
@@ -706,4 +711,4 @@ def test_check_must_signal(
706
711
707
712
result = service .is_signaling_mandatory_features (block )
708
713
709
- assert result is is_signaling
714
+ assert result == signaling_state
0 commit comments