From 3245c0fff0813e1070e9eef572c170650e43e444 Mon Sep 17 00:00:00 2001 From: derekpierre Date: Fri, 8 Mar 2024 12:11:35 -0500 Subject: [PATCH] Add test about trying to perform finalize when there isn't an existing active tx. --- tests/test_tracker.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_tracker.py b/tests/test_tracker.py index aa04201..1454d74 100644 --- a/tests/test_tracker.py +++ b/tests/test_tracker.py @@ -359,6 +359,11 @@ def test_update_failed_retry_attempt(eip1559_transaction, legacy_transaction, mo @pytest_twisted.inlineCallbacks def test_finalize_active_tx(eip1559_transaction, mocker, tx_receipt): tx_tracker = _TxTracker(disk_cache=False) + + with pytest.raises(RuntimeError, match="No pending transaction to finalize"): + # there is no active tx + tx_tracker.finalize_active_tx(mocker.Mock()) + broadcast_hook = mocker.Mock() broadcast_failure_hook = mocker.Mock() fault_hook = mocker.Mock()