diff --git a/silkaj/tx.py b/silkaj/tx.py index edbe3b1674e1511d2d7b4e771578bb7e8dcfb869..2a492b609d3eb2a43fdde37a6c6281b55632dee6 100644 --- a/silkaj/tx.py +++ b/silkaj/tx.py @@ -18,7 +18,6 @@ along with Silkaj. If not, see <https://www.gnu.org/licenses/>. from re import compile, search import math from asyncio import sleep -from tabulate import tabulate from click import command, option, FloatRange from silkaj import cli_tools @@ -129,10 +128,15 @@ async def send_transaction( issuer_pubkey, ) + # create display table + table = tui.create_table() + table.set_header_align(["l", "l"]) + table.set_cols_align(["l", "l"]) + if ( yes or input( - tabulate( + table.add_rows( await transaction_confirmation( issuer_pubkey, pubkey_amount[0], @@ -141,8 +145,8 @@ async def send_transaction( outputbackchange, comment, ), - tablefmt="fancy_grid", - ) + header=False, + ).draw() + "\nDo you confirm sending this transaction? [yes/no]: " ) == "yes" diff --git a/tests/test_unit_tx.py b/tests/test_unit_tx.py index bcab87b3ec67a5842d7a19125ccf0004c9c0746f..3ed089dd1a2b854e0f04aec612d9783950193f45 100644 --- a/tests/test_unit_tx.py +++ b/tests/test_unit_tx.py @@ -939,7 +939,9 @@ def test_send_transaction( return args_list # mocking functions - patched_transaction_confirmation = AsyncMock(return_value=None) + patched_transaction_confirmation = AsyncMock( + return_value=[["fake", "list"], ["one", "two"]] + ) # return fake values for confirmation table patched_handle_intermediaries_transactions = AsyncMock(return_value=None) # patching functions