Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[explorer/nodewatch] fix: update the catapult compatible matrix #1204

Merged
merged 3 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions explorer/nodewatch/nodewatch/RoutesFacade.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,16 @@ def __init__(self, network, explorer_endpoint, min_cluster_size=MIN_HEIGHT_CLUST
"""Creates a facade."""

super().__init__(network, explorer_endpoint, 'symbol', 'Symbol', self._version_to_css_class, {
'1.0.3.6': (COMPATIBLE_VERSION_COLORS[0], 11),
'1.0.3.5': (COMPATIBLE_VERSION_COLORS[1], 10),
'1.0.3.4': (COMPATIBLE_VERSION_COLORS[2], 9),
'delegating / updating': (AMBIGUOUS_COLORS[0], 8),
'1.0.3.3': (INCOMPATIBLE_VERSION_COLORS[-1], 7),
'1.0.3.1': (INCOMPATIBLE_VERSION_COLORS[-2], 6),
'1.0.3.0': (INCOMPATIBLE_VERSION_COLORS[-3], 5),
'0.0.0.0': (INCOMPATIBLE_VERSION_COLORS[-5], 1)
'1.0.3.7': (COMPATIBLE_VERSION_COLORS[0], 10),
'delegating / updating': (AMBIGUOUS_COLORS[0], 9),
'1.0.3.6': (INCOMPATIBLE_VERSION_COLORS[1], 8),
'1.0.3.5': (INCOMPATIBLE_VERSION_COLORS[1], 7),
'1.0.3.4': (INCOMPATIBLE_VERSION_COLORS[1], 6),
'1.0.3.3': (INCOMPATIBLE_VERSION_COLORS[1], 5),
'1.0.3.2': (INCOMPATIBLE_VERSION_COLORS[1], 4),
'1.0.3.1': (INCOMPATIBLE_VERSION_COLORS[1], 3),
'1.0.3.0': (INCOMPATIBLE_VERSION_COLORS[1], 2),
'0.0.0.0': (INCOMPATIBLE_VERSION_COLORS[1], 1)
}, min_cluster_size)

def html_voters(self):
Expand Down Expand Up @@ -238,7 +240,7 @@ def _version_to_css_class(version):
tag = 'danger'
if not version:
tag = 'warning'
if version.startswith('1.0.3.') and not any(version.endswith(f'.{build}') for build in (0, 1, 2, 3)):
if version.startswith('1.0.3.') and not any(version.endswith(f'.{build}') for build in range(7)):
tag = 'success'

return tag
4 changes: 2 additions & 2 deletions explorer/nodewatch/tests/test_RoutesFacade.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,12 +449,12 @@ def test_can_retrieve_estimated_network_height_json(self):
# region utils

def test_can_map_version_to_css_class(self):
for version in ['1.0.3.6', '1.0.3.5', '1.0.3.4']:
for version in ['1.0.3.7']:
self.assertEqual('success', _map_version_to_css_class(SymbolRoutesFacade, version))

self.assertEqual('warning', _map_version_to_css_class(SymbolRoutesFacade, ''))

for version in ['1.0.3.3', '1.0.3.1', '1.0.3.0', '1.0.2.0', '1.0.1.0', '0.0.0.0']:
for version in ['1.0.3.6', '1.0.3.5', '1.0.3.4', '1.0.3.3', '1.0.3.1', '1.0.3.0', '1.0.2.0', '1.0.1.0', '0.0.0.0']:
self.assertEqual('danger', _map_version_to_css_class(SymbolRoutesFacade, version))

# endregion
Loading