From af550fdc649d0c0ad7f9f59f12c69ae1c0bb8c9f Mon Sep 17 00:00:00 2001 From: Moul <moul@moul.re> Date: Fri, 14 Oct 2022 18:36:58 +0200 Subject: [PATCH] Move tx_history.py to money.history.py (#330) --- silkaj/cli.py | 2 +- silkaj/{tx_history.py => money/history.py} | 0 .../{test_tx_history.py => money/test_history.py} | 15 ++++++++------- 3 files changed, 9 insertions(+), 8 deletions(-) rename silkaj/{tx_history.py => money/history.py} (100%) rename tests/{test_tx_history.py => money/test_history.py} (92%) diff --git a/silkaj/cli.py b/silkaj/cli.py index ca6aed10..c80ccac5 100644 --- a/silkaj/cli.py +++ b/silkaj/cli.py @@ -34,8 +34,8 @@ from silkaj.constants import ( from silkaj.g1_monetary_license import license_command from silkaj.membership import send_membership from silkaj.money.balance import cmd_amount +from silkaj.money.history import transaction_history from silkaj.money.transfer import send_transaction -from silkaj.tx_history import transaction_history from silkaj.wot import id_pubkey_correspondence, received_sent_certifications diff --git a/silkaj/tx_history.py b/silkaj/money/history.py similarity index 100% rename from silkaj/tx_history.py rename to silkaj/money/history.py diff --git a/tests/test_tx_history.py b/tests/money/test_history.py similarity index 92% rename from tests/test_tx_history.py rename to tests/money/test_history.py index 8b0ab52b..f05b3633 100644 --- a/tests/test_tx_history.py +++ b/tests/money/test_history.py @@ -15,9 +15,10 @@ import pytest -from silkaj import tx_history, wot_tools +from silkaj import wot_tools from silkaj.constants import PUBKEY_MAX_LENGTH, PUBKEY_MIN_LENGTH, SHORT_PUBKEY_SIZE from silkaj.crypto_tools import CHECKSUM_SIZE +from silkaj.money import history from tests.patched.blockchain_tools import currency from tests.patched.tx_history import patched_get_transactions_history from tests.patched.wot import patched_identities_from_pubkeys @@ -35,7 +36,7 @@ MAX_FULL_PUBKEY_LENGTH_WITH_CHECKSUM = ( ) # char `:` ==> 44 + 3 + 1 = 48 -def test_tx_history_generate_txs_list_and_pubkey_uid_display(monkeypatch): +def test_history_generate_txs_list_and_pubkey_uid_display(monkeypatch): def min_pubkey_length_with_uid(pubkey): # uid is at least one char : "<uid> - <pubkey>" adds min 4 chars to <pubkey> return pubkey + 4 @@ -53,7 +54,7 @@ def test_tx_history_generate_txs_list_and_pubkey_uid_display(monkeypatch): patched_get_transactions_history(client, pubkey, received_txs, sent_txs) # simple table - txs_list = tx_history.generate_txs_list( + txs_list = history.generate_txs_list( received_txs, sent_txs, pubkey, @@ -68,7 +69,7 @@ def test_tx_history_generate_txs_list_and_pubkey_uid_display(monkeypatch): assert len(tx_list[1]) == SHORT_PUBKEY_LENGTH_WITH_CHECKSUM # with uids - txs_list_uids = tx_history.generate_txs_list( + txs_list_uids = history.generate_txs_list( received_txs, sent_txs, pubkey, @@ -91,7 +92,7 @@ def test_tx_history_generate_txs_list_and_pubkey_uid_display(monkeypatch): assert len(txs_list_uids[3][1]) == SHORT_PUBKEY_LENGTH_WITH_CHECKSUM # with full pubkeys - txs_list_full = tx_history.generate_txs_list( + txs_list_full = history.generate_txs_list( received_txs, sent_txs, pubkey, @@ -111,7 +112,7 @@ def test_tx_history_generate_txs_list_and_pubkey_uid_display(monkeypatch): ) # with full pubkeys and uids - txs_list_uids_full = tx_history.generate_txs_list( + txs_list_uids_full = history.generate_txs_list( received_txs, sent_txs, pubkey, @@ -160,4 +161,4 @@ def test_tx_history_generate_txs_list_and_pubkey_uid_display(monkeypatch): ], ) def test_prefix(tx_addresses, outputs, occurence, return_value): - assert tx_history.prefix(tx_addresses, outputs, occurence) == return_value + assert history.prefix(tx_addresses, outputs, occurence) == return_value -- GitLab