Skip to content

Commit

Permalink
review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
glevco committed Mar 21, 2024
1 parent 5086127 commit ed8023e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 2 additions & 3 deletions hathor/feature_activation/bit_signaling_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,9 @@ def remove_feature_support(self, feature: Feature) -> None:

def on_must_signal(self, feature: Feature) -> None:
"""
When the MUST_SIGNAL phase is reached, feature support is automatically enabled, unless explicitly disabled.
When the MUST_SIGNAL phase is reached, feature support is automatically enabled.
"""
if feature not in self._not_support_features:
self.add_feature_support(feature)
self.add_feature_support(feature)

def _log_signal_bits(self, feature: Feature, enable_bit: bool, support: bool, not_support: bool) -> None:
"""Generate info log for a feature's signal."""
Expand Down
6 changes: 4 additions & 2 deletions tests/feature_activation/test_bit_signaling_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,12 +295,13 @@ def test_on_must_signal_not_supported() -> None:
tx_storage=Mock(),
support_features=set(),
not_support_features={Feature.NOP_FEATURE_1},
feature_storage=Mock(),
)

service.on_must_signal(feature=Feature.NOP_FEATURE_1)

assert service._support_features == set()
assert service._not_support_features == {Feature.NOP_FEATURE_1}
assert service._support_features == {Feature.NOP_FEATURE_1}
assert service._not_support_features == set()


def test_on_must_signal_supported() -> None:
Expand All @@ -310,6 +311,7 @@ def test_on_must_signal_supported() -> None:
tx_storage=Mock(),
support_features=set(),
not_support_features=set(),
feature_storage=Mock(),
)

service.on_must_signal(feature=Feature.NOP_FEATURE_1)
Expand Down

0 comments on commit ed8023e

Please sign in to comment.