diff --git a/silkaj/tx.py b/silkaj/tx.py index f2ce02736513382f0b6575f2f376a5040df5e28d..2d91a931fb42eaeddc81faaa540183f740e5cf34 100644 --- a/silkaj/tx.py +++ b/silkaj/tx.py @@ -139,7 +139,7 @@ async def send_transaction( if not yes: confirmation_table = tabulate( - await transaction_confirmation( + await gen_confirmation_table( issuer_pubkey, pubkey_amount[0], tx_amounts, @@ -231,7 +231,7 @@ def check_transaction_values( return outputBackChange -async def transaction_confirmation( +async def gen_confirmation_table( issuer_pubkey, pubkey_amount, tx_amounts, diff --git a/tests/patched/tx.py b/tests/patched/tx.py index 51b73070984c87333f7cdaadd40837d6d2afe242..f8cd92f9a1de26b23ceee06c3669a8a83e7379f1 100644 --- a/tests/patched/tx.py +++ b/tests/patched/tx.py @@ -2,7 +2,7 @@ from duniterpy.key import SigningKey from silkaj.tools import message_exit -async def patched_transaction_confirmation( +async def patched_gen_confirmation_table( issuer_pubkey, pubkey_amount, tx_amounts, diff --git a/tests/test_tx.py b/tests/test_tx.py index d6caf2de60c430de757459be9af10b420d8ed6a2..edaa26188665d7ad6abae4cb257d16fbc3b95aac 100644 --- a/tests/test_tx.py +++ b/tests/test_tx.py @@ -33,7 +33,7 @@ from silkaj.constants import ( from patched.money import patched_ud_value, patched_get_sources from patched.test_constants import mock_ud_value from patched.auth import patched_auth_method -from patched.tx import patched_transaction_confirmation +from patched.tx import patched_gen_confirmation_table # AsyncMock available from Python 3.8. asynctest is used for Py < 3.8 if sys.version_info[1] > 7: @@ -229,9 +229,9 @@ def test_tx_passed_all_sources_empty( # patch functions monkeypatch.setattr("silkaj.auth.auth_method", auth_method) monkeypatch.setattr("silkaj.money.get_sources", patched_get_sources) - patched_transaction_confirmation = AsyncMock() + patched_gen_confirmation_table = AsyncMock() monkeypatch.setattr( - "silkaj.tx.transaction_confirmation", patched_transaction_confirmation + "silkaj.tx.transaction_confirmation", patched_gen_confirmation_table ) result = CliRunner().invoke(cli, args=arguments) diff --git a/tests/test_unit_tx.py b/tests/test_unit_tx.py index 89278b6faac69649ff9a787f7e3d64977d14b030..de3a37e32720dbeca602bd55f2abac673582fdc3 100644 --- a/tests/test_unit_tx.py +++ b/tests/test_unit_tx.py @@ -45,7 +45,7 @@ from patched.tools import patched_currency_symbol from patched.blockchain_tools import patched_head_block, fake_block_uid from patched.auth import patched_auth_method from patched.tx import ( - patched_transaction_confirmation, + patched_gen_confirmation_table, patched_handle_intermediaries_transactions, ) @@ -118,7 +118,7 @@ def test_truncBase(amount, base, expected): ], ) @pytest.mark.asyncio -async def test_transaction_confirmation( +async def test_gen_confirmation_table( issuer_pubkey, pubkey_balance, tx_amounts, @@ -170,7 +170,7 @@ async def test_transaction_confirmation( expected.append(["Comment", comment]) # asserting - table_list = await tx.transaction_confirmation( + table_list = await tx.gen_confirmation_table( issuer_pubkey, pubkey_balance, tx_amounts, @@ -939,13 +939,13 @@ def test_send_transaction( return args_list # mocking functions - patched_transaction_confirmation = AsyncMock(return_value=None) + patched_gen_confirmation_table = AsyncMock(return_value=None) patched_handle_intermediaries_transactions = AsyncMock(return_value=None) # patching functions monkeypatch.setattr("silkaj.auth.auth_method", patched_auth_method_tx) monkeypatch.setattr( - "silkaj.tx.transaction_confirmation", patched_transaction_confirmation + "silkaj.tx.gen_confirmation_table", patched_gen_confirmation_table ) monkeypatch.setattr( "silkaj.tx.handle_intermediaries_transactions", @@ -981,7 +981,7 @@ def test_send_transaction( print(result.output) if confirmation_answer: - patched_transaction_confirmation.assert_any_await( + patched_gen_confirmation_table.assert_any_await( key_fifi.pubkey, total_amount, tx_amounts,