Skip to content
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
2 changes: 1 addition & 1 deletion hathor/cli/openapi_files/openapi_base.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
],
"info": {
"title": "Hathor API",
"version": "0.64.0"
"version": "0.65.0"
},
"consumes": [
"application/json"
Expand Down
4 changes: 2 additions & 2 deletions hathor/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@

from structlog import get_logger

BASE_VERSION = '0.64.0'
BASE_VERSION = '0.65.0'

DEFAULT_VERSION_SUFFIX = "local"
BUILD_VERSION_FILE_PATH = "./BUILD_VERSION"

# Valid formats: 1.2.3, 1.2.3-rc.1 and nightly-ab49c20f
BUILD_VERSION_REGEX = r"^(\d+\.\d+\.\d+(-rc\.\d+)?|nightly-[a-f0-9]{7,8})$"
BUILD_VERSION_REGEX = r"^(\d+\.\d+\.\d+(-(rc|alpha|beta)\.\d+)?|nightly-[a-f0-9]{7,8})$"


logger = get_logger()
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

[tool.poetry]
name = "hathor"
version = "0.64.0"
version = "0.65.0"
description = "Hathor Network full-node"
authors = ["Hathor Team <contact@hathor.network>"]
license = "Apache-2.0"
Expand Down
38 changes: 32 additions & 6 deletions tests/feature_activation/test_criteria.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,18 +143,44 @@ def test_minimum_activation_height(minimum_activation_height: int, error: str) -
assert errors[0]['msg'] == error


_invalid_version_msg = r'string does not match regex "^(\d+\.\d+\.\d+(-(rc|alpha|beta)\.\d+)?|nightly-[a-f0-9]{7,8})$"'


@pytest.mark.parametrize(
['version', 'error'],
['version'],
[
('0', 'string does not match regex "^(\\d+\\.\\d+\\.\\d+(-rc\\.\\d+)?|nightly-[a-f0-9]{7,8})$"'),
('alpha', 'string does not match regex "^(\\d+\\.\\d+\\.\\d+(-rc\\.\\d+)?|nightly-[a-f0-9]{7,8})$"'),
('0.0', 'string does not match regex "^(\\d+\\.\\d+\\.\\d+(-rc\\.\\d+)?|nightly-[a-f0-9]{7,8})$"')
('0',),
('alpha',),
('0.0',),
('0.0.0-',),
('0.1.0-alpha',),
('0.1.0-alpha.x',),
('0.1.0-gamma.1',),
('0.1.0-RC.1',),
]
)
def test_version(version: str, error: str) -> None:
def test_invalid_version(version: str) -> None:
criteria = VALID_CRITERIA | dict(version=version)
with pytest.raises(ValidationError) as e:
Criteria(**criteria).to_validated(evaluation_interval=1000, max_signal_bits=2) # type: ignore[arg-type]

errors = e.value.errors()
assert errors[0]['msg'] == error
assert errors[0]['msg'] == _invalid_version_msg


@pytest.mark.parametrize(
['version'],
[
('1.0.0',),
('1.2.3',),
('1.22222.30000',),
('1.2.3-alpha.1',),
('1.2.3-alpha.2',),
('1.2.3-rc.2',),
('1.2.3-beta.2',),
('1.2.3-alpha.299',),
]
)
def test_valid_version(version: str) -> None:
criteria = VALID_CRITERIA | dict(version=version)
Criteria(**criteria).to_validated(evaluation_interval=1000, max_signal_bits=2) # type: ignore[arg-type]
Loading