From 8b23a88a016376fdf40a89ef3432517dbfca4fc5 Mon Sep 17 00:00:00 2001 From: Danut Ilisei Date: Thu, 6 Jun 2024 10:13:36 +0200 Subject: [PATCH] fix: chain unregistration and unregistration cancelling --- pantos/servicenode/blockchains/ethereum.py | 6 +++--- tests/blockchains/test_ethereum.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pantos/servicenode/blockchains/ethereum.py b/pantos/servicenode/blockchains/ethereum.py index ec09638..6224aa6 100644 --- a/pantos/servicenode/blockchains/ethereum.py +++ b/pantos/servicenode/blockchains/ethereum.py @@ -214,7 +214,7 @@ def unregister_node(self) -> None: request = BlockchainClient._TransactionSubmissionStartRequest( ContractAbi.PANTOS_HUB, _HUB_UNREGISTER_SERVICE_NODE_FUNCTION_SELECTOR, - (self.__address), _HUB_UNREGISTER_SERVICE_NODE_GAS, None, + (self.__address, ), _HUB_UNREGISTER_SERVICE_NODE_GAS, None, nonce) internal_transaction_id = self._start_transaction_submission( request, node_connections) @@ -269,8 +269,8 @@ def cancel_unregistration(self) -> None: request = BlockchainClient._TransactionSubmissionStartRequest( ContractAbi.PANTOS_HUB, _HUB_CANCEL_SERVICE_NODE_UNREGISTRATION_FUNCTION_SELECTOR, - (self.__address), _HUB_CANCEL_SERVICE_NODE_UNREGISTRATION_GAS, - None, nonce) + (self.__address, ), + _HUB_CANCEL_SERVICE_NODE_UNREGISTRATION_GAS, None, nonce) internal_transaction_id = self._start_transaction_submission( request, node_connections) extra_info |= {'internal_transaction_id': internal_transaction_id} diff --git a/tests/blockchains/test_ethereum.py b/tests/blockchains/test_ethereum.py index a671c79..af597fc 100644 --- a/tests/blockchains/test_ethereum.py +++ b/tests/blockchains/test_ethereum.py @@ -610,7 +610,7 @@ def test_unregister_node_correct(mock_start_transaction_submission, mock_start_transaction_submission.assert_called_once() unregister_request = mock_start_transaction_submission.call_args.args[0] assert unregister_request.contract_abi is ContractAbi.PANTOS_HUB - assert unregister_request.function_args == (service_node_address) + assert unregister_request.function_args == (service_node_address, ) @unittest.mock.patch.object(EthereumClient, '_start_transaction_submission', @@ -933,7 +933,7 @@ def test_cancel_unregistration_correct(mock_start_transaction_submission, mock_start_transaction_submission.assert_called_once() cancel_request = mock_start_transaction_submission.call_args.args[0] assert cancel_request.contract_abi is ContractAbi.PANTOS_HUB - assert cancel_request.function_args == (service_node_address) + assert cancel_request.function_args == (service_node_address, ) @unittest.mock.patch.object(EthereumClient, '_start_transaction_submission',