Skip to content

Commit

Permalink
Review from Selsta
Browse files Browse the repository at this point in the history
  • Loading branch information
fbeutin-ledger committed Jul 22, 2022
1 parent c74b965 commit b2831be
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 33 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ endif
#DEFINES += MONERO_BETA

APPVERSION_M=1
APPVERSION_N=7
APPVERSION_P=9
APPVERSION_N=8
APPVERSION_P=0

APPVERSION=$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)
SPECVERSION="1.0"
Expand Down
2 changes: 1 addition & 1 deletion src/monero_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ void monero_install(unsigned char netId) {
/* ----------------------------------------------------------------------- */
/* --- Reset --- */
/* ----------------------------------------------------------------------- */
const char* const monero_supported_client[] = {"0.17.0.", "0.17.1.", "0.17.2.", "0.17.3."};
const char* const monero_supported_client[] = {"0.18.0."};
#define MONERO_SUPPORTED_CLIENT_SIZE \
(sizeof(monero_supported_client) / sizeof(monero_supported_client[0]))

Expand Down
11 changes: 7 additions & 4 deletions tests/test_sig.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import pytest

from monero_client.monero_types import SigType, Keys
from monero_client.exception import ClientNotSupported


@pytest.mark.incremental
Expand Down Expand Up @@ -47,10 +48,12 @@ def state():

@staticmethod
def test_set_sig(monero):
major, minor, patch = monero.reset_and_get_version(
monero_client_version=b"0.17.0.0"
) # type: int, int, int
assert (major, minor) == (1, 7) # version of the Monero app
# Send a reset, ignore the version check and version related errors.
# They belong in a dedicated test
with pytest.raises(ClientNotSupported) as excinfo:
monero.reset_and_get_version(
monero_client_version=b"0.0.0.0"
)

sig_mode: SigType = monero.set_signature_mode(sig_type=SigType.REAL)
assert sig_mode == SigType.REAL
Expand Down
31 changes: 5 additions & 26 deletions tests/test_version.py
Original file line number Diff line number Diff line change
@@ -1,38 +1,17 @@
import pytest

# pylint: disable=wildcard-import, unused-wildcard-import
from monero_client.exception import *
from monero_client.exception import ClientNotSupported


def test_version(monero):
major, minor, patch = monero.reset_and_get_version(
monero_client_version=b"0.17.0.0"
monero_client_version=b"0.18.0.0"
) # type: int, int, int

assert (major, minor) == (1, 7) # version of the Monero app
assert (major, minor) == (1, 8) # version of the Monero app

# another compatible version of the Monero client
major, minor, patch = monero.reset_and_get_version(
monero_client_version=b"0.17.1.0"
) # type: int, int, int

assert (major, minor) == (1, 7) # version of the Monero app

# another compatible version of the Monero client
major, minor, patch = monero.reset_and_get_version(
monero_client_version=b"0.17.2.0"
) # type: int, int, int

assert (major, minor) == (1, 7) # version of the Monero app

# another compatible version of the Monero client
major, minor, patch = monero.reset_and_get_version(
monero_client_version=b"0.17.3.0"
) # type: int, int, int

assert (major, minor) == (1, 7) # version of the Monero app

@pytest.mark.xfail(raises=ClientNotSupported)
def test_old_client_version(monero):
# should raise ClientNotSupported[0x6a30]
monero.reset_and_get_version(b"0.15.0.0")
with pytest.raises(ClientNotSupported) as excinfo:
monero.reset_and_get_version(b"0.17.0.0")

0 comments on commit b2831be

Please sign in to comment.