Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test_send_unsigned_transaction #1557

Merged
merged 1 commit into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions safe_eth/eth/tests/clients/test_blockscout_client.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import unittest

from django.test import TestCase

import pytest

from ... import EthereumNetwork
Expand All @@ -10,7 +8,7 @@
from .mocks import safe_proxy_abi_mock, sourcify_safe_metadata


class TestBlockscoutClient(TestCase):
class TestBlockscoutClient(unittest.TestCase):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think is not necessary Django support for this test because there is not any Django model involved.
Extending Django TestCase require a database connection and is not necessary for this test.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, are more tests inheriting from Django TestCase?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I´ll keep an eye on it.

@pytest.mark.flaky(reruns=5)
def test_blockscout_client(self):
with self.assertRaises(BlockScoutConfigurationProblem):
Expand Down
8 changes: 1 addition & 7 deletions safe_eth/eth/tests/test_ethereum_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
TracingManager,
get_auto_ethereum_client,
)
from ..exceptions import BatchCallException, ChainIdIsRequired, InvalidERC20Info
from ..exceptions import BatchCallException, InvalidERC20Info
from .ethereum_test_case import EthereumTestCaseMixin
from .mocks.mock_internal_txs import creation_internal_txs, internal_txs_errored
from .mocks.mock_log_receipts import invalid_log_receipt, log_receipts
Expand Down Expand Up @@ -1270,12 +1270,6 @@ def test_send_unsigned_transaction(self):
"gas": 25000,
"gasPrice": self.ethereum_client.w3.eth.gas_price,
}
with self.assertRaises(ChainIdIsRequired):
self.ethereum_client.send_unsigned_transaction(
tx, private_key=random_sender_account.key
)

tx["chainId"] = 1
with self.assertRaises(InsufficientFunds):
self.ethereum_client.send_unsigned_transaction(
tx, private_key=random_sender_account.key
Expand Down
Loading