From ccb10a39590d1722a15894e1ea40b7df1049b960 Mon Sep 17 00:00:00 2001 From: Uxio Fuentefria <6909403+Uxio0@users.noreply.github.com> Date: Wed, 18 Sep 2024 13:25:46 +0200 Subject: [PATCH] Rename gnosis -> safe_eth package - Also refactor code related to safe-deployments, as know the result type is an `address` list and not an `address` --- requirements.txt | 2 +- .../account_abstraction/admin.py | 3 +- .../account_abstraction/helpers.py | 9 +-- .../management/commands/reindex_4337.py | 3 +- .../migrations/0001_initial.py | 37 +++++---- ...r_safeoperation_module_address_and_more.py | 12 +-- .../account_abstraction/models.py | 11 ++- .../account_abstraction/serializers.py | 13 ++- .../services/aa_processor_service.py | 13 ++- .../account_abstraction/tests/factories.py | 7 +- .../services/test_aa_processor_service.py | 11 ++- .../account_abstraction/tests/test_helpers.py | 5 +- .../account_abstraction/tests/test_models.py | 6 +- .../account_abstraction/tests/test_views.py | 19 +++-- .../account_abstraction/utils.py | 5 +- .../account_abstraction/views.py | 3 +- .../analytics/tests/test_views_v2.py | 3 +- .../commands/update_safe_contracts_logo.py | 6 +- .../contracts/migrations/0001_initial.py | 4 +- .../migrations/0006_contractabi_abi_hash.py | 5 +- .../0008_ethereum_address_field_v2.py | 4 +- .../0009_alter_contractabi_abi_hash.py | 4 +- .../migrations/0012_alter_contract_address.py | 4 +- safe_transaction_service/contracts/models.py | 7 +- .../contracts/serializers.py | 3 +- .../services/contract_metadata_service.py | 5 +- safe_transaction_service/contracts/tasks.py | 5 +- .../contracts/tests/factories.py | 3 +- .../tests/mocks/contract_metadata_mocks.py | 2 +- .../test_contract_metadata_service.py | 5 +- .../contracts/tests/test_commands.py | 2 +- .../contracts/tests/test_models.py | 5 +- .../contracts/tests/test_tx_decoder.py | 5 +- .../contracts/tx_decoder.py | 15 ++-- safe_transaction_service/history/admin.py | 7 +- safe_transaction_service/history/filters.py | 5 +- safe_transaction_service/history/helpers.py | 3 +- .../history/indexers/erc20_events_indexer.py | 3 +- .../history/indexers/ethereum_indexer.py | 3 +- .../history/indexers/internal_tx_indexer.py | 3 +- .../history/indexers/proxy_factory_indexer.py | 11 ++- .../history/indexers/safe_events_indexer.py | 11 ++- .../history/indexers/tx_processor.py | 13 ++- .../commands/check_index_problems.py | 6 +- .../management/commands/fix_ethereum_logs.py | 2 +- .../management/commands/fix_ethereum_txs.py | 2 +- .../commands/send_slack_notification.py | 3 +- .../management/commands/setup_service.py | 5 +- .../history/migrations/0001_initial.py | 32 ++++---- .../migrations/0002_auto_20190725_0857.py | 8 +- .../migrations/0003_auto_20191107_1459.py | 65 ++++++++------- .../migrations/0006_auto_20200113_1204.py | 6 +- .../migrations/0007_auto_20200122_1305.py | 6 +- .../migrations/0010_auto_20200226_1508.py | 4 +- .../migrations/0011_auto_20200303_0956.py | 6 +- .../migrations/0012_moduletransaction.py | 14 ++-- .../migrations/0014_auto_20200327_0954.py | 4 +- ...016_multisigconfirmation_signature_type.py | 3 +- .../migrations/0017_safecontractdelegate.py | 6 +- .../migrations/0023_auto_20200924_0841.py | 4 +- .../migrations/0029_auto_20201118_1015.py | 4 +- .../migrations/0033_auto_20210318_1654.py | 4 +- .../migrations/0036_fix_exec_from_module.py | 2 +- .../migrations/0038_safestatus_guard.py | 4 +- .../0039_safel2mastercopy_20210519.py | 4 +- .../0045_erc20transfer_erc721transfer.py | 24 +++--- ...ck_number_token_transfers_20211126_1443.py | 14 ++-- ...9_block_number_internaltx_20211129_1111.py | 6 +- ...ethereum_address_field_v2_20211201_1507.py | 67 ++++++++-------- .../0052_keccak256_field_20211209_1628.py | 12 +-- .../migrations/0053_alter_webhook_address.py | 4 +- ...56_alter_multisigconfirmation_signature.py | 4 +- .../0060_add_eip1559_fields_20220419_0955.py | 6 +- ...0062_add_safe_last_status_20220429_0922.py | 21 ++--- .../migrations/0063_alter_internaltx__from.py | 4 +- .../migrations/0064_auto_20220523_0919.py | 6 +- .../migrations/0066_auto_20220628_1125.py | 6 +- .../migrations/0067_auto_20220705_1545.py | 6 +- .../0075_multisigtransaction_proposer.py | 4 +- ..._safecontractdelegate_delegate_and_more.py | 6 +- ...80_alter_multisigconfirmation_signature.py | 4 +- ...3_alter_moduletransaction_safe_and_more.py | 4 +- ...0084_alter_erc20transfer__from_and_more.py | 80 +++++++++---------- .../0086_saferelevanttransaction.py | 4 +- safe_transaction_service/history/models.py | 15 ++-- .../history/serializers.py | 17 ++-- .../history/services/balance_service.py | 5 +- .../history/services/collectibles_service.py | 5 +- .../history/services/index_service.py | 3 +- .../history/services/reorg_service.py | 3 +- .../history/services/safe_service.py | 13 ++- .../history/services/transaction_service.py | 3 +- .../history/tests/factories.py | 7 +- .../history/tests/mocks/deployments_mock.py | 36 +++++++++ .../history/tests/mocks/traces.py | 3 +- .../history/tests/test_balance_service.py | 3 +- .../tests/test_collectibles_service.py | 7 +- .../history/tests/test_commands.py | 7 +- .../tests/test_erc20_events_indexer.py | 2 +- .../history/tests/test_helpers.py | 3 +- .../history/tests/test_index_service.py | 7 +- .../history/tests/test_internal_tx_indexer.py | 5 +- .../history/tests/test_migrations.py | 3 +- .../history/tests/test_models.py | 5 +- .../tests/test_proxy_factory_indexer.py | 2 +- .../history/tests/test_reorg_service.py | 2 +- .../history/tests/test_safe_events_indexer.py | 9 +-- .../history/tests/test_safe_service.py | 7 +- .../history/tests/test_signals.py | 5 +- .../history/tests/test_tx_processor.py | 9 +-- .../history/tests/test_views.py | 16 ++-- .../history/tests/test_views_v2.py | 9 +-- safe_transaction_service/history/views.py | 37 ++++----- safe_transaction_service/history/views_v2.py | 3 +- .../migrations/0003_firebasedeviceowner.py | 7 +- .../0005_ethereum_address_field_v2.py | 4 +- .../0007_alter_firebasedeviceowner_owner.py | 4 +- .../notifications/models.py | 2 +- .../notifications/serializers.py | 5 +- .../notifications/tests/test_tasks.py | 3 +- .../notifications/tests/test_views.py | 3 +- .../notifications/utils.py | 3 +- .../safe_messages/migrations/0001_initial.py | 13 ++- ...alter_safemessageconfirmation_signature.py | 4 +- ...osed_by_alter_safemessage_safe_and_more.py | 8 +- .../safe_messages/models.py | 5 +- .../safe_messages/serializers.py | 9 +-- .../safe_messages/tests/factories.py | 3 +- .../safe_messages/tests/test_models.py | 5 +- .../safe_messages/tests/test_signals.py | 5 +- .../safe_messages/tests/test_views.py | 9 +-- .../safe_messages/utils.py | 7 +- .../safe_messages/views.py | 3 +- .../tokens/clients/coingecko_client.py | 3 +- .../tokens/clients/coinmarketcap_client.py | 2 +- .../tokens/clients/kleros_client.py | 5 +- .../tokens/clients/zerion_client.py | 5 +- safe_transaction_service/tokens/filters.py | 5 +- .../tokens/management/commands/add_token.py | 6 +- .../update_tokens_from_coinmarketcap.py | 4 +- .../tokens/migrations/0001_initial.py | 4 +- .../migrations/0002_auto_20200903_1045.py | 3 +- ...ethereum_address_field_v2_20211201_1512.py | 4 +- .../migrations/0006_auto_20220214_1629.py | 4 +- .../migrations/0008_alter_token_copy_price.py | 4 +- .../tokens/migrations/0010_tokenlist.py | 2 +- ...er_token_address_alter_token_copy_price.py | 6 +- safe_transaction_service/tokens/models.py | 5 +- .../tokens/serializers.py | 3 +- safe_transaction_service/tokens/tasks.py | 5 +- .../tests/clients/test_coingecko_client.py | 2 +- .../clients/test_coinmarketcap_client.py | 2 +- .../tests/clients/test_kleros_client.py | 4 +- .../tests/clients/test_zerion_client.py | 3 +- .../tests/migrations/test_migrations.py | 3 +- .../tokens/tests/test_commands.py | 11 ++- .../tokens/tests/test_models.py | 5 +- .../tokens/tests/test_tasks.py | 3 +- .../tokens/tests/test_views.py | 5 +- safe_transaction_service/tokens/views.py | 3 +- safe_transaction_service/utils/auth.py | 4 +- safe_transaction_service/utils/ethereum.py | 2 +- safe_transaction_service/utils/serializers.py | 5 +- scripts/benchmark_node.py | 3 +- 164 files changed, 611 insertions(+), 648 deletions(-) diff --git a/requirements.txt b/requirements.txt index 71c137bb2..535c0acee 100644 --- a/requirements.txt +++ b/requirements.txt @@ -33,5 +33,5 @@ psycogreen==1.0.2 psycopg2==2.9.9 redis==5.0.7 requests==2.32.3 -safe-eth-py[django]==6.0.0b35 +safe-eth-py[django]==6.0.0b37 web3==6.20.2 diff --git a/safe_transaction_service/account_abstraction/admin.py b/safe_transaction_service/account_abstraction/admin.py index c2922a276..c57374191 100644 --- a/safe_transaction_service/account_abstraction/admin.py +++ b/safe_transaction_service/account_abstraction/admin.py @@ -2,8 +2,7 @@ from eth_typing import ChecksumAddress from hexbytes import HexBytes - -from gnosis.eth.django.admin import AdvancedAdminSearchMixin +from safe_eth.eth.django.admin import AdvancedAdminSearchMixin from .models import SafeOperation, UserOperation, UserOperationReceipt diff --git a/safe_transaction_service/account_abstraction/helpers.py b/safe_transaction_service/account_abstraction/helpers.py index 20737cb4a..43423043a 100644 --- a/safe_transaction_service/account_abstraction/helpers.py +++ b/safe_transaction_service/account_abstraction/helpers.py @@ -2,11 +2,10 @@ from typing import List from eth_typing import ChecksumAddress - -from gnosis.eth import EthereumClient -from gnosis.eth.contracts import get_safe_V1_4_1_contract -from gnosis.eth.utils import fast_to_checksum_address -from gnosis.safe.proxy_factory import ProxyFactoryV141 +from safe_eth.eth import EthereumClient +from safe_eth.eth.contracts import get_safe_V1_4_1_contract +from safe_eth.eth.utils import fast_to_checksum_address +from safe_eth.safe.proxy_factory import ProxyFactoryV141 @dataclasses.dataclass(eq=True, frozen=True) diff --git a/safe_transaction_service/account_abstraction/management/commands/reindex_4337.py b/safe_transaction_service/account_abstraction/management/commands/reindex_4337.py index 3e0dc7381..7213b3c9c 100644 --- a/safe_transaction_service/account_abstraction/management/commands/reindex_4337.py +++ b/safe_transaction_service/account_abstraction/management/commands/reindex_4337.py @@ -3,8 +3,7 @@ from django.core.management.base import BaseCommand from eth_typing import ChecksumAddress - -from gnosis.eth.utils import fast_to_checksum_address +from safe_eth.eth.utils import fast_to_checksum_address from safe_transaction_service.history.models import EthereumTx diff --git a/safe_transaction_service/account_abstraction/migrations/0001_initial.py b/safe_transaction_service/account_abstraction/migrations/0001_initial.py index 882bfa276..f9984be60 100644 --- a/safe_transaction_service/account_abstraction/migrations/0001_initial.py +++ b/safe_transaction_service/account_abstraction/migrations/0001_initial.py @@ -5,8 +5,7 @@ from django.db import migrations, models import model_utils.fields - -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -39,7 +38,7 @@ class Migration(migrations.Migration): ), ( "hash", - gnosis.eth.django.models.Keccak256Field( + safe_eth.eth.django.models.Keccak256Field( primary_key=True, serialize=False ), ), @@ -47,7 +46,7 @@ class Migration(migrations.Migration): ("valid_until", models.DateTimeField(null=True)), ( "module_address", - gnosis.eth.django.models.EthereumAddressV2Field(db_index=True), + safe_eth.eth.django.models.EthereumAddressV2Field(db_index=True), ), ], options={ @@ -82,10 +81,10 @@ class Migration(migrations.Migration): verbose_name="modified", ), ), - ("owner", gnosis.eth.django.models.EthereumAddressV2Field()), + ("owner", safe_eth.eth.django.models.EthereumAddressV2Field()), ( "signature", - gnosis.eth.django.models.HexV2Field( + safe_eth.eth.django.models.HexV2Field( default=None, max_length=5000, null=True ), ), @@ -119,25 +118,25 @@ class Migration(migrations.Migration): fields=[ ( "hash", - gnosis.eth.django.models.Keccak256Field( + safe_eth.eth.django.models.Keccak256Field( primary_key=True, serialize=False ), ), ( "sender", - gnosis.eth.django.models.EthereumAddressV2Field(db_index=True), + safe_eth.eth.django.models.EthereumAddressV2Field(db_index=True), ), - ("nonce", gnosis.eth.django.models.Uint256Field()), + ("nonce", safe_eth.eth.django.models.Uint256Field()), ("init_code", models.BinaryField(blank=True, editable=True, null=True)), ("call_data", models.BinaryField(blank=True, editable=True, null=True)), - ("call_data_gas_limit", gnosis.eth.django.models.Uint256Field()), - ("verification_gas_limit", gnosis.eth.django.models.Uint256Field()), - ("pre_verification_gas", gnosis.eth.django.models.Uint256Field()), - ("max_fee_per_gas", gnosis.eth.django.models.Uint256Field()), - ("max_priority_fee_per_gas", gnosis.eth.django.models.Uint256Field()), + ("call_data_gas_limit", safe_eth.eth.django.models.Uint256Field()), + ("verification_gas_limit", safe_eth.eth.django.models.Uint256Field()), + ("pre_verification_gas", safe_eth.eth.django.models.Uint256Field()), + ("max_fee_per_gas", safe_eth.eth.django.models.Uint256Field()), + ("max_priority_fee_per_gas", safe_eth.eth.django.models.Uint256Field()), ( "paymaster", - gnosis.eth.django.models.EthereumAddressV2Field( + safe_eth.eth.django.models.EthereumAddressV2Field( blank=True, db_index=True, null=True ), ), @@ -148,7 +147,7 @@ class Migration(migrations.Migration): ("signature", models.BinaryField(blank=True, editable=True, null=True)), ( "entry_point", - gnosis.eth.django.models.EthereumAddressV2Field(db_index=True), + safe_eth.eth.django.models.EthereumAddressV2Field(db_index=True), ), ( "ethereum_tx", @@ -182,11 +181,11 @@ class Migration(migrations.Migration): verbose_name="ID", ), ), - ("actual_gas_cost", gnosis.eth.django.models.Uint256Field()), - ("actual_gas_used", gnosis.eth.django.models.Uint256Field()), + ("actual_gas_cost", safe_eth.eth.django.models.Uint256Field()), + ("actual_gas_used", safe_eth.eth.django.models.Uint256Field()), ("success", models.BooleanField()), ("reason", models.CharField(max_length=256)), - ("deposited", gnosis.eth.django.models.Uint256Field()), + ("deposited", safe_eth.eth.django.models.Uint256Field()), ( "user_operation", models.OneToOneField( diff --git a/safe_transaction_service/account_abstraction/migrations/0005_alter_safeoperation_module_address_and_more.py b/safe_transaction_service/account_abstraction/migrations/0005_alter_safeoperation_module_address_and_more.py index 5440844a4..9060ca863 100644 --- a/safe_transaction_service/account_abstraction/migrations/0005_alter_safeoperation_module_address_and_more.py +++ b/safe_transaction_service/account_abstraction/migrations/0005_alter_safeoperation_module_address_and_more.py @@ -2,7 +2,7 @@ from django.db import migrations -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -18,28 +18,28 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="safeoperation", name="module_address", - field=gnosis.eth.django.models.EthereumAddressBinaryField(db_index=True), + field=safe_eth.eth.django.models.EthereumAddressBinaryField(db_index=True), ), migrations.AlterField( model_name="safeoperationconfirmation", name="owner", - field=gnosis.eth.django.models.EthereumAddressBinaryField(), + field=safe_eth.eth.django.models.EthereumAddressBinaryField(), ), migrations.AlterField( model_name="useroperation", name="entry_point", - field=gnosis.eth.django.models.EthereumAddressBinaryField(db_index=True), + field=safe_eth.eth.django.models.EthereumAddressBinaryField(db_index=True), ), migrations.AlterField( model_name="useroperation", name="paymaster", - field=gnosis.eth.django.models.EthereumAddressBinaryField( + field=safe_eth.eth.django.models.EthereumAddressBinaryField( blank=True, db_index=True, null=True ), ), migrations.AlterField( model_name="useroperation", name="sender", - field=gnosis.eth.django.models.EthereumAddressBinaryField(db_index=True), + field=safe_eth.eth.django.models.EthereumAddressBinaryField(db_index=True), ), ] diff --git a/safe_transaction_service/account_abstraction/models.py b/safe_transaction_service/account_abstraction/models.py index 951b1d50d..3bcb5f9f3 100644 --- a/safe_transaction_service/account_abstraction/models.py +++ b/safe_transaction_service/account_abstraction/models.py @@ -8,17 +8,16 @@ from eth_abi.packed import encode_packed from hexbytes import HexBytes from model_utils.models import TimeStampedModel - -from gnosis.eth.account_abstraction import UserOperation as UserOperationClass -from gnosis.eth.account_abstraction import UserOperationMetadata -from gnosis.eth.django.models import ( +from safe_eth.eth.account_abstraction import UserOperation as UserOperationClass +from safe_eth.eth.account_abstraction import UserOperationMetadata +from safe_eth.eth.django.models import ( EthereumAddressBinaryField, HexV2Field, Keccak256Field, Uint256Field, ) -from gnosis.safe.account_abstraction import SafeOperation as SafeOperationClass -from gnosis.safe.safe_signature import SafeSignatureType +from safe_eth.safe.account_abstraction import SafeOperation as SafeOperationClass +from safe_eth.safe.safe_signature import SafeSignatureType from safe_transaction_service.history import models as history_models from safe_transaction_service.utils.constants import SIGNATURE_LENGTH diff --git a/safe_transaction_service/account_abstraction/serializers.py b/safe_transaction_service/account_abstraction/serializers.py index 50146c625..499f3da73 100644 --- a/safe_transaction_service/account_abstraction/serializers.py +++ b/safe_transaction_service/account_abstraction/serializers.py @@ -5,17 +5,16 @@ from django.db import transaction from django.utils import timezone +import safe_eth.eth.django.serializers as eth_serializers from eth_typing import ChecksumAddress, HexStr from hexbytes import HexBytes from rest_framework import serializers from rest_framework.exceptions import ValidationError - -import gnosis.eth.django.serializers as eth_serializers -from gnosis.eth import get_auto_ethereum_client -from gnosis.eth.account_abstraction import UserOperation as UserOperationClass -from gnosis.eth.utils import fast_keccak, fast_to_checksum_address -from gnosis.safe.account_abstraction import SafeOperation as SafeOperationClass -from gnosis.safe.safe_signature import SafeSignature, SafeSignatureType +from safe_eth.eth import get_auto_ethereum_client +from safe_eth.eth.account_abstraction import UserOperation as UserOperationClass +from safe_eth.eth.utils import fast_keccak, fast_to_checksum_address +from safe_eth.safe.account_abstraction import SafeOperation as SafeOperationClass +from safe_eth.safe.safe_signature import SafeSignature, SafeSignatureType from safe_transaction_service.utils.constants import SIGNATURE_LENGTH from safe_transaction_service.utils.ethereum import get_chain_id diff --git a/safe_transaction_service/account_abstraction/services/aa_processor_service.py b/safe_transaction_service/account_abstraction/services/aa_processor_service.py index 98b062c20..bcb2de9fa 100644 --- a/safe_transaction_service/account_abstraction/services/aa_processor_service.py +++ b/safe_transaction_service/account_abstraction/services/aa_processor_service.py @@ -7,19 +7,18 @@ from eth_typing import ChecksumAddress, HexStr from hexbytes import HexBytes -from web3.types import LogReceipt - -from gnosis.eth import EthereumClient, get_auto_ethereum_client -from gnosis.eth.account_abstraction import ( +from safe_eth.eth import EthereumClient, get_auto_ethereum_client +from safe_eth.eth.account_abstraction import ( BundlerClient, BundlerClientException, UserOperation, UserOperationReceipt, UserOperationV07, ) -from gnosis.eth.utils import fast_to_checksum_address -from gnosis.safe.account_abstraction import SafeOperation -from gnosis.safe.safe_signature import SafeSignature +from safe_eth.eth.utils import fast_to_checksum_address +from safe_eth.safe.account_abstraction import SafeOperation +from safe_eth.safe.safe_signature import SafeSignature +from web3.types import LogReceipt from safe_transaction_service.history import models as history_models diff --git a/safe_transaction_service/account_abstraction/tests/factories.py b/safe_transaction_service/account_abstraction/tests/factories.py index df1957888..20b28a4a0 100644 --- a/safe_transaction_service/account_abstraction/tests/factories.py +++ b/safe_transaction_service/account_abstraction/tests/factories.py @@ -5,10 +5,9 @@ from eth_abi.packed import encode_packed from eth_account import Account from factory.django import DjangoModelFactory - -from gnosis.eth.constants import NULL_ADDRESS -from gnosis.eth.utils import fast_keccak_text -from gnosis.safe.safe_signature import SafeSignatureType +from safe_eth.eth.constants import NULL_ADDRESS +from safe_eth.eth.utils import fast_keccak_text +from safe_eth.safe.safe_signature import SafeSignatureType from safe_transaction_service.history.tests import factories as history_factories diff --git a/safe_transaction_service/account_abstraction/tests/services/test_aa_processor_service.py b/safe_transaction_service/account_abstraction/tests/services/test_aa_processor_service.py index a3bd517a1..6f8b501f1 100644 --- a/safe_transaction_service/account_abstraction/tests/services/test_aa_processor_service.py +++ b/safe_transaction_service/account_abstraction/tests/services/test_aa_processor_service.py @@ -4,14 +4,13 @@ from django.test import TestCase from eth_account import Account - -from gnosis.eth import EthereumClient -from gnosis.eth.account_abstraction import BundlerClient -from gnosis.eth.account_abstraction import UserOperation as UserOperationClass -from gnosis.eth.account_abstraction import ( +from safe_eth.eth import EthereumClient +from safe_eth.eth.account_abstraction import BundlerClient +from safe_eth.eth.account_abstraction import UserOperation as UserOperationClass +from safe_eth.eth.account_abstraction import ( UserOperationReceipt as UserOperationReceiptClass, ) -from gnosis.eth.tests.mocks.mock_bundler import ( +from safe_eth.eth.tests.mocks.mock_bundler import ( safe_4337_user_operation_hash_mock, user_operation_mock, user_operation_receipt_mock, diff --git a/safe_transaction_service/account_abstraction/tests/test_helpers.py b/safe_transaction_service/account_abstraction/tests/test_helpers.py index fcb946509..3297a80f6 100644 --- a/safe_transaction_service/account_abstraction/tests/test_helpers.py +++ b/safe_transaction_service/account_abstraction/tests/test_helpers.py @@ -1,9 +1,8 @@ from django.test import TestCase from hexbytes import HexBytes - -from gnosis.eth.tests.mocks.mock_bundler import user_operation_mock -from gnosis.safe.tests.safe_test_case import SafeTestCaseMixin +from safe_eth.eth.tests.mocks.mock_bundler import user_operation_mock +from safe_eth.safe.tests.safe_test_case import SafeTestCaseMixin from ..helpers import DecodedInitCode, decode_init_code diff --git a/safe_transaction_service/account_abstraction/tests/test_models.py b/safe_transaction_service/account_abstraction/tests/test_models.py index e5a6c7499..3f41c08de 100644 --- a/safe_transaction_service/account_abstraction/tests/test_models.py +++ b/safe_transaction_service/account_abstraction/tests/test_models.py @@ -1,13 +1,13 @@ from django.test import TestCase -from gnosis.eth.account_abstraction import UserOperation as UserOperationClass -from gnosis.eth.tests.mocks.mock_bundler import ( +from safe_eth.eth.account_abstraction import UserOperation as UserOperationClass +from safe_eth.eth.tests.mocks.mock_bundler import ( safe_4337_module_address_mock, safe_4337_safe_operation_hash_mock, safe_4337_user_operation_hash_mock, user_operation_mock, ) -from gnosis.safe.account_abstraction import SafeOperation as SafeOperationClass +from safe_eth.safe.account_abstraction import SafeOperation as SafeOperationClass from safe_transaction_service.history.tests import factories as history_factories diff --git a/safe_transaction_service/account_abstraction/tests/test_views.py b/safe_transaction_service/account_abstraction/tests/test_views.py index 2611becf1..f0faab2c9 100644 --- a/safe_transaction_service/account_abstraction/tests/test_views.py +++ b/safe_transaction_service/account_abstraction/tests/test_views.py @@ -12,11 +12,10 @@ from rest_framework import status from rest_framework.exceptions import ErrorDetail from rest_framework.test import APITestCase - -from gnosis.eth import EthereumClient -from gnosis.eth.account_abstraction import UserOperation as UserOperationClass -from gnosis.eth.constants import NULL_ADDRESS -from gnosis.eth.tests.mocks.mock_bundler import ( +from safe_eth.eth import EthereumClient +from safe_eth.eth.account_abstraction import UserOperation as UserOperationClass +from safe_eth.eth.constants import NULL_ADDRESS +from safe_eth.eth.tests.mocks.mock_bundler import ( safe_4337_address, safe_4337_chain_id_mock, safe_4337_module_address_mock, @@ -24,11 +23,11 @@ safe_4337_user_operation_hash_mock, user_operation_mock, ) -from gnosis.eth.utils import fast_keccak, fast_to_checksum_address -from gnosis.safe.account_abstraction import SafeOperation as SafeOperationClass -from gnosis.safe.proxy_factory import ProxyFactoryV141 -from gnosis.safe.safe_signature import SafeSignatureEOA, SafeSignatureType -from gnosis.safe.tests.safe_test_case import SafeTestCaseMixin +from safe_eth.eth.utils import fast_keccak, fast_to_checksum_address +from safe_eth.safe.account_abstraction import SafeOperation as SafeOperationClass +from safe_eth.safe.proxy_factory import ProxyFactoryV141 +from safe_eth.safe.safe_signature import SafeSignatureEOA, SafeSignatureType +from safe_eth.safe.tests.safe_test_case import SafeTestCaseMixin from safe_transaction_service.utils.utils import datetime_to_str diff --git a/safe_transaction_service/account_abstraction/utils.py b/safe_transaction_service/account_abstraction/utils.py index 3a8e25909..4d8695b90 100644 --- a/safe_transaction_service/account_abstraction/utils.py +++ b/safe_transaction_service/account_abstraction/utils.py @@ -6,11 +6,10 @@ from eth_typing import ChecksumAddress from hexbytes import HexBytes +from safe_eth.eth.account_abstraction import BundlerClient +from safe_eth.eth.utils import fast_to_checksum_address from web3.types import LogReceipt -from gnosis.eth.account_abstraction import BundlerClient -from gnosis.eth.utils import fast_to_checksum_address - logger = logging.getLogger(__name__) diff --git a/safe_transaction_service/account_abstraction/views.py b/safe_transaction_service/account_abstraction/views.py index 7ed6bdd33..aec7ea22f 100644 --- a/safe_transaction_service/account_abstraction/views.py +++ b/safe_transaction_service/account_abstraction/views.py @@ -4,8 +4,7 @@ from rest_framework.filters import OrderingFilter from rest_framework.generics import ListAPIView, ListCreateAPIView, RetrieveAPIView from rest_framework.response import Response - -from gnosis.eth.utils import fast_is_checksum_address +from safe_eth.eth.utils import fast_is_checksum_address from . import pagination, serializers from .models import SafeOperation, SafeOperationConfirmation, UserOperation diff --git a/safe_transaction_service/analytics/tests/test_views_v2.py b/safe_transaction_service/analytics/tests/test_views_v2.py index d00d79aae..cf99380f7 100644 --- a/safe_transaction_service/analytics/tests/test_views_v2.py +++ b/safe_transaction_service/analytics/tests/test_views_v2.py @@ -4,8 +4,7 @@ from rest_framework import status from rest_framework.authtoken.models import Token from rest_framework.test import APITestCase - -from gnosis.safe.tests.safe_test_case import SafeTestCaseMixin +from safe_eth.safe.tests.safe_test_case import SafeTestCaseMixin from safe_transaction_service.history.tests.factories import MultisigTransactionFactory diff --git a/safe_transaction_service/contracts/management/commands/update_safe_contracts_logo.py b/safe_transaction_service/contracts/management/commands/update_safe_contracts_logo.py index 502bc4004..a75a84031 100644 --- a/safe_transaction_service/contracts/management/commands/update_safe_contracts_logo.py +++ b/safe_transaction_service/contracts/management/commands/update_safe_contracts_logo.py @@ -1,8 +1,8 @@ from django.core.files import File from django.core.management import BaseCommand, CommandError -from gnosis.eth import get_auto_ethereum_client -from gnosis.safe.safe_deployments import safe_deployments +from safe_eth.eth import get_auto_ethereum_client +from safe_eth.safe.safe_deployments import safe_deployments from config.settings.base import STATICFILES_DIRS from safe_transaction_service.contracts.models import Contract @@ -80,7 +80,7 @@ def handle(self, *args, **options): for version in versions: for contract_name, addresses in safe_deployments[version].items(): - if (contract_address := addresses.get(str(chain_id))) is not None: + for contract_address in addresses.get(str(chain_id), []): display_name = generate_safe_contract_display_name( contract_name, version ) diff --git a/safe_transaction_service/contracts/migrations/0001_initial.py b/safe_transaction_service/contracts/migrations/0001_initial.py index 1ffc65e22..81fb0438a 100644 --- a/safe_transaction_service/contracts/migrations/0001_initial.py +++ b/safe_transaction_service/contracts/migrations/0001_initial.py @@ -3,7 +3,7 @@ import django.db.models.deletion from django.db import migrations, models -import gnosis.eth.django.models +import safe_eth.eth.django.models import safe_transaction_service.contracts.models @@ -43,7 +43,7 @@ class Migration(migrations.Migration): fields=[ ( "address", - gnosis.eth.django.models.EthereumAddressField( + safe_eth.eth.django.models.EthereumAddressField( primary_key=True, serialize=False ), ), diff --git a/safe_transaction_service/contracts/migrations/0006_contractabi_abi_hash.py b/safe_transaction_service/contracts/migrations/0006_contractabi_abi_hash.py index 4d521ad10..358b7ebba 100644 --- a/safe_transaction_service/contracts/migrations/0006_contractabi_abi_hash.py +++ b/safe_transaction_service/contracts/migrations/0006_contractabi_abi_hash.py @@ -3,10 +3,9 @@ from django.db import IntegrityError, migrations, transaction +import safe_eth.eth.django.models from web3 import Web3 -import gnosis.eth.django.models - def add_hash_for_contract_abis(apps, schema_editor): ContractAbi = apps.get_model("contracts", "ContractAbi") @@ -30,7 +29,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name="contractabi", name="abi_hash", - field=gnosis.eth.django.models.Sha3HashField( + field=safe_eth.eth.django.models.Sha3HashField( blank=True, default=None, null=True, unique=True ), ), diff --git a/safe_transaction_service/contracts/migrations/0008_ethereum_address_field_v2.py b/safe_transaction_service/contracts/migrations/0008_ethereum_address_field_v2.py index dddf7d37c..bf0d651da 100644 --- a/safe_transaction_service/contracts/migrations/0008_ethereum_address_field_v2.py +++ b/safe_transaction_service/contracts/migrations/0008_ethereum_address_field_v2.py @@ -2,7 +2,7 @@ from django.db import migrations -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -24,7 +24,7 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="contract", name="address", - field=gnosis.eth.django.models.EthereumAddressV2Field( + field=safe_eth.eth.django.models.EthereumAddressV2Field( primary_key=True, serialize=False ), ), diff --git a/safe_transaction_service/contracts/migrations/0009_alter_contractabi_abi_hash.py b/safe_transaction_service/contracts/migrations/0009_alter_contractabi_abi_hash.py index 8f889dd37..ffcf0c2df 100644 --- a/safe_transaction_service/contracts/migrations/0009_alter_contractabi_abi_hash.py +++ b/safe_transaction_service/contracts/migrations/0009_alter_contractabi_abi_hash.py @@ -2,7 +2,7 @@ from django.db import migrations -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -21,7 +21,7 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="contractabi", name="abi_hash", - field=gnosis.eth.django.models.Keccak256Field( + field=safe_eth.eth.django.models.Keccak256Field( blank=True, default=None, null=True, unique=True ), ), diff --git a/safe_transaction_service/contracts/migrations/0012_alter_contract_address.py b/safe_transaction_service/contracts/migrations/0012_alter_contract_address.py index ccaa5e4d9..cc924e842 100644 --- a/safe_transaction_service/contracts/migrations/0012_alter_contract_address.py +++ b/safe_transaction_service/contracts/migrations/0012_alter_contract_address.py @@ -2,7 +2,7 @@ from django.db import migrations -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -15,7 +15,7 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="contract", name="address", - field=gnosis.eth.django.models.EthereumAddressBinaryField( + field=safe_eth.eth.django.models.EthereumAddressBinaryField( primary_key=True, serialize=False ), ), diff --git a/safe_transaction_service/contracts/models.py b/safe_transaction_service/contracts/models.py index 47ca3e721..0631be76b 100644 --- a/safe_transaction_service/contracts/models.py +++ b/safe_transaction_service/contracts/models.py @@ -15,12 +15,11 @@ from cachetools import TTLCache, cachedmethod from imagekit.models import ProcessedImageField from pilkit.processors import Resize +from safe_eth.eth.clients import ContractMetadata +from safe_eth.eth.django.models import EthereumAddressBinaryField, Keccak256Field +from safe_eth.eth.utils import fast_keccak from web3._utils.normalizers import normalize_abi -from gnosis.eth.clients import ContractMetadata -from gnosis.eth.django.models import EthereumAddressBinaryField, Keccak256Field -from gnosis.eth.utils import fast_keccak - logger = getLogger(__name__) diff --git a/safe_transaction_service/contracts/serializers.py b/safe_transaction_service/contracts/serializers.py index f38afe692..262102d05 100644 --- a/safe_transaction_service/contracts/serializers.py +++ b/safe_transaction_service/contracts/serializers.py @@ -1,6 +1,5 @@ from rest_framework import serializers - -from gnosis.eth.django.serializers import EthereumAddressField +from safe_eth.eth.django.serializers import EthereumAddressField class ContractAbiSerializer(serializers.Serializer): diff --git a/safe_transaction_service/contracts/services/contract_metadata_service.py b/safe_transaction_service/contracts/services/contract_metadata_service.py index ba8b3754b..8cc335862 100644 --- a/safe_transaction_service/contracts/services/contract_metadata_service.py +++ b/safe_transaction_service/contracts/services/contract_metadata_service.py @@ -5,9 +5,8 @@ from django.conf import settings from eth_typing import ChecksumAddress - -from gnosis.eth import EthereumClient, get_auto_ethereum_client -from gnosis.eth.clients import ( +from safe_eth.eth import EthereumClient, get_auto_ethereum_client +from safe_eth.eth.clients import ( BlockscoutClient, BlockScoutConfigurationProblem, ContractMetadata, diff --git a/safe_transaction_service/contracts/tasks.py b/safe_transaction_service/contracts/tasks.py index b6de02afc..b8b9e7350 100644 --- a/safe_transaction_service/contracts/tasks.py +++ b/safe_transaction_service/contracts/tasks.py @@ -7,9 +7,8 @@ from celery import app from celery.utils.log import get_task_logger from eth_typing import ChecksumAddress - -from gnosis.eth.clients import EtherscanRateLimitError -from gnosis.safe.multi_send import MultiSend +from safe_eth.eth.clients import EtherscanRateLimitError +from safe_eth.safe.multi_send import MultiSend from safe_transaction_service.history.models import ( ModuleTransaction, diff --git a/safe_transaction_service/contracts/tests/factories.py b/safe_transaction_service/contracts/tests/factories.py index b65dadf38..b8d748fb7 100644 --- a/safe_transaction_service/contracts/tests/factories.py +++ b/safe_transaction_service/contracts/tests/factories.py @@ -1,8 +1,7 @@ import factory from eth_account import Account from factory.django import DjangoModelFactory - -from gnosis.eth.tests.clients.mocks import sourcify_safe_metadata +from safe_eth.eth.tests.clients.mocks import sourcify_safe_metadata from ..models import Contract, ContractAbi diff --git a/safe_transaction_service/contracts/tests/mocks/contract_metadata_mocks.py b/safe_transaction_service/contracts/tests/mocks/contract_metadata_mocks.py index f672fda7e..a9df5e123 100644 --- a/safe_transaction_service/contracts/tests/mocks/contract_metadata_mocks.py +++ b/safe_transaction_service/contracts/tests/mocks/contract_metadata_mocks.py @@ -1,4 +1,4 @@ -from gnosis.eth.clients import ContractMetadata +from safe_eth.eth.clients import ContractMetadata etherscan_metadata_mock = ContractMetadata( "Etherscan Uxio Contract", diff --git a/safe_transaction_service/contracts/tests/services/test_contract_metadata_service.py b/safe_transaction_service/contracts/tests/services/test_contract_metadata_service.py index c60b367cb..3c2aa749b 100644 --- a/safe_transaction_service/contracts/tests/services/test_contract_metadata_service.py +++ b/safe_transaction_service/contracts/tests/services/test_contract_metadata_service.py @@ -4,9 +4,8 @@ from django.test import TestCase from eth_account import Account - -from gnosis.eth.clients import BlockscoutClient, EtherscanClient, SourcifyClient -from gnosis.eth.ethereum_client import EthereumClient, EthereumNetwork +from safe_eth.eth.clients import BlockscoutClient, EtherscanClient, SourcifyClient +from safe_eth.eth.ethereum_client import EthereumClient, EthereumNetwork from ...services.contract_metadata_service import get_contract_metadata_service from ..mocks.contract_metadata_mocks import ( diff --git a/safe_transaction_service/contracts/tests/test_commands.py b/safe_transaction_service/contracts/tests/test_commands.py index 948cd3e02..0bee43347 100644 --- a/safe_transaction_service/contracts/tests/test_commands.py +++ b/safe_transaction_service/contracts/tests/test_commands.py @@ -4,7 +4,7 @@ from django.core.management import call_command from django.test import TestCase -from gnosis.eth import EthereumClient +from safe_eth.eth import EthereumClient from safe_transaction_service.contracts.models import Contract from safe_transaction_service.contracts.tests.factories import ContractFactory diff --git a/safe_transaction_service/contracts/tests/test_models.py b/safe_transaction_service/contracts/tests/test_models.py index 6d61e4a51..482397bd1 100644 --- a/safe_transaction_service/contracts/tests/test_models.py +++ b/safe_transaction_service/contracts/tests/test_models.py @@ -8,9 +8,8 @@ from django.test import TestCase from eth_account import Account - -from gnosis.eth.ethereum_client import EthereumNetwork -from gnosis.eth.tests.clients.mocks import sourcify_safe_metadata +from safe_eth.eth.ethereum_client import EthereumNetwork +from safe_eth.eth.tests.clients.mocks import sourcify_safe_metadata from ..models import Contract, ContractAbi, validate_abi from .factories import ContractAbiFactory, ContractFactory diff --git a/safe_transaction_service/contracts/tests/test_tx_decoder.py b/safe_transaction_service/contracts/tests/test_tx_decoder.py index f25baf462..109e10647 100644 --- a/safe_transaction_service/contracts/tests/test_tx_decoder.py +++ b/safe_transaction_service/contracts/tests/test_tx_decoder.py @@ -3,11 +3,10 @@ from django.test import TestCase from hexbytes import HexBytes +from safe_eth.eth.constants import NULL_ADDRESS +from safe_eth.safe.multi_send import MultiSendOperation from web3 import Web3 -from gnosis.eth.constants import NULL_ADDRESS -from gnosis.safe.multi_send import MultiSendOperation - from safe_transaction_service.contracts.tests.factories import ( ContractAbiFactory, ContractFactory, diff --git a/safe_transaction_service/contracts/tx_decoder.py b/safe_transaction_service/contracts/tx_decoder.py index 2fb9d86f4..2622de85f 100644 --- a/safe_transaction_service/contracts/tx_decoder.py +++ b/safe_transaction_service/contracts/tx_decoder.py @@ -24,13 +24,7 @@ from eth_typing import ChecksumAddress, HexStr from eth_utils import function_abi_to_4byte_selector from hexbytes import HexBytes -from web3 import Web3 -from web3._utils.abi import get_abi_input_names, get_abi_input_types, map_abi_data -from web3._utils.normalizers import BASE_RETURN_NORMALIZERS -from web3.contract import Contract -from web3.types import ABIFunction - -from gnosis.eth.contracts import ( +from safe_eth.eth.contracts import ( get_erc20_contract, get_erc721_contract, get_kyber_network_proxy_contract, @@ -42,7 +36,12 @@ get_safe_V1_4_1_contract, get_uniswap_exchange_contract, ) -from gnosis.safe.multi_send import MultiSend +from safe_eth.safe.multi_send import MultiSend +from web3 import Web3 +from web3._utils.abi import get_abi_input_names, get_abi_input_types, map_abi_data +from web3._utils.normalizers import BASE_RETURN_NORMALIZERS +from web3.contract import Contract +from web3.types import ABIFunction from safe_transaction_service.contracts.models import ContractAbi from safe_transaction_service.utils.utils import running_on_gevent diff --git a/safe_transaction_service/history/admin.py b/safe_transaction_service/history/admin.py index 4793e3f18..d5900e3a1 100644 --- a/safe_transaction_service/history/admin.py +++ b/safe_transaction_service/history/admin.py @@ -9,10 +9,9 @@ from hexbytes import HexBytes from rest_framework.authtoken.admin import TokenAdmin - -from gnosis.eth import get_auto_ethereum_client -from gnosis.eth.django.admin import AdvancedAdminSearchMixin -from gnosis.safe import SafeTx +from safe_eth.eth import get_auto_ethereum_client +from safe_eth.eth.django.admin import AdvancedAdminSearchMixin +from safe_eth.safe import SafeTx from .models import ( Chain, diff --git a/safe_transaction_service/history/filters.py b/safe_transaction_service/history/filters.py index 7e4c983bd..6ab49da1b 100644 --- a/safe_transaction_service/history/filters.py +++ b/safe_transaction_service/history/filters.py @@ -3,9 +3,8 @@ import django_filters from django_filters import rest_framework as filters from rest_framework.exceptions import ValidationError - -from gnosis.eth.django.filters import EthereumAddressFilter, Keccak256Filter -from gnosis.eth.django.models import ( +from safe_eth.eth.django.filters import EthereumAddressFilter, Keccak256Filter +from safe_eth.eth.django.models import ( EthereumAddressBinaryField, Keccak256Field, Uint256Field, diff --git a/safe_transaction_service/history/helpers.py b/safe_transaction_service/history/helpers.py index 27ea3a222..724c81288 100644 --- a/safe_transaction_service/history/helpers.py +++ b/safe_transaction_service/history/helpers.py @@ -4,8 +4,7 @@ from eth_typing import ChecksumAddress, Hash32, HexStr from eth_utils import keccak - -from gnosis.eth.eip712 import eip712_encode_hash +from safe_eth.eth.eip712 import eip712_encode_hash from safe_transaction_service.history.models import TransferDict from safe_transaction_service.tokens.models import Token diff --git a/safe_transaction_service/history/indexers/erc20_events_indexer.py b/safe_transaction_service/history/indexers/erc20_events_indexer.py index fa5092401..c13b033b4 100644 --- a/safe_transaction_service/history/indexers/erc20_events_indexer.py +++ b/safe_transaction_service/history/indexers/erc20_events_indexer.py @@ -7,11 +7,10 @@ from django.db.models.query import EmptyQuerySet from eth_typing import ChecksumAddress +from safe_eth.eth import EthereumClient from web3.contract.contract import ContractEvent from web3.types import EventData, LogReceipt -from gnosis.eth import EthereumClient - from ...utils.utils import FixedSizeDict from ..models import ( ERC20Transfer, diff --git a/safe_transaction_service/history/indexers/ethereum_indexer.py b/safe_transaction_service/history/indexers/ethereum_indexer.py index 8d9ed7d28..5867a4702 100644 --- a/safe_transaction_service/history/indexers/ethereum_indexer.py +++ b/safe_transaction_service/history/indexers/ethereum_indexer.py @@ -9,8 +9,7 @@ from celery.exceptions import SoftTimeLimitExceeded from eth_typing import ChecksumAddress from requests import Timeout - -from gnosis.eth import EthereumClient +from safe_eth.eth import EthereumClient from ..services import IndexingException, IndexService, IndexServiceProvider diff --git a/safe_transaction_service/history/indexers/internal_tx_indexer.py b/safe_transaction_service/history/indexers/internal_tx_indexer.py index e0fce770d..6e66cef9f 100644 --- a/safe_transaction_service/history/indexers/internal_tx_indexer.py +++ b/safe_transaction_service/history/indexers/internal_tx_indexer.py @@ -7,10 +7,9 @@ from eth_typing import ChecksumAddress, HexStr from hexbytes import HexBytes +from safe_eth.eth import EthereumClient from web3.types import BlockTrace, FilterTrace -from gnosis.eth import EthereumClient - from safe_transaction_service.contracts.tx_decoder import ( CannotDecode, UnexpectedProblemDecoding, diff --git a/safe_transaction_service/history/indexers/proxy_factory_indexer.py b/safe_transaction_service/history/indexers/proxy_factory_indexer.py index d7c1dcbdd..53adb4478 100644 --- a/safe_transaction_service/history/indexers/proxy_factory_indexer.py +++ b/safe_transaction_service/history/indexers/proxy_factory_indexer.py @@ -2,16 +2,15 @@ from logging import getLogger from typing import List, Optional, Sequence -from web3.contract.contract import ContractEvent -from web3.types import EventData, LogReceipt - -from gnosis.eth import EthereumClient -from gnosis.eth.constants import NULL_ADDRESS -from gnosis.eth.contracts import ( +from safe_eth.eth import EthereumClient +from safe_eth.eth.constants import NULL_ADDRESS +from safe_eth.eth.contracts import ( get_proxy_factory_V1_1_1_contract, get_proxy_factory_V1_3_0_contract, get_proxy_factory_V1_4_1_contract, ) +from web3.contract.contract import ContractEvent +from web3.types import EventData, LogReceipt from ..models import ProxyFactory, SafeContract from .events_indexer import EventsIndexer diff --git a/safe_transaction_service/history/indexers/safe_events_indexer.py b/safe_transaction_service/history/indexers/safe_events_indexer.py index 00362cc1d..25546d68a 100644 --- a/safe_transaction_service/history/indexers/safe_events_indexer.py +++ b/safe_transaction_service/history/indexers/safe_events_indexer.py @@ -8,18 +8,17 @@ from eth_abi.exceptions import DecodingError from eth_typing import ChecksumAddress from hexbytes import HexBytes -from web3.contract.contract import ContractEvent -from web3.types import EventData - -from gnosis.eth import EthereumClient -from gnosis.eth.constants import NULL_ADDRESS -from gnosis.eth.contracts import ( +from safe_eth.eth import EthereumClient +from safe_eth.eth.constants import NULL_ADDRESS +from safe_eth.eth.contracts import ( get_proxy_factory_V1_3_0_contract, get_proxy_factory_V1_4_1_contract, get_safe_V1_1_1_contract, get_safe_V1_3_0_contract, get_safe_V1_4_1_contract, ) +from web3.contract.contract import ContractEvent +from web3.types import EventData from ..models import ( EthereumBlock, diff --git a/safe_transaction_service/history/indexers/tx_processor.py b/safe_transaction_service/history/indexers/tx_processor.py index 5d8118dc9..c48c32e85 100644 --- a/safe_transaction_service/history/indexers/tx_processor.py +++ b/safe_transaction_service/history/indexers/tx_processor.py @@ -12,17 +12,16 @@ from eth_utils import event_abi_to_log_topic from hexbytes import HexBytes from packaging.version import Version -from web3 import Web3 - -from gnosis.eth import EthereumClient, get_auto_ethereum_client -from gnosis.eth.constants import NULL_ADDRESS -from gnosis.eth.contracts import ( +from safe_eth.eth import EthereumClient, get_auto_ethereum_client +from safe_eth.eth.constants import NULL_ADDRESS +from safe_eth.eth.contracts import ( get_safe_V1_0_0_contract, get_safe_V1_3_0_contract, get_safe_V1_4_1_contract, ) -from gnosis.safe import SafeTx -from gnosis.safe.safe_signature import SafeSignature, SafeSignatureApprovedHash +from safe_eth.safe import SafeTx +from safe_eth.safe.safe_signature import SafeSignature, SafeSignatureApprovedHash +from web3 import Web3 from safe_transaction_service.account_abstraction.services import ( AaProcessorService, diff --git a/safe_transaction_service/history/management/commands/check_index_problems.py b/safe_transaction_service/history/management/commands/check_index_problems.py index f54db7259..f31afc318 100644 --- a/safe_transaction_service/history/management/commands/check_index_problems.py +++ b/safe_transaction_service/history/management/commands/check_index_problems.py @@ -1,9 +1,9 @@ from django.conf import settings from django.core.management.base import BaseCommand -from gnosis.eth import EthereumClient -from gnosis.eth.constants import NULL_ADDRESS -from gnosis.eth.contracts import get_safe_V1_3_0_contract +from safe_eth.eth import EthereumClient +from safe_eth.eth.constants import NULL_ADDRESS +from safe_eth.eth.contracts import get_safe_V1_3_0_contract from ...models import MultisigTransaction, SafeLastStatus from ...services import IndexServiceProvider diff --git a/safe_transaction_service/history/management/commands/fix_ethereum_logs.py b/safe_transaction_service/history/management/commands/fix_ethereum_logs.py index 25ffa32f3..0531fd738 100644 --- a/safe_transaction_service/history/management/commands/fix_ethereum_logs.py +++ b/safe_transaction_service/history/management/commands/fix_ethereum_logs.py @@ -1,6 +1,6 @@ from django.core.management.base import BaseCommand -from gnosis.eth import get_auto_ethereum_client +from safe_eth.eth import get_auto_ethereum_client from ...models import EthereumTx from ...utils import clean_receipt_log diff --git a/safe_transaction_service/history/management/commands/fix_ethereum_txs.py b/safe_transaction_service/history/management/commands/fix_ethereum_txs.py index 1483df98f..0bb6c108a 100644 --- a/safe_transaction_service/history/management/commands/fix_ethereum_txs.py +++ b/safe_transaction_service/history/management/commands/fix_ethereum_txs.py @@ -2,7 +2,7 @@ from django.core.management.base import BaseCommand -from gnosis.eth import get_auto_ethereum_client +from safe_eth.eth import get_auto_ethereum_client from ...models import EthereumTx diff --git a/safe_transaction_service/history/management/commands/send_slack_notification.py b/safe_transaction_service/history/management/commands/send_slack_notification.py index 5c058234e..d4de2d795 100644 --- a/safe_transaction_service/history/management/commands/send_slack_notification.py +++ b/safe_transaction_service/history/management/commands/send_slack_notification.py @@ -4,8 +4,7 @@ import requests from requests import RequestException - -from gnosis.eth import get_auto_ethereum_client +from safe_eth.eth import get_auto_ethereum_client from safe_transaction_service import __version__ diff --git a/safe_transaction_service/history/management/commands/setup_service.py b/safe_transaction_service/history/management/commands/setup_service.py index 033e59962..01b7d63b6 100644 --- a/safe_transaction_service/history/management/commands/setup_service.py +++ b/safe_transaction_service/history/management/commands/setup_service.py @@ -6,9 +6,8 @@ from django.db.models import Min from django_celery_beat.models import CrontabSchedule, IntervalSchedule, PeriodicTask - -from gnosis.eth import get_auto_ethereum_client -from gnosis.safe.addresses import MASTER_COPIES, PROXY_FACTORIES +from safe_eth.eth import get_auto_ethereum_client +from safe_eth.safe.addresses import MASTER_COPIES, PROXY_FACTORIES from ...models import IndexingStatus, IndexingStatusType, ProxyFactory, SafeMasterCopy diff --git a/safe_transaction_service/history/migrations/0001_initial.py b/safe_transaction_service/history/migrations/0001_initial.py index 5705c77e5..1bd296aa2 100644 --- a/safe_transaction_service/history/migrations/0001_initial.py +++ b/safe_transaction_service/history/migrations/0001_initial.py @@ -5,8 +5,7 @@ from django.db import migrations, models import model_utils.fields - -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -36,13 +35,13 @@ class Migration(migrations.Migration): ), ( "safe_tx_hash", - gnosis.eth.django.models.Sha3HashField( + safe_eth.eth.django.models.Sha3HashField( primary_key=True, serialize=False ), ), - ("safe", gnosis.eth.django.models.EthereumAddressField()), - ("to", gnosis.eth.django.models.EthereumAddressField()), - ("value", gnosis.eth.django.models.Uint256Field()), + ("safe", safe_eth.eth.django.models.EthereumAddressField()), + ("to", safe_eth.eth.django.models.EthereumAddressField()), + ("value", safe_eth.eth.django.models.Uint256Field()), ("data", models.BinaryField(null=True)), ( "operation", @@ -50,15 +49,18 @@ class Migration(migrations.Migration): choices=[(0, "CALL"), (1, "DELEGATE_CALL"), (2, "CREATE")] ), ), - ("safe_tx_gas", gnosis.eth.django.models.Uint256Field()), - ("base_gas", gnosis.eth.django.models.Uint256Field()), - ("gas_price", gnosis.eth.django.models.Uint256Field()), - ("gas_token", gnosis.eth.django.models.EthereumAddressField(null=True)), + ("safe_tx_gas", safe_eth.eth.django.models.Uint256Field()), + ("base_gas", safe_eth.eth.django.models.Uint256Field()), + ("gas_price", safe_eth.eth.django.models.Uint256Field()), + ( + "gas_token", + safe_eth.eth.django.models.EthereumAddressField(null=True), + ), ( "refund_receiver", - gnosis.eth.django.models.EthereumAddressField(null=True), + safe_eth.eth.django.models.EthereumAddressField(null=True), ), - ("nonce", gnosis.eth.django.models.Uint256Field()), + ("nonce", safe_eth.eth.django.models.Uint256Field()), ("mined", models.BooleanField(default=False)), ("execution_date", models.DateTimeField(blank=True, null=True)), ], @@ -94,15 +96,15 @@ class Migration(migrations.Migration): verbose_name="modified", ), ), - ("owner", gnosis.eth.django.models.EthereumAddressField()), - ("transaction_hash", gnosis.eth.django.models.Sha3HashField()), + ("owner", safe_eth.eth.django.models.EthereumAddressField()), + ("transaction_hash", safe_eth.eth.django.models.Sha3HashField()), ( "confirmation_type", models.PositiveSmallIntegerField( choices=[(0, "CONFIRMATION"), (1, "EXECUTION")] ), ), - ("block_number", gnosis.eth.django.models.Uint256Field()), + ("block_number", safe_eth.eth.django.models.Uint256Field()), ("block_date_time", models.DateTimeField()), ("mined", models.BooleanField(default=False)), ( diff --git a/safe_transaction_service/history/migrations/0002_auto_20190725_0857.py b/safe_transaction_service/history/migrations/0002_auto_20190725_0857.py index 24aca2485..2e89901a9 100644 --- a/safe_transaction_service/history/migrations/0002_auto_20190725_0857.py +++ b/safe_transaction_service/history/migrations/0002_auto_20190725_0857.py @@ -2,7 +2,7 @@ from django.db import migrations, models -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -14,7 +14,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name="multisigconfirmation", name="signature", - field=gnosis.eth.django.models.HexField(max_length=500, null=True), + field=safe_eth.eth.django.models.HexField(max_length=500, null=True), ), migrations.AlterField( model_name="multisigconfirmation", @@ -24,11 +24,11 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="multisigconfirmation", name="block_number", - field=gnosis.eth.django.models.Uint256Field(null=True), + field=safe_eth.eth.django.models.Uint256Field(null=True), ), migrations.AlterField( model_name="multisigconfirmation", name="transaction_hash", - field=gnosis.eth.django.models.Sha3HashField(null=True), + field=safe_eth.eth.django.models.Sha3HashField(null=True), ), ] diff --git a/safe_transaction_service/history/migrations/0003_auto_20191107_1459.py b/safe_transaction_service/history/migrations/0003_auto_20191107_1459.py index f1eb0681b..a7a826415 100644 --- a/safe_transaction_service/history/migrations/0003_auto_20191107_1459.py +++ b/safe_transaction_service/history/migrations/0003_auto_20191107_1459.py @@ -7,8 +7,7 @@ from django.db import migrations, models import model_utils.fields - -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -29,8 +28,8 @@ class Migration(migrations.Migration): ("gas_limit", models.PositiveIntegerField()), ("gas_used", models.PositiveIntegerField()), ("timestamp", models.DateTimeField()), - ("block_hash", gnosis.eth.django.models.Sha3HashField(unique=True)), - ("parent_hash", gnosis.eth.django.models.Sha3HashField(unique=True)), + ("block_hash", safe_eth.eth.django.models.Sha3HashField(unique=True)), + ("parent_hash", safe_eth.eth.django.models.Sha3HashField(unique=True)), ("confirmed", models.BooleanField(db_index=True, default=False)), ], ), @@ -55,13 +54,13 @@ class Migration(migrations.Migration): ), ( "tx_hash", - gnosis.eth.django.models.Sha3HashField( + safe_eth.eth.django.models.Sha3HashField( primary_key=True, serialize=False, unique=True ), ), ( "gas_used", - gnosis.eth.django.models.Uint256Field(default=None, null=True), + safe_eth.eth.django.models.Uint256Field(default=None, null=True), ), ("status", models.IntegerField(default=None, null=True)), ( @@ -70,21 +69,21 @@ class Migration(migrations.Migration): ), ( "_from", - gnosis.eth.django.models.EthereumAddressField( + safe_eth.eth.django.models.EthereumAddressField( db_index=True, null=True ), ), - ("gas", gnosis.eth.django.models.Uint256Field()), - ("gas_price", gnosis.eth.django.models.Uint256Field()), + ("gas", safe_eth.eth.django.models.Uint256Field()), + ("gas_price", safe_eth.eth.django.models.Uint256Field()), ("data", models.BinaryField(null=True)), - ("nonce", gnosis.eth.django.models.Uint256Field()), + ("nonce", safe_eth.eth.django.models.Uint256Field()), ( "to", - gnosis.eth.django.models.EthereumAddressField( + safe_eth.eth.django.models.EthereumAddressField( db_index=True, null=True ), ), - ("value", gnosis.eth.django.models.Uint256Field()), + ("value", safe_eth.eth.django.models.Uint256Field()), ( "block", models.ForeignKey( @@ -114,23 +113,23 @@ class Migration(migrations.Migration): ), ( "_from", - gnosis.eth.django.models.EthereumAddressField( + safe_eth.eth.django.models.EthereumAddressField( db_index=True, null=True ), ), - ("gas", gnosis.eth.django.models.Uint256Field()), + ("gas", safe_eth.eth.django.models.Uint256Field()), ("data", models.BinaryField(null=True)), ( "to", - gnosis.eth.django.models.EthereumAddressField( + safe_eth.eth.django.models.EthereumAddressField( db_index=True, null=True ), ), - ("value", gnosis.eth.django.models.Uint256Field()), - ("gas_used", gnosis.eth.django.models.Uint256Field()), + ("value", safe_eth.eth.django.models.Uint256Field()), + ("gas_used", safe_eth.eth.django.models.Uint256Field()), ( "contract_address", - gnosis.eth.django.models.EthereumAddressField( + safe_eth.eth.django.models.EthereumAddressField( db_index=True, null=True ), ), @@ -138,7 +137,7 @@ class Migration(migrations.Migration): ("output", models.BinaryField(null=True)), ( "refund_address", - gnosis.eth.django.models.EthereumAddressField( + safe_eth.eth.django.models.EthereumAddressField( db_index=True, null=True ), ), @@ -177,7 +176,7 @@ class Migration(migrations.Migration): fields=[ ( "address", - gnosis.eth.django.models.EthereumAddressField( + safe_eth.eth.django.models.EthereumAddressField( primary_key=True, serialize=False ), ), @@ -194,7 +193,7 @@ class Migration(migrations.Migration): fields=[ ( "address", - gnosis.eth.django.models.EthereumAddressField( + safe_eth.eth.django.models.EthereumAddressField( primary_key=True, serialize=False ), ), @@ -217,7 +216,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name="multisigconfirmation", name="multisig_transaction_hash", - field=gnosis.eth.django.models.Sha3HashField(db_index=True, null=True), + field=safe_eth.eth.django.models.Sha3HashField(db_index=True, null=True), ), migrations.AddField( model_name="multisigtransaction", @@ -237,14 +236,14 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="multisigconfirmation", name="signature", - field=gnosis.eth.django.models.HexField( + field=safe_eth.eth.django.models.HexField( default=None, max_length=500, null=True ), ), migrations.AlterField( model_name="multisigtransaction", name="to", - field=gnosis.eth.django.models.EthereumAddressField( + field=safe_eth.eth.django.models.EthereumAddressField( db_index=True, null=True ), ), @@ -278,7 +277,7 @@ class Migration(migrations.Migration): fields=[ ( "address", - gnosis.eth.django.models.EthereumAddressField( + safe_eth.eth.django.models.EthereumAddressField( primary_key=True, serialize=False ), ), @@ -348,17 +347,17 @@ class Migration(migrations.Migration): to="history.InternalTx", ), ), - ("address", gnosis.eth.django.models.EthereumAddressField()), + ("address", safe_eth.eth.django.models.EthereumAddressField()), ( "owners", django.contrib.postgres.fields.ArrayField( - base_field=gnosis.eth.django.models.EthereumAddressField(), + base_field=safe_eth.eth.django.models.EthereumAddressField(), size=None, ), ), - ("threshold", gnosis.eth.django.models.Uint256Field()), - ("nonce", gnosis.eth.django.models.Uint256Field(default=0)), - ("master_copy", gnosis.eth.django.models.EthereumAddressField()), + ("threshold", safe_eth.eth.django.models.Uint256Field()), + ("nonce", safe_eth.eth.django.models.Uint256Field(default=0)), + ("master_copy", safe_eth.eth.django.models.EthereumAddressField()), ], options={ "verbose_name_plural": "Safe statuses", @@ -380,13 +379,13 @@ class Migration(migrations.Migration): ("log_index", models.PositiveIntegerField()), ( "address", - gnosis.eth.django.models.EthereumAddressField(db_index=True), + safe_eth.eth.django.models.EthereumAddressField(db_index=True), ), - ("topic", gnosis.eth.django.models.Sha3HashField(db_index=True)), + ("topic", safe_eth.eth.django.models.Sha3HashField(db_index=True)), ( "topics", django.contrib.postgres.fields.ArrayField( - base_field=gnosis.eth.django.models.Sha3HashField(), size=None + base_field=safe_eth.eth.django.models.Sha3HashField(), size=None ), ), ("arguments", django.contrib.postgres.fields.jsonb.JSONField()), diff --git a/safe_transaction_service/history/migrations/0006_auto_20200113_1204.py b/safe_transaction_service/history/migrations/0006_auto_20200113_1204.py index 35f8225e6..379edeafd 100644 --- a/safe_transaction_service/history/migrations/0006_auto_20200113_1204.py +++ b/safe_transaction_service/history/migrations/0006_auto_20200113_1204.py @@ -2,7 +2,7 @@ from django.db import migrations -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -14,11 +14,11 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="multisigtransaction", name="nonce", - field=gnosis.eth.django.models.Uint256Field(db_index=True), + field=safe_eth.eth.django.models.Uint256Field(db_index=True), ), migrations.AlterField( model_name="multisigtransaction", name="safe", - field=gnosis.eth.django.models.EthereumAddressField(db_index=True), + field=safe_eth.eth.django.models.EthereumAddressField(db_index=True), ), ] diff --git a/safe_transaction_service/history/migrations/0007_auto_20200122_1305.py b/safe_transaction_service/history/migrations/0007_auto_20200122_1305.py index b9e51f2fb..5d8a21df3 100644 --- a/safe_transaction_service/history/migrations/0007_auto_20200122_1305.py +++ b/safe_transaction_service/history/migrations/0007_auto_20200122_1305.py @@ -2,7 +2,7 @@ from django.db import migrations, models -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -14,7 +14,7 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="safestatus", name="address", - field=gnosis.eth.django.models.EthereumAddressField(db_index=True), + field=safe_eth.eth.django.models.EthereumAddressField(db_index=True), ), migrations.CreateModel( name="WebHook", @@ -30,7 +30,7 @@ class Migration(migrations.Migration): ), ( "address", - gnosis.eth.django.models.EthereumAddressField(db_index=True), + safe_eth.eth.django.models.EthereumAddressField(db_index=True), ), ("url", models.URLField()), ("new_confirmation", models.BooleanField(default=True)), diff --git a/safe_transaction_service/history/migrations/0010_auto_20200226_1508.py b/safe_transaction_service/history/migrations/0010_auto_20200226_1508.py index 3308b586a..2f09afff8 100644 --- a/safe_transaction_service/history/migrations/0010_auto_20200226_1508.py +++ b/safe_transaction_service/history/migrations/0010_auto_20200226_1508.py @@ -2,7 +2,7 @@ from django.db import migrations -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -14,7 +14,7 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="webhook", name="address", - field=gnosis.eth.django.models.EthereumAddressField( + field=safe_eth.eth.django.models.EthereumAddressField( blank=True, db_index=True ), ), diff --git a/safe_transaction_service/history/migrations/0011_auto_20200303_0956.py b/safe_transaction_service/history/migrations/0011_auto_20200303_0956.py index 69f81a5ec..9c5c7ef9d 100644 --- a/safe_transaction_service/history/migrations/0011_auto_20200303_0956.py +++ b/safe_transaction_service/history/migrations/0011_auto_20200303_0956.py @@ -3,7 +3,7 @@ import django.contrib.postgres.fields from django.db import migrations -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -16,7 +16,7 @@ class Migration(migrations.Migration): model_name="safestatus", name="enabled_modules", field=django.contrib.postgres.fields.ArrayField( - base_field=gnosis.eth.django.models.EthereumAddressField(), + base_field=safe_eth.eth.django.models.EthereumAddressField(), default=list, size=None, ), @@ -24,7 +24,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name="safestatus", name="fallback_handler", - field=gnosis.eth.django.models.EthereumAddressField( + field=safe_eth.eth.django.models.EthereumAddressField( default="0x0000000000000000000000000000000000000000" ), preserve_default=False, diff --git a/safe_transaction_service/history/migrations/0012_moduletransaction.py b/safe_transaction_service/history/migrations/0012_moduletransaction.py index 6dee05e52..409dc5c38 100644 --- a/safe_transaction_service/history/migrations/0012_moduletransaction.py +++ b/safe_transaction_service/history/migrations/0012_moduletransaction.py @@ -5,8 +5,7 @@ from django.db import migrations, models import model_utils.fields - -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -44,13 +43,16 @@ class Migration(migrations.Migration): to="history.InternalTx", ), ), - ("safe", gnosis.eth.django.models.EthereumAddressField(db_index=True)), + ( + "safe", + safe_eth.eth.django.models.EthereumAddressField(db_index=True), + ), ( "module", - gnosis.eth.django.models.EthereumAddressField(db_index=True), + safe_eth.eth.django.models.EthereumAddressField(db_index=True), ), - ("to", gnosis.eth.django.models.EthereumAddressField(db_index=True)), - ("value", gnosis.eth.django.models.Uint256Field()), + ("to", safe_eth.eth.django.models.EthereumAddressField(db_index=True)), + ("value", safe_eth.eth.django.models.Uint256Field()), ("data", models.BinaryField(null=True)), ( "operation", diff --git a/safe_transaction_service/history/migrations/0014_auto_20200327_0954.py b/safe_transaction_service/history/migrations/0014_auto_20200327_0954.py index ac96e7609..abdf08a8a 100644 --- a/safe_transaction_service/history/migrations/0014_auto_20200327_0954.py +++ b/safe_transaction_service/history/migrations/0014_auto_20200327_0954.py @@ -2,7 +2,7 @@ from django.db import migrations, models -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -24,7 +24,7 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="ethereumtx", name="tx_hash", - field=gnosis.eth.django.models.Sha3HashField( + field=safe_eth.eth.django.models.Sha3HashField( primary_key=True, serialize=False ), ), diff --git a/safe_transaction_service/history/migrations/0016_multisigconfirmation_signature_type.py b/safe_transaction_service/history/migrations/0016_multisigconfirmation_signature_type.py index 45b7bead1..9d943e8f8 100644 --- a/safe_transaction_service/history/migrations/0016_multisigconfirmation_signature_type.py +++ b/safe_transaction_service/history/migrations/0016_multisigconfirmation_signature_type.py @@ -3,8 +3,7 @@ from django.db import migrations, models from hexbytes import HexBytes - -from gnosis.safe.safe_signature import ( +from safe_eth.safe.safe_signature import ( SafeSignature, SafeSignatureApprovedHash, SafeSignatureType, diff --git a/safe_transaction_service/history/migrations/0017_safecontractdelegate.py b/safe_transaction_service/history/migrations/0017_safecontractdelegate.py index aa28b2bf1..7dc47bb5e 100644 --- a/safe_transaction_service/history/migrations/0017_safecontractdelegate.py +++ b/safe_transaction_service/history/migrations/0017_safecontractdelegate.py @@ -3,7 +3,7 @@ import django.db.models.deletion from django.db import migrations, models -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -24,8 +24,8 @@ class Migration(migrations.Migration): verbose_name="ID", ), ), - ("delegate", gnosis.eth.django.models.EthereumAddressField()), - ("delegator", gnosis.eth.django.models.EthereumAddressField()), + ("delegate", safe_eth.eth.django.models.EthereumAddressField()), + ("delegator", safe_eth.eth.django.models.EthereumAddressField()), ("label", models.CharField(max_length=50)), ("read", models.BooleanField(default=True)), ("write", models.BooleanField(default=True)), diff --git a/safe_transaction_service/history/migrations/0023_auto_20200924_0841.py b/safe_transaction_service/history/migrations/0023_auto_20200924_0841.py index a2196104a..dda19958e 100644 --- a/safe_transaction_service/history/migrations/0023_auto_20200924_0841.py +++ b/safe_transaction_service/history/migrations/0023_auto_20200924_0841.py @@ -2,7 +2,7 @@ from django.db import migrations -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -14,7 +14,7 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="multisigconfirmation", name="signature", - field=gnosis.eth.django.models.HexField( + field=safe_eth.eth.django.models.HexField( default=None, max_length=2000, null=True ), ), diff --git a/safe_transaction_service/history/migrations/0029_auto_20201118_1015.py b/safe_transaction_service/history/migrations/0029_auto_20201118_1015.py index ce3436c62..2b4adf853 100644 --- a/safe_transaction_service/history/migrations/0029_auto_20201118_1015.py +++ b/safe_transaction_service/history/migrations/0029_auto_20201118_1015.py @@ -3,7 +3,7 @@ import django.contrib.postgres.fields from django.db import migrations, models -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -16,7 +16,7 @@ class Migration(migrations.Migration): model_name="safestatus", name="owners", field=django.contrib.postgres.fields.ArrayField( - base_field=gnosis.eth.django.models.EthereumAddressField(), + base_field=safe_eth.eth.django.models.EthereumAddressField(), db_index=True, size=None, ), diff --git a/safe_transaction_service/history/migrations/0033_auto_20210318_1654.py b/safe_transaction_service/history/migrations/0033_auto_20210318_1654.py index c339d30e0..ff65d7fba 100644 --- a/safe_transaction_service/history/migrations/0033_auto_20210318_1654.py +++ b/safe_transaction_service/history/migrations/0033_auto_20210318_1654.py @@ -4,7 +4,7 @@ import django.contrib.postgres.indexes from django.db import migrations -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -17,7 +17,7 @@ class Migration(migrations.Migration): model_name="safestatus", name="owners", field=django.contrib.postgres.fields.ArrayField( - base_field=gnosis.eth.django.models.EthereumAddressField(), size=None + base_field=safe_eth.eth.django.models.EthereumAddressField(), size=None ), ), migrations.AddIndex( diff --git a/safe_transaction_service/history/migrations/0036_fix_exec_from_module.py b/safe_transaction_service/history/migrations/0036_fix_exec_from_module.py index dbd0249c9..51b7b4dc6 100644 --- a/safe_transaction_service/history/migrations/0036_fix_exec_from_module.py +++ b/safe_transaction_service/history/migrations/0036_fix_exec_from_module.py @@ -3,7 +3,7 @@ from django.db import migrations -from gnosis.eth import get_auto_ethereum_client +from safe_eth.eth import get_auto_ethereum_client from ..utils import clean_receipt_log diff --git a/safe_transaction_service/history/migrations/0038_safestatus_guard.py b/safe_transaction_service/history/migrations/0038_safestatus_guard.py index a9abde8cd..75234aa2b 100644 --- a/safe_transaction_service/history/migrations/0038_safestatus_guard.py +++ b/safe_transaction_service/history/migrations/0038_safestatus_guard.py @@ -2,7 +2,7 @@ from django.db import migrations -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -14,7 +14,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name="safestatus", name="guard", - field=gnosis.eth.django.models.EthereumAddressField( + field=safe_eth.eth.django.models.EthereumAddressField( default=None, null=True ), ), diff --git a/safe_transaction_service/history/migrations/0039_safel2mastercopy_20210519.py b/safe_transaction_service/history/migrations/0039_safel2mastercopy_20210519.py index 73f2b0b7d..349087ecd 100644 --- a/safe_transaction_service/history/migrations/0039_safel2mastercopy_20210519.py +++ b/safe_transaction_service/history/migrations/0039_safel2mastercopy_20210519.py @@ -3,7 +3,7 @@ import django.db.models.manager from django.db import migrations, models -import gnosis.eth.django.models +import safe_eth.eth.django.models import safe_transaction_service.history.models @@ -19,7 +19,7 @@ class Migration(migrations.Migration): fields=[ ( "address", - gnosis.eth.django.models.EthereumAddressField( + safe_eth.eth.django.models.EthereumAddressField( primary_key=True, serialize=False ), ), diff --git a/safe_transaction_service/history/migrations/0045_erc20transfer_erc721transfer.py b/safe_transaction_service/history/migrations/0045_erc20transfer_erc721transfer.py index 09aa48798..f6e8e464d 100644 --- a/safe_transaction_service/history/migrations/0045_erc20transfer_erc721transfer.py +++ b/safe_transaction_service/history/migrations/0045_erc20transfer_erc721transfer.py @@ -3,7 +3,7 @@ import django.db.models.deletion from django.db import migrations, models -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -26,12 +26,15 @@ class Migration(migrations.Migration): ), ( "address", - gnosis.eth.django.models.EthereumAddressField(db_index=True), + safe_eth.eth.django.models.EthereumAddressField(db_index=True), ), - ("_from", gnosis.eth.django.models.EthereumAddressField(db_index=True)), - ("to", gnosis.eth.django.models.EthereumAddressField(db_index=True)), + ( + "_from", + safe_eth.eth.django.models.EthereumAddressField(db_index=True), + ), + ("to", safe_eth.eth.django.models.EthereumAddressField(db_index=True)), ("log_index", models.PositiveIntegerField()), - ("value", gnosis.eth.django.models.Uint256Field()), + ("value", safe_eth.eth.django.models.Uint256Field()), ( "ethereum_tx", models.ForeignKey( @@ -59,12 +62,15 @@ class Migration(migrations.Migration): ), ( "address", - gnosis.eth.django.models.EthereumAddressField(db_index=True), + safe_eth.eth.django.models.EthereumAddressField(db_index=True), + ), + ( + "_from", + safe_eth.eth.django.models.EthereumAddressField(db_index=True), ), - ("_from", gnosis.eth.django.models.EthereumAddressField(db_index=True)), - ("to", gnosis.eth.django.models.EthereumAddressField(db_index=True)), + ("to", safe_eth.eth.django.models.EthereumAddressField(db_index=True)), ("log_index", models.PositiveIntegerField()), - ("token_id", gnosis.eth.django.models.Uint256Field()), + ("token_id", safe_eth.eth.django.models.Uint256Field()), ( "ethereum_tx", models.ForeignKey( diff --git a/safe_transaction_service/history/migrations/0048_block_number_token_transfers_20211126_1443.py b/safe_transaction_service/history/migrations/0048_block_number_token_transfers_20211126_1443.py index 4f87012de..5d88247dc 100644 --- a/safe_transaction_service/history/migrations/0048_block_number_token_transfers_20211126_1443.py +++ b/safe_transaction_service/history/migrations/0048_block_number_token_transfers_20211126_1443.py @@ -3,7 +3,7 @@ import django.utils.timezone from django.db import migrations, models -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -43,22 +43,22 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="erc20transfer", name="_from", - field=gnosis.eth.django.models.EthereumAddressField(), + field=safe_eth.eth.django.models.EthereumAddressField(), ), migrations.AlterField( model_name="erc20transfer", name="to", - field=gnosis.eth.django.models.EthereumAddressField(), + field=safe_eth.eth.django.models.EthereumAddressField(), ), migrations.AlterField( model_name="erc721transfer", name="_from", - field=gnosis.eth.django.models.EthereumAddressField(), + field=safe_eth.eth.django.models.EthereumAddressField(), ), migrations.AlterField( model_name="erc721transfer", name="to", - field=gnosis.eth.django.models.EthereumAddressField(), + field=safe_eth.eth.django.models.EthereumAddressField(), ), migrations.AddIndex( model_name="erc20transfer", @@ -87,12 +87,12 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="erc20transfer", name="address", - field=gnosis.eth.django.models.EthereumAddressField(), + field=safe_eth.eth.django.models.EthereumAddressField(), ), migrations.AlterField( model_name="erc721transfer", name="address", - field=gnosis.eth.django.models.EthereumAddressField(), + field=safe_eth.eth.django.models.EthereumAddressField(), ), migrations.AddIndex( model_name="erc20transfer", diff --git a/safe_transaction_service/history/migrations/0049_block_number_internaltx_20211129_1111.py b/safe_transaction_service/history/migrations/0049_block_number_internaltx_20211129_1111.py index e868da6dd..c4800fd3e 100644 --- a/safe_transaction_service/history/migrations/0049_block_number_internaltx_20211129_1111.py +++ b/safe_transaction_service/history/migrations/0049_block_number_internaltx_20211129_1111.py @@ -3,7 +3,7 @@ import django.utils.timezone from django.db import migrations, models -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -29,12 +29,12 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="internaltx", name="_from", - field=gnosis.eth.django.models.EthereumAddressField(null=True), + field=safe_eth.eth.django.models.EthereumAddressField(null=True), ), migrations.AlterField( model_name="internaltx", name="to", - field=gnosis.eth.django.models.EthereumAddressField(null=True), + field=safe_eth.eth.django.models.EthereumAddressField(null=True), ), migrations.AddIndex( model_name="internaltx", diff --git a/safe_transaction_service/history/migrations/0050_ethereum_address_field_v2_20211201_1507.py b/safe_transaction_service/history/migrations/0050_ethereum_address_field_v2_20211201_1507.py index 24e01ee99..737e5e23b 100644 --- a/safe_transaction_service/history/migrations/0050_ethereum_address_field_v2_20211201_1507.py +++ b/safe_transaction_service/history/migrations/0050_ethereum_address_field_v2_20211201_1507.py @@ -3,7 +3,7 @@ import django.contrib.postgres.fields from django.db import migrations -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -90,154 +90,154 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="erc20transfer", name="_from", - field=gnosis.eth.django.models.EthereumAddressV2Field(), + field=safe_eth.eth.django.models.EthereumAddressV2Field(), ), migrations.AlterField( model_name="erc20transfer", name="address", - field=gnosis.eth.django.models.EthereumAddressV2Field(), + field=safe_eth.eth.django.models.EthereumAddressV2Field(), ), migrations.AlterField( model_name="erc20transfer", name="to", - field=gnosis.eth.django.models.EthereumAddressV2Field(), + field=safe_eth.eth.django.models.EthereumAddressV2Field(), ), migrations.AlterField( model_name="erc721transfer", name="_from", - field=gnosis.eth.django.models.EthereumAddressV2Field(), + field=safe_eth.eth.django.models.EthereumAddressV2Field(), ), migrations.AlterField( model_name="erc721transfer", name="address", - field=gnosis.eth.django.models.EthereumAddressV2Field(), + field=safe_eth.eth.django.models.EthereumAddressV2Field(), ), migrations.AlterField( model_name="erc721transfer", name="to", - field=gnosis.eth.django.models.EthereumAddressV2Field(), + field=safe_eth.eth.django.models.EthereumAddressV2Field(), ), migrations.AlterField( model_name="ethereumtx", name="_from", - field=gnosis.eth.django.models.EthereumAddressV2Field( + field=safe_eth.eth.django.models.EthereumAddressV2Field( db_index=True, null=True ), ), migrations.AlterField( model_name="ethereumtx", name="to", - field=gnosis.eth.django.models.EthereumAddressV2Field( + field=safe_eth.eth.django.models.EthereumAddressV2Field( db_index=True, null=True ), ), migrations.AlterField( model_name="internaltx", name="_from", - field=gnosis.eth.django.models.EthereumAddressV2Field(null=True), + field=safe_eth.eth.django.models.EthereumAddressV2Field(null=True), ), migrations.AlterField( model_name="internaltx", name="contract_address", - field=gnosis.eth.django.models.EthereumAddressV2Field( + field=safe_eth.eth.django.models.EthereumAddressV2Field( db_index=True, null=True ), ), migrations.AlterField( model_name="internaltx", name="refund_address", - field=gnosis.eth.django.models.EthereumAddressV2Field( + field=safe_eth.eth.django.models.EthereumAddressV2Field( db_index=True, null=True ), ), migrations.AlterField( model_name="internaltx", name="to", - field=gnosis.eth.django.models.EthereumAddressV2Field(null=True), + field=safe_eth.eth.django.models.EthereumAddressV2Field(null=True), ), migrations.AlterField( model_name="moduletransaction", name="module", - field=gnosis.eth.django.models.EthereumAddressV2Field(db_index=True), + field=safe_eth.eth.django.models.EthereumAddressV2Field(db_index=True), ), migrations.AlterField( model_name="moduletransaction", name="safe", - field=gnosis.eth.django.models.EthereumAddressV2Field(db_index=True), + field=safe_eth.eth.django.models.EthereumAddressV2Field(db_index=True), ), migrations.AlterField( model_name="moduletransaction", name="to", - field=gnosis.eth.django.models.EthereumAddressV2Field(db_index=True), + field=safe_eth.eth.django.models.EthereumAddressV2Field(db_index=True), ), migrations.AlterField( model_name="multisigconfirmation", name="owner", - field=gnosis.eth.django.models.EthereumAddressV2Field(), + field=safe_eth.eth.django.models.EthereumAddressV2Field(), ), migrations.AlterField( model_name="multisigtransaction", name="gas_token", - field=gnosis.eth.django.models.EthereumAddressV2Field(null=True), + field=safe_eth.eth.django.models.EthereumAddressV2Field(null=True), ), migrations.AlterField( model_name="multisigtransaction", name="refund_receiver", - field=gnosis.eth.django.models.EthereumAddressV2Field(null=True), + field=safe_eth.eth.django.models.EthereumAddressV2Field(null=True), ), migrations.AlterField( model_name="multisigtransaction", name="safe", - field=gnosis.eth.django.models.EthereumAddressV2Field(db_index=True), + field=safe_eth.eth.django.models.EthereumAddressV2Field(db_index=True), ), migrations.AlterField( model_name="multisigtransaction", name="to", - field=gnosis.eth.django.models.EthereumAddressV2Field( + field=safe_eth.eth.django.models.EthereumAddressV2Field( db_index=True, null=True ), ), migrations.AlterField( model_name="proxyfactory", name="address", - field=gnosis.eth.django.models.EthereumAddressV2Field( + field=safe_eth.eth.django.models.EthereumAddressV2Field( primary_key=True, serialize=False ), ), migrations.AlterField( model_name="safecontract", name="address", - field=gnosis.eth.django.models.EthereumAddressV2Field( + field=safe_eth.eth.django.models.EthereumAddressV2Field( primary_key=True, serialize=False ), ), migrations.AlterField( model_name="safecontractdelegate", name="delegate", - field=gnosis.eth.django.models.EthereumAddressV2Field(), + field=safe_eth.eth.django.models.EthereumAddressV2Field(), ), migrations.AlterField( model_name="safecontractdelegate", name="delegator", - field=gnosis.eth.django.models.EthereumAddressV2Field(), + field=safe_eth.eth.django.models.EthereumAddressV2Field(), ), migrations.AlterField( model_name="safemastercopy", name="address", - field=gnosis.eth.django.models.EthereumAddressV2Field( + field=safe_eth.eth.django.models.EthereumAddressV2Field( primary_key=True, serialize=False ), ), migrations.AlterField( model_name="safestatus", name="address", - field=gnosis.eth.django.models.EthereumAddressV2Field(db_index=True), + field=safe_eth.eth.django.models.EthereumAddressV2Field(db_index=True), ), migrations.AlterField( model_name="safestatus", name="enabled_modules", field=django.contrib.postgres.fields.ArrayField( - base_field=gnosis.eth.django.models.EthereumAddressV2Field(), + base_field=safe_eth.eth.django.models.EthereumAddressV2Field(), default=list, size=None, ), @@ -245,31 +245,32 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="safestatus", name="fallback_handler", - field=gnosis.eth.django.models.EthereumAddressV2Field(), + field=safe_eth.eth.django.models.EthereumAddressV2Field(), ), migrations.AlterField( model_name="safestatus", name="guard", - field=gnosis.eth.django.models.EthereumAddressV2Field( + field=safe_eth.eth.django.models.EthereumAddressV2Field( default=None, null=True ), ), migrations.AlterField( model_name="safestatus", name="master_copy", - field=gnosis.eth.django.models.EthereumAddressV2Field(), + field=safe_eth.eth.django.models.EthereumAddressV2Field(), ), migrations.AlterField( model_name="safestatus", name="owners", field=django.contrib.postgres.fields.ArrayField( - base_field=gnosis.eth.django.models.EthereumAddressV2Field(), size=None + base_field=safe_eth.eth.django.models.EthereumAddressV2Field(), + size=None, ), ), migrations.AlterField( model_name="webhook", name="address", - field=gnosis.eth.django.models.EthereumAddressV2Field( + field=safe_eth.eth.django.models.EthereumAddressV2Field( db_index=True, null=True ), ), diff --git a/safe_transaction_service/history/migrations/0052_keccak256_field_20211209_1628.py b/safe_transaction_service/history/migrations/0052_keccak256_field_20211209_1628.py index 75d61ac40..129467c29 100644 --- a/safe_transaction_service/history/migrations/0052_keccak256_field_20211209_1628.py +++ b/safe_transaction_service/history/migrations/0052_keccak256_field_20211209_1628.py @@ -2,7 +2,7 @@ from django.db import migrations -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -64,29 +64,29 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="ethereumblock", name="block_hash", - field=gnosis.eth.django.models.Keccak256Field(unique=True), + field=safe_eth.eth.django.models.Keccak256Field(unique=True), ), migrations.AlterField( model_name="ethereumblock", name="parent_hash", - field=gnosis.eth.django.models.Keccak256Field(unique=True), + field=safe_eth.eth.django.models.Keccak256Field(unique=True), ), migrations.AlterField( model_name="ethereumtx", name="tx_hash", - field=gnosis.eth.django.models.Keccak256Field( + field=safe_eth.eth.django.models.Keccak256Field( primary_key=True, serialize=False ), ), migrations.AlterField( model_name="multisigconfirmation", name="multisig_transaction_hash", - field=gnosis.eth.django.models.Keccak256Field(db_index=True, null=True), + field=safe_eth.eth.django.models.Keccak256Field(db_index=True, null=True), ), migrations.AlterField( model_name="multisigtransaction", name="safe_tx_hash", - field=gnosis.eth.django.models.Keccak256Field( + field=safe_eth.eth.django.models.Keccak256Field( primary_key=True, serialize=False ), ), diff --git a/safe_transaction_service/history/migrations/0053_alter_webhook_address.py b/safe_transaction_service/history/migrations/0053_alter_webhook_address.py index 97a433a5b..ad41cca68 100644 --- a/safe_transaction_service/history/migrations/0053_alter_webhook_address.py +++ b/safe_transaction_service/history/migrations/0053_alter_webhook_address.py @@ -2,7 +2,7 @@ from django.db import migrations -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -14,7 +14,7 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="webhook", name="address", - field=gnosis.eth.django.models.EthereumAddressV2Field( + field=safe_eth.eth.django.models.EthereumAddressV2Field( blank=True, db_index=True, null=True ), ), diff --git a/safe_transaction_service/history/migrations/0056_alter_multisigconfirmation_signature.py b/safe_transaction_service/history/migrations/0056_alter_multisigconfirmation_signature.py index 6e5576a54..47269d090 100644 --- a/safe_transaction_service/history/migrations/0056_alter_multisigconfirmation_signature.py +++ b/safe_transaction_service/history/migrations/0056_alter_multisigconfirmation_signature.py @@ -2,7 +2,7 @@ from django.db import migrations -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -14,7 +14,7 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="multisigconfirmation", name="signature", - field=gnosis.eth.django.models.HexField( + field=safe_eth.eth.django.models.HexField( default=None, max_length=5000, null=True ), ), diff --git a/safe_transaction_service/history/migrations/0060_add_eip1559_fields_20220419_0955.py b/safe_transaction_service/history/migrations/0060_add_eip1559_fields_20220419_0955.py index fabad44fe..d1dd2e69e 100644 --- a/safe_transaction_service/history/migrations/0060_add_eip1559_fields_20220419_0955.py +++ b/safe_transaction_service/history/migrations/0060_add_eip1559_fields_20220419_0955.py @@ -2,7 +2,7 @@ from django.db import migrations, models -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -14,14 +14,14 @@ class Migration(migrations.Migration): migrations.AddField( model_name="ethereumtx", name="max_fee_per_gas", - field=gnosis.eth.django.models.Uint256Field( + field=safe_eth.eth.django.models.Uint256Field( blank=True, default=None, null=True ), ), migrations.AddField( model_name="ethereumtx", name="max_priority_fee_per_gas", - field=gnosis.eth.django.models.Uint256Field( + field=safe_eth.eth.django.models.Uint256Field( blank=True, default=None, null=True ), ), diff --git a/safe_transaction_service/history/migrations/0062_add_safe_last_status_20220429_0922.py b/safe_transaction_service/history/migrations/0062_add_safe_last_status_20220429_0922.py index 1302d44b3..921b8e687 100644 --- a/safe_transaction_service/history/migrations/0062_add_safe_last_status_20220429_0922.py +++ b/safe_transaction_service/history/migrations/0062_add_safe_last_status_20220429_0922.py @@ -5,7 +5,7 @@ import django.db.models.deletion from django.db import migrations, models -import gnosis.eth.django.models +import safe_eth.eth.django.models def init_safe_last_status(apps, schema_editor): @@ -48,31 +48,34 @@ class Migration(migrations.Migration): fields=[ ( "address", - gnosis.eth.django.models.EthereumAddressV2Field( + safe_eth.eth.django.models.EthereumAddressV2Field( db_index=True, primary_key=True, serialize=False ), ), ( "owners", django.contrib.postgres.fields.ArrayField( - base_field=gnosis.eth.django.models.EthereumAddressV2Field(), + base_field=safe_eth.eth.django.models.EthereumAddressV2Field(), size=None, ), ), - ("threshold", gnosis.eth.django.models.Uint256Field()), - ("nonce", gnosis.eth.django.models.Uint256Field(default=0)), - ("master_copy", gnosis.eth.django.models.EthereumAddressV2Field()), - ("fallback_handler", gnosis.eth.django.models.EthereumAddressV2Field()), + ("threshold", safe_eth.eth.django.models.Uint256Field()), + ("nonce", safe_eth.eth.django.models.Uint256Field(default=0)), + ("master_copy", safe_eth.eth.django.models.EthereumAddressV2Field()), + ( + "fallback_handler", + safe_eth.eth.django.models.EthereumAddressV2Field(), + ), ( "guard", - gnosis.eth.django.models.EthereumAddressV2Field( + safe_eth.eth.django.models.EthereumAddressV2Field( default=None, null=True ), ), ( "enabled_modules", django.contrib.postgres.fields.ArrayField( - base_field=gnosis.eth.django.models.EthereumAddressV2Field(), + base_field=safe_eth.eth.django.models.EthereumAddressV2Field(), default=list, size=None, ), diff --git a/safe_transaction_service/history/migrations/0063_alter_internaltx__from.py b/safe_transaction_service/history/migrations/0063_alter_internaltx__from.py index 7331b4130..abefeb656 100644 --- a/safe_transaction_service/history/migrations/0063_alter_internaltx__from.py +++ b/safe_transaction_service/history/migrations/0063_alter_internaltx__from.py @@ -2,7 +2,7 @@ from django.db import migrations -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -14,7 +14,7 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="internaltx", name="_from", - field=gnosis.eth.django.models.EthereumAddressV2Field( + field=safe_eth.eth.django.models.EthereumAddressV2Field( db_index=True, null=True ), ), diff --git a/safe_transaction_service/history/migrations/0064_auto_20220523_0919.py b/safe_transaction_service/history/migrations/0064_auto_20220523_0919.py index 7bd3f130a..be8a30842 100644 --- a/safe_transaction_service/history/migrations/0064_auto_20220523_0919.py +++ b/safe_transaction_service/history/migrations/0064_auto_20220523_0919.py @@ -3,7 +3,7 @@ import django.contrib.postgres.fields from django.db import migrations -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -16,7 +16,7 @@ class Migration(migrations.Migration): model_name="safelaststatus", name="enabled_modules", field=django.contrib.postgres.fields.ArrayField( - base_field=gnosis.eth.django.models.EthereumAddressV2Field(), + base_field=safe_eth.eth.django.models.EthereumAddressV2Field(), blank=True, default=list, size=None, @@ -26,7 +26,7 @@ class Migration(migrations.Migration): model_name="safestatus", name="enabled_modules", field=django.contrib.postgres.fields.ArrayField( - base_field=gnosis.eth.django.models.EthereumAddressV2Field(), + base_field=safe_eth.eth.django.models.EthereumAddressV2Field(), blank=True, default=list, size=None, diff --git a/safe_transaction_service/history/migrations/0066_auto_20220628_1125.py b/safe_transaction_service/history/migrations/0066_auto_20220628_1125.py index c00dbb8fc..2c9e39566 100644 --- a/safe_transaction_service/history/migrations/0066_auto_20220628_1125.py +++ b/safe_transaction_service/history/migrations/0066_auto_20220628_1125.py @@ -2,7 +2,7 @@ from django.db import migrations -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -14,11 +14,11 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="ethereumblock", name="gas_limit", - field=gnosis.eth.django.models.Uint256Field(), + field=safe_eth.eth.django.models.Uint256Field(), ), migrations.AlterField( model_name="ethereumblock", name="gas_used", - field=gnosis.eth.django.models.Uint256Field(), + field=safe_eth.eth.django.models.Uint256Field(), ), ] diff --git a/safe_transaction_service/history/migrations/0067_auto_20220705_1545.py b/safe_transaction_service/history/migrations/0067_auto_20220705_1545.py index 36984b945..dce983a08 100644 --- a/safe_transaction_service/history/migrations/0067_auto_20220705_1545.py +++ b/safe_transaction_service/history/migrations/0067_auto_20220705_1545.py @@ -2,7 +2,7 @@ from django.db import migrations, models -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -26,7 +26,7 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="multisigtransaction", name="gas_token", - field=gnosis.eth.django.models.EthereumAddressV2Field( + field=safe_eth.eth.django.models.EthereumAddressV2Field( blank=True, null=True ), ), @@ -38,7 +38,7 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="multisigtransaction", name="refund_receiver", - field=gnosis.eth.django.models.EthereumAddressV2Field( + field=safe_eth.eth.django.models.EthereumAddressV2Field( blank=True, null=True ), ), diff --git a/safe_transaction_service/history/migrations/0075_multisigtransaction_proposer.py b/safe_transaction_service/history/migrations/0075_multisigtransaction_proposer.py index 5f4d6f4e8..c362f9518 100644 --- a/safe_transaction_service/history/migrations/0075_multisigtransaction_proposer.py +++ b/safe_transaction_service/history/migrations/0075_multisigtransaction_proposer.py @@ -2,7 +2,7 @@ from django.db import migrations -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -14,6 +14,6 @@ class Migration(migrations.Migration): migrations.AddField( model_name="multisigtransaction", name="proposer", - field=gnosis.eth.django.models.EthereumAddressV2Field(null=True), + field=safe_eth.eth.django.models.EthereumAddressV2Field(null=True), ), ] diff --git a/safe_transaction_service/history/migrations/0077_alter_safecontractdelegate_delegate_and_more.py b/safe_transaction_service/history/migrations/0077_alter_safecontractdelegate_delegate_and_more.py index f5f38c5ed..ec3d8cda3 100644 --- a/safe_transaction_service/history/migrations/0077_alter_safecontractdelegate_delegate_and_more.py +++ b/safe_transaction_service/history/migrations/0077_alter_safecontractdelegate_delegate_and_more.py @@ -2,7 +2,7 @@ from django.db import migrations -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -14,11 +14,11 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="safecontractdelegate", name="delegate", - field=gnosis.eth.django.models.EthereumAddressV2Field(db_index=True), + field=safe_eth.eth.django.models.EthereumAddressV2Field(db_index=True), ), migrations.AlterField( model_name="safecontractdelegate", name="delegator", - field=gnosis.eth.django.models.EthereumAddressV2Field(db_index=True), + field=safe_eth.eth.django.models.EthereumAddressV2Field(db_index=True), ), ] diff --git a/safe_transaction_service/history/migrations/0080_alter_multisigconfirmation_signature.py b/safe_transaction_service/history/migrations/0080_alter_multisigconfirmation_signature.py index 2cbdd488f..138e5a309 100644 --- a/safe_transaction_service/history/migrations/0080_alter_multisigconfirmation_signature.py +++ b/safe_transaction_service/history/migrations/0080_alter_multisigconfirmation_signature.py @@ -2,7 +2,7 @@ from django.db import migrations -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -23,7 +23,7 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="multisigconfirmation", name="signature", - field=gnosis.eth.django.models.HexV2Field( + field=safe_eth.eth.django.models.HexV2Field( default=None, max_length=5000, null=True ), ), diff --git a/safe_transaction_service/history/migrations/0083_alter_moduletransaction_safe_and_more.py b/safe_transaction_service/history/migrations/0083_alter_moduletransaction_safe_and_more.py index 88003c6f4..322bc6518 100644 --- a/safe_transaction_service/history/migrations/0083_alter_moduletransaction_safe_and_more.py +++ b/safe_transaction_service/history/migrations/0083_alter_moduletransaction_safe_and_more.py @@ -2,7 +2,7 @@ from django.db import migrations, models -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -15,7 +15,7 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="moduletransaction", name="safe", - field=gnosis.eth.django.models.EthereumAddressV2Field(), + field=safe_eth.eth.django.models.EthereumAddressV2Field(), ), migrations.AddIndex( model_name="moduletransaction", diff --git a/safe_transaction_service/history/migrations/0084_alter_erc20transfer__from_and_more.py b/safe_transaction_service/history/migrations/0084_alter_erc20transfer__from_and_more.py index 28b0b51a0..178da3b0f 100644 --- a/safe_transaction_service/history/migrations/0084_alter_erc20transfer__from_and_more.py +++ b/safe_transaction_service/history/migrations/0084_alter_erc20transfer__from_and_more.py @@ -3,7 +3,7 @@ import django.contrib.postgres.fields from django.db import migrations -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -16,152 +16,152 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="erc20transfer", name="_from", - field=gnosis.eth.django.models.EthereumAddressBinaryField(), + field=safe_eth.eth.django.models.EthereumAddressBinaryField(), ), migrations.AlterField( model_name="erc20transfer", name="address", - field=gnosis.eth.django.models.EthereumAddressBinaryField(), + field=safe_eth.eth.django.models.EthereumAddressBinaryField(), ), migrations.AlterField( model_name="erc20transfer", name="to", - field=gnosis.eth.django.models.EthereumAddressBinaryField(), + field=safe_eth.eth.django.models.EthereumAddressBinaryField(), ), migrations.AlterField( model_name="erc721transfer", name="_from", - field=gnosis.eth.django.models.EthereumAddressBinaryField(), + field=safe_eth.eth.django.models.EthereumAddressBinaryField(), ), migrations.AlterField( model_name="erc721transfer", name="address", - field=gnosis.eth.django.models.EthereumAddressBinaryField(), + field=safe_eth.eth.django.models.EthereumAddressBinaryField(), ), migrations.AlterField( model_name="erc721transfer", name="to", - field=gnosis.eth.django.models.EthereumAddressBinaryField(), + field=safe_eth.eth.django.models.EthereumAddressBinaryField(), ), migrations.AlterField( model_name="ethereumtx", name="_from", - field=gnosis.eth.django.models.EthereumAddressBinaryField( + field=safe_eth.eth.django.models.EthereumAddressBinaryField( db_index=True, null=True ), ), migrations.AlterField( model_name="ethereumtx", name="to", - field=gnosis.eth.django.models.EthereumAddressBinaryField( + field=safe_eth.eth.django.models.EthereumAddressBinaryField( db_index=True, null=True ), ), migrations.AlterField( model_name="internaltx", name="_from", - field=gnosis.eth.django.models.EthereumAddressBinaryField( + field=safe_eth.eth.django.models.EthereumAddressBinaryField( db_index=True, null=True ), ), migrations.AlterField( model_name="internaltx", name="contract_address", - field=gnosis.eth.django.models.EthereumAddressBinaryField( + field=safe_eth.eth.django.models.EthereumAddressBinaryField( db_index=True, null=True ), ), migrations.AlterField( model_name="internaltx", name="refund_address", - field=gnosis.eth.django.models.EthereumAddressBinaryField( + field=safe_eth.eth.django.models.EthereumAddressBinaryField( db_index=True, null=True ), ), migrations.AlterField( model_name="internaltx", name="to", - field=gnosis.eth.django.models.EthereumAddressBinaryField(null=True), + field=safe_eth.eth.django.models.EthereumAddressBinaryField(null=True), ), migrations.AlterField( model_name="moduletransaction", name="module", - field=gnosis.eth.django.models.EthereumAddressBinaryField(db_index=True), + field=safe_eth.eth.django.models.EthereumAddressBinaryField(db_index=True), ), migrations.AlterField( model_name="moduletransaction", name="safe", - field=gnosis.eth.django.models.EthereumAddressBinaryField(), + field=safe_eth.eth.django.models.EthereumAddressBinaryField(), ), migrations.AlterField( model_name="moduletransaction", name="to", - field=gnosis.eth.django.models.EthereumAddressBinaryField(db_index=True), + field=safe_eth.eth.django.models.EthereumAddressBinaryField(db_index=True), ), migrations.AlterField( model_name="multisigconfirmation", name="owner", - field=gnosis.eth.django.models.EthereumAddressBinaryField(), + field=safe_eth.eth.django.models.EthereumAddressBinaryField(), ), migrations.AlterField( model_name="multisigtransaction", name="gas_token", - field=gnosis.eth.django.models.EthereumAddressBinaryField( + field=safe_eth.eth.django.models.EthereumAddressBinaryField( blank=True, null=True ), ), migrations.AlterField( model_name="multisigtransaction", name="proposer", - field=gnosis.eth.django.models.EthereumAddressBinaryField(null=True), + field=safe_eth.eth.django.models.EthereumAddressBinaryField(null=True), ), migrations.AlterField( model_name="multisigtransaction", name="refund_receiver", - field=gnosis.eth.django.models.EthereumAddressBinaryField( + field=safe_eth.eth.django.models.EthereumAddressBinaryField( blank=True, null=True ), ), migrations.AlterField( model_name="multisigtransaction", name="safe", - field=gnosis.eth.django.models.EthereumAddressBinaryField(db_index=True), + field=safe_eth.eth.django.models.EthereumAddressBinaryField(db_index=True), ), migrations.AlterField( model_name="multisigtransaction", name="to", - field=gnosis.eth.django.models.EthereumAddressBinaryField( + field=safe_eth.eth.django.models.EthereumAddressBinaryField( db_index=True, null=True ), ), migrations.AlterField( model_name="proxyfactory", name="address", - field=gnosis.eth.django.models.EthereumAddressBinaryField( + field=safe_eth.eth.django.models.EthereumAddressBinaryField( primary_key=True, serialize=False ), ), migrations.AlterField( model_name="safecontract", name="address", - field=gnosis.eth.django.models.EthereumAddressBinaryField( + field=safe_eth.eth.django.models.EthereumAddressBinaryField( primary_key=True, serialize=False ), ), migrations.AlterField( model_name="safecontractdelegate", name="delegate", - field=gnosis.eth.django.models.EthereumAddressBinaryField(db_index=True), + field=safe_eth.eth.django.models.EthereumAddressBinaryField(db_index=True), ), migrations.AlterField( model_name="safecontractdelegate", name="delegator", - field=gnosis.eth.django.models.EthereumAddressBinaryField(db_index=True), + field=safe_eth.eth.django.models.EthereumAddressBinaryField(db_index=True), ), migrations.AlterField( model_name="safelaststatus", name="address", - field=gnosis.eth.django.models.EthereumAddressBinaryField( + field=safe_eth.eth.django.models.EthereumAddressBinaryField( db_index=True, primary_key=True, serialize=False ), ), @@ -169,7 +169,7 @@ class Migration(migrations.Migration): model_name="safelaststatus", name="enabled_modules", field=django.contrib.postgres.fields.ArrayField( - base_field=gnosis.eth.django.models.EthereumAddressBinaryField(), + base_field=safe_eth.eth.django.models.EthereumAddressBinaryField(), blank=True, default=list, size=None, @@ -178,45 +178,45 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="safelaststatus", name="fallback_handler", - field=gnosis.eth.django.models.EthereumAddressBinaryField(), + field=safe_eth.eth.django.models.EthereumAddressBinaryField(), ), migrations.AlterField( model_name="safelaststatus", name="guard", - field=gnosis.eth.django.models.EthereumAddressBinaryField( + field=safe_eth.eth.django.models.EthereumAddressBinaryField( default=None, null=True ), ), migrations.AlterField( model_name="safelaststatus", name="master_copy", - field=gnosis.eth.django.models.EthereumAddressBinaryField(), + field=safe_eth.eth.django.models.EthereumAddressBinaryField(), ), migrations.AlterField( model_name="safelaststatus", name="owners", field=django.contrib.postgres.fields.ArrayField( - base_field=gnosis.eth.django.models.EthereumAddressBinaryField(), + base_field=safe_eth.eth.django.models.EthereumAddressBinaryField(), size=None, ), ), migrations.AlterField( model_name="safemastercopy", name="address", - field=gnosis.eth.django.models.EthereumAddressBinaryField( + field=safe_eth.eth.django.models.EthereumAddressBinaryField( primary_key=True, serialize=False ), ), migrations.AlterField( model_name="safestatus", name="address", - field=gnosis.eth.django.models.EthereumAddressBinaryField(db_index=True), + field=safe_eth.eth.django.models.EthereumAddressBinaryField(db_index=True), ), migrations.AlterField( model_name="safestatus", name="enabled_modules", field=django.contrib.postgres.fields.ArrayField( - base_field=gnosis.eth.django.models.EthereumAddressBinaryField(), + base_field=safe_eth.eth.django.models.EthereumAddressBinaryField(), blank=True, default=list, size=None, @@ -225,32 +225,32 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="safestatus", name="fallback_handler", - field=gnosis.eth.django.models.EthereumAddressBinaryField(), + field=safe_eth.eth.django.models.EthereumAddressBinaryField(), ), migrations.AlterField( model_name="safestatus", name="guard", - field=gnosis.eth.django.models.EthereumAddressBinaryField( + field=safe_eth.eth.django.models.EthereumAddressBinaryField( default=None, null=True ), ), migrations.AlterField( model_name="safestatus", name="master_copy", - field=gnosis.eth.django.models.EthereumAddressBinaryField(), + field=safe_eth.eth.django.models.EthereumAddressBinaryField(), ), migrations.AlterField( model_name="safestatus", name="owners", field=django.contrib.postgres.fields.ArrayField( - base_field=gnosis.eth.django.models.EthereumAddressBinaryField(), + base_field=safe_eth.eth.django.models.EthereumAddressBinaryField(), size=None, ), ), migrations.AlterField( model_name="webhook", name="address", - field=gnosis.eth.django.models.EthereumAddressBinaryField( + field=safe_eth.eth.django.models.EthereumAddressBinaryField( blank=True, db_index=True, null=True ), ), diff --git a/safe_transaction_service/history/migrations/0086_saferelevanttransaction.py b/safe_transaction_service/history/migrations/0086_saferelevanttransaction.py index f5ad94b96..34d6901c1 100644 --- a/safe_transaction_service/history/migrations/0086_saferelevanttransaction.py +++ b/safe_transaction_service/history/migrations/0086_saferelevanttransaction.py @@ -3,7 +3,7 @@ import django.db.models.deletion from django.db import migrations, models -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -26,7 +26,7 @@ class Migration(migrations.Migration): ), ), ("timestamp", models.DateTimeField()), - ("safe", gnosis.eth.django.models.EthereumAddressBinaryField()), + ("safe", safe_eth.eth.django.models.EthereumAddressBinaryField()), ( "ethereum_tx", models.ForeignKey( diff --git a/safe_transaction_service/history/models.py b/safe_transaction_service/history/models.py index 0695ca940..0752d6a6b 100644 --- a/safe_transaction_service/history/models.py +++ b/safe_transaction_service/history/models.py @@ -36,19 +36,18 @@ from hexbytes import HexBytes from model_utils.models import TimeStampedModel from packaging.version import Version -from web3.types import EventData - -from gnosis.eth.constants import ERC20_721_TRANSFER_TOPIC, NULL_ADDRESS -from gnosis.eth.django.models import ( +from safe_eth.eth.constants import ERC20_721_TRANSFER_TOPIC, NULL_ADDRESS +from safe_eth.eth.django.models import ( EthereumAddressBinaryField, HexV2Field, Keccak256Field, Uint256Field, ) -from gnosis.eth.utils import fast_to_checksum_address -from gnosis.safe import SafeOperationEnum -from gnosis.safe.safe import SafeInfo -from gnosis.safe.safe_signature import SafeSignature, SafeSignatureType +from safe_eth.eth.utils import fast_to_checksum_address +from safe_eth.safe import SafeOperationEnum +from safe_eth.safe.safe import SafeInfo +from safe_eth.safe.safe_signature import SafeSignature, SafeSignatureType +from web3.types import EventData from safe_transaction_service.account_abstraction.constants import ( USER_OPERATION_EVENT_TOPIC, diff --git a/safe_transaction_service/history/serializers.py b/safe_transaction_service/history/serializers.py index c4fcdb639..4aad34e33 100644 --- a/safe_transaction_service/history/serializers.py +++ b/safe_transaction_service/history/serializers.py @@ -9,21 +9,20 @@ from eth_typing import ChecksumAddress from rest_framework import serializers from rest_framework.exceptions import NotFound, ValidationError - -from gnosis.eth import EthereumClient, get_auto_ethereum_client -from gnosis.eth.constants import NULL_ADDRESS -from gnosis.eth.django.models import ( +from safe_eth.eth import EthereumClient, get_auto_ethereum_client +from safe_eth.eth.constants import NULL_ADDRESS +from safe_eth.eth.django.models import ( EthereumAddressBinaryField as EthereumAddressDbField, ) -from gnosis.eth.django.models import Keccak256Field as Keccak256DbField -from gnosis.eth.django.serializers import ( +from safe_eth.eth.django.models import Keccak256Field as Keccak256DbField +from safe_eth.eth.django.serializers import ( EthereumAddressField, HexadecimalField, Sha3HashField, ) -from gnosis.safe import Safe -from gnosis.safe.safe_signature import EthereumBytes, SafeSignature, SafeSignatureType -from gnosis.safe.serializers import SafeMultisigTxSerializer +from safe_eth.safe import Safe +from safe_eth.safe.safe_signature import EthereumBytes, SafeSignature, SafeSignatureType +from safe_eth.safe.serializers import SafeMultisigTxSerializer from safe_transaction_service.account_abstraction import serializers as aa_serializers from safe_transaction_service.contracts.tx_decoder import ( diff --git a/safe_transaction_service/history/services/balance_service.py b/safe_transaction_service/history/services/balance_service.py index b878cc3bc..f46a95f67 100644 --- a/safe_transaction_service/history/services/balance_service.py +++ b/safe_transaction_service/history/services/balance_service.py @@ -11,9 +11,8 @@ from cachetools import TTLCache, cachedmethod from eth_typing import ChecksumAddress from redis import Redis - -from gnosis.eth import EthereumClient, get_auto_ethereum_client -from gnosis.eth.utils import fast_is_checksum_address +from safe_eth.eth import EthereumClient, get_auto_ethereum_client +from safe_eth.eth.utils import fast_is_checksum_address from safe_transaction_service.tokens.models import Token from safe_transaction_service.utils.redis import get_redis diff --git a/safe_transaction_service/history/services/collectibles_service.py b/safe_transaction_service/history/services/collectibles_service.py index ee86ab7fa..78fceed90 100644 --- a/safe_transaction_service/history/services/collectibles_service.py +++ b/safe_transaction_service/history/services/collectibles_service.py @@ -16,9 +16,8 @@ from cachetools import TTLCache, cachedmethod from eth_typing import ChecksumAddress from redis import Redis - -from gnosis.eth import EthereumClient, EthereumNetwork, get_auto_ethereum_client -from gnosis.eth.clients import EnsClient +from safe_eth.eth import EthereumClient, EthereumNetwork, get_auto_ethereum_client +from safe_eth.eth.clients import EnsClient from safe_transaction_service.tokens.constants import ( CRYPTO_KITTIES_CONTRACT_ADDRESSES, diff --git a/safe_transaction_service/history/services/index_service.py b/safe_transaction_service/history/services/index_service.py index 8362b6f7b..e4911f369 100644 --- a/safe_transaction_service/history/services/index_service.py +++ b/safe_transaction_service/history/services/index_service.py @@ -7,8 +7,7 @@ from eth_typing import ChecksumAddress from hexbytes import HexBytes - -from gnosis.eth import EthereumClient, get_auto_ethereum_client +from safe_eth.eth import EthereumClient, get_auto_ethereum_client from ..models import EthereumBlock, EthereumTx from ..models import IndexingStatus as IndexingStatusDb diff --git a/safe_transaction_service/history/services/reorg_service.py b/safe_transaction_service/history/services/reorg_service.py index 263f758ff..c3e75b2f9 100644 --- a/safe_transaction_service/history/services/reorg_service.py +++ b/safe_transaction_service/history/services/reorg_service.py @@ -5,8 +5,7 @@ from django.db import transaction from hexbytes import HexBytes - -from gnosis.eth import EthereumClient, get_auto_ethereum_client +from safe_eth.eth import EthereumClient, get_auto_ethereum_client from ..indexers import ( Erc20EventsIndexerProvider, diff --git a/safe_transaction_service/history/services/safe_service.py b/safe_transaction_service/history/services/safe_service.py index c685a4236..befc94c5e 100644 --- a/safe_transaction_service/history/services/safe_service.py +++ b/safe_transaction_service/history/services/safe_service.py @@ -4,17 +4,16 @@ from typing import Optional, Tuple, Union from eth_typing import ChecksumAddress -from web3 import Web3 - -from gnosis.eth import EthereumClient, get_auto_ethereum_client -from gnosis.eth.contracts import ( +from safe_eth.eth import EthereumClient, get_auto_ethereum_client +from safe_eth.eth.contracts import ( get_cpk_factory_contract, get_proxy_factory_V1_3_0_contract, get_proxy_factory_V1_4_1_contract, ) -from gnosis.safe import Safe -from gnosis.safe.exceptions import CannotRetrieveSafeInfoException -from gnosis.safe.safe import SafeInfo +from safe_eth.safe import Safe +from safe_eth.safe.exceptions import CannotRetrieveSafeInfoException +from safe_eth.safe.safe import SafeInfo +from web3 import Web3 from safe_transaction_service.account_abstraction import models as aa_models diff --git a/safe_transaction_service/history/services/transaction_service.py b/safe_transaction_service/history/services/transaction_service.py index 09f2830cb..c52a137dc 100644 --- a/safe_transaction_service/history/services/transaction_service.py +++ b/safe_transaction_service/history/services/transaction_service.py @@ -10,8 +10,7 @@ from eth_typing import HexStr from redis import Redis - -from gnosis.eth import EthereumClient, get_auto_ethereum_client +from safe_eth.eth import EthereumClient, get_auto_ethereum_client from safe_transaction_service.tokens.models import Token from safe_transaction_service.utils.redis import get_redis diff --git a/safe_transaction_service/history/tests/factories.py b/safe_transaction_service/history/tests/factories.py index e0dc16d77..e62ea20b0 100644 --- a/safe_transaction_service/history/tests/factories.py +++ b/safe_transaction_service/history/tests/factories.py @@ -7,10 +7,9 @@ from factory.django import DjangoModelFactory from factory.fuzzy import FuzzyInteger from hexbytes import HexBytes - -from gnosis.eth.constants import NULL_ADDRESS -from gnosis.eth.utils import fast_keccak_text -from gnosis.safe.safe_signature import SafeSignatureType +from safe_eth.eth.constants import NULL_ADDRESS +from safe_eth.eth.utils import fast_keccak_text +from safe_eth.safe.safe_signature import SafeSignatureType from ..models import ( ERC20Transfer, diff --git a/safe_transaction_service/history/tests/mocks/deployments_mock.py b/safe_transaction_service/history/tests/mocks/deployments_mock.py index 1a9c1130a..02bec6ad7 100644 --- a/safe_transaction_service/history/tests/mocks/deployments_mock.py +++ b/safe_transaction_service/history/tests/mocks/deployments_mock.py @@ -51,38 +51,74 @@ "contractName": "CompatibilityFallbackHandler", "address": "0xf48f2B2d2a534e402487b3ee7C18c33Aec0Fe5e4", }, + { + "contractName": "CompatibilityFallbackHandler", + "address": "0x017062a1dE2FE6b99BE3d9d37841FeD19F573804", + }, { "contractName": "CreateCall", "address": "0x7cbB62EaA69F79e6873cD1ecB2392971036cFAa4", }, + { + "contractName": "CreateCall", + "address": "0xB19D6FFc2182150F8Eb585b79D4ABcd7C5640A9d", + }, { "contractName": "GnosisSafe", "address": "0xd9Db270c1B5E3Bd161E8c8503c55cEABeE709552", }, + { + "contractName": "GnosisSafe", + "address": "0x69f4D1788e39c87893C980c06EdF4b7f686e2938", + }, { "contractName": "GnosisSafeL2", "address": "0x3E5c63644E683549055b9Be8653de26E0B4CD36E", }, + { + "contractName": "GnosisSafeL2", + "address": "0xfb1bffC9d739B8D520DaF37dF666da4C687191EA", + }, { "contractName": "MultiSend", "address": "0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761", }, + { + "contractName": "MultiSend", + "address": "0x998739BFdAAdde7C933B942a68053933098f9EDa", + }, { "contractName": "MultiSendCallOnly", "address": "0x40A2aCCbd92BCA938b02010E17A5b8929b49130D", }, + { + "contractName": "MultiSendCallOnly", + "address": "0xA1dabEF33b3B82c7814B6D82A79e50F4AC44102B", + }, { "contractName": "GnosisSafeProxyFactory", "address": "0xa6B71E26C5e0845f74c812102Ca7114b6a896AB2", }, + { + "contractName": "GnosisSafeProxyFactory", + "address": "0xC22834581EbC8527d974F8a1c97E1bEA4EF910BC", + }, { "contractName": "SignMessageLib", "address": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2", }, + { + "contractName": "SignMessageLib", + "address": "0x98FFBBF51bb33A056B08ddf711f289936AafF717", + }, { "contractName": "SimulateTxAccessor", "address": "0x59AD6735bCd8152B84860Cb256dD9e96b85F69Da", }, + { + "contractName": "SimulateTxAccessor", + "address": "0x727a77a074D1E6c4530e814F89E618a3298FC044", + }, ], } diff --git a/safe_transaction_service/history/tests/mocks/traces.py b/safe_transaction_service/history/tests/mocks/traces.py index 28e0db840..f97b03a9a 100644 --- a/safe_transaction_service/history/tests/mocks/traces.py +++ b/safe_transaction_service/history/tests/mocks/traces.py @@ -1,6 +1,5 @@ from hexbytes import HexBytes - -from gnosis.eth.tests.mocks.mock_internal_txs import creation_internal_txs # noqa +from safe_eth.eth.tests.mocks.mock_internal_txs import creation_internal_txs # noqa create_trace = { "action": { diff --git a/safe_transaction_service/history/tests/test_balance_service.py b/safe_transaction_service/history/tests/test_balance_service.py index 1c9922e2c..3a6cfa55b 100644 --- a/safe_transaction_service/history/tests/test_balance_service.py +++ b/safe_transaction_service/history/tests/test_balance_service.py @@ -1,8 +1,7 @@ from django.test import TestCase from eth_account import Account - -from gnosis.eth.tests.ethereum_test_case import EthereumTestCaseMixin +from safe_eth.eth.tests.ethereum_test_case import EthereumTestCaseMixin from safe_transaction_service.tokens.models import Token from safe_transaction_service.tokens.tests.factories import TokenFactory diff --git a/safe_transaction_service/history/tests/test_collectibles_service.py b/safe_transaction_service/history/tests/test_collectibles_service.py index 9f5d160da..d4ccfe17e 100644 --- a/safe_transaction_service/history/tests/test_collectibles_service.py +++ b/safe_transaction_service/history/tests/test_collectibles_service.py @@ -6,15 +6,14 @@ from django.test import TestCase from eth_account import Account - -from gnosis.eth import EthereumNetwork -from gnosis.eth.ethereum_client import ( +from safe_eth.eth import EthereumNetwork +from safe_eth.eth.ethereum_client import ( Erc721Info, Erc721Manager, InvalidERC721Info, get_auto_ethereum_client, ) -from gnosis.eth.tests.ethereum_test_case import EthereumTestCaseMixin +from safe_eth.eth.tests.ethereum_test_case import EthereumTestCaseMixin from safe_transaction_service.tokens.constants import ENS_CONTRACTS_WITH_TLD from safe_transaction_service.tokens.models import Token diff --git a/safe_transaction_service/history/tests/test_commands.py b/safe_transaction_service/history/tests/test_commands.py index 1cc137dbf..20b06a76b 100644 --- a/safe_transaction_service/history/tests/test_commands.py +++ b/safe_transaction_service/history/tests/test_commands.py @@ -9,10 +9,9 @@ from django_celery_beat.models import PeriodicTask from eth_account import Account - -from gnosis.eth.account_abstraction import BundlerClient -from gnosis.eth.ethereum_client import EthereumClient, EthereumNetwork -from gnosis.safe.tests.safe_test_case import SafeTestCaseMixin +from safe_eth.eth.account_abstraction import BundlerClient +from safe_eth.eth.ethereum_client import EthereumClient, EthereumNetwork +from safe_eth.safe.tests.safe_test_case import SafeTestCaseMixin from ..indexers import Erc20EventsIndexer, InternalTxIndexer, SafeEventsIndexer from ..models import ( diff --git a/safe_transaction_service/history/tests/test_erc20_events_indexer.py b/safe_transaction_service/history/tests/test_erc20_events_indexer.py index 915149174..bf5b06d57 100644 --- a/safe_transaction_service/history/tests/test_erc20_events_indexer.py +++ b/safe_transaction_service/history/tests/test_erc20_events_indexer.py @@ -1,6 +1,6 @@ from django.test import TestCase -from gnosis.eth.tests.ethereum_test_case import EthereumTestCaseMixin +from safe_eth.eth.tests.ethereum_test_case import EthereumTestCaseMixin from ..indexers import Erc20EventsIndexerProvider from ..models import ERC20Transfer, EthereumTx, IndexingStatus, SafeRelevantTransaction diff --git a/safe_transaction_service/history/tests/test_helpers.py b/safe_transaction_service/history/tests/test_helpers.py index 6e74fe53b..2f6917250 100644 --- a/safe_transaction_service/history/tests/test_helpers.py +++ b/safe_transaction_service/history/tests/test_helpers.py @@ -3,8 +3,7 @@ from django.test import TestCase from hexbytes import HexBytes - -from gnosis.safe.tests.safe_test_case import SafeTestCaseMixin +from safe_eth.safe.tests.safe_test_case import SafeTestCaseMixin from safe_transaction_service.history.helpers import DelegateSignatureHelperV2 diff --git a/safe_transaction_service/history/tests/test_index_service.py b/safe_transaction_service/history/tests/test_index_service.py index 467bee386..c2061503c 100644 --- a/safe_transaction_service/history/tests/test_index_service.py +++ b/safe_transaction_service/history/tests/test_index_service.py @@ -5,10 +5,9 @@ from eth_account import Account from requests.exceptions import ConnectionError as RequestsConnectionError - -from gnosis.eth import EthereumClient -from gnosis.eth.tests.ethereum_test_case import EthereumTestCaseMixin -from gnosis.eth.utils import fast_keccak_text +from safe_eth.eth import EthereumClient +from safe_eth.eth.tests.ethereum_test_case import EthereumTestCaseMixin +from safe_eth.eth.utils import fast_keccak_text from ..models import ( EthereumTx, diff --git a/safe_transaction_service/history/tests/test_internal_tx_indexer.py b/safe_transaction_service/history/tests/test_internal_tx_indexer.py index 7ca37ee03..d4c6175a6 100644 --- a/safe_transaction_service/history/tests/test_internal_tx_indexer.py +++ b/safe_transaction_service/history/tests/test_internal_tx_indexer.py @@ -6,9 +6,8 @@ from django.test import TestCase from eth_typing import HexStr - -from gnosis.eth import EthereumClient -from gnosis.eth.ethereum_client import TracingManager +from safe_eth.eth import EthereumClient +from safe_eth.eth.ethereum_client import TracingManager from ..indexers import InternalTxIndexer, InternalTxIndexerProvider from ..indexers.internal_tx_indexer import InternalTxIndexerWithTraceBlock diff --git a/safe_transaction_service/history/tests/test_migrations.py b/safe_transaction_service/history/tests/test_migrations.py index 4df96928f..894d5a7e6 100644 --- a/safe_transaction_service/history/tests/test_migrations.py +++ b/safe_transaction_service/history/tests/test_migrations.py @@ -5,8 +5,7 @@ from django_test_migrations.migrator import Migrator from eth_account import Account - -from gnosis.eth.utils import fast_keccak, fast_keccak_text +from safe_eth.eth.utils import fast_keccak, fast_keccak_text class TestMigrations(TestCase): diff --git a/safe_transaction_service/history/tests/test_models.py b/safe_transaction_service/history/tests/test_models.py index c1c98e6ec..f36727705 100644 --- a/safe_transaction_service/history/tests/test_models.py +++ b/safe_transaction_service/history/tests/test_models.py @@ -9,9 +9,8 @@ from django.utils import timezone from eth_account import Account - -from gnosis.eth.utils import fast_keccak_text -from gnosis.safe.safe_signature import SafeSignatureType +from safe_eth.eth.utils import fast_keccak_text +from safe_eth.safe.safe_signature import SafeSignatureType from safe_transaction_service.account_abstraction.tests.mocks import aa_tx_receipt_mock from safe_transaction_service.contracts.models import ContractQuerySet diff --git a/safe_transaction_service/history/tests/test_proxy_factory_indexer.py b/safe_transaction_service/history/tests/test_proxy_factory_indexer.py index 07b97ab30..d94774336 100644 --- a/safe_transaction_service/history/tests/test_proxy_factory_indexer.py +++ b/safe_transaction_service/history/tests/test_proxy_factory_indexer.py @@ -1,7 +1,7 @@ from django.conf import settings from django.test import TestCase -from gnosis.safe.tests.safe_test_case import SafeTestCaseMixin +from safe_eth.safe.tests.safe_test_case import SafeTestCaseMixin from ..indexers import ProxyFactoryIndexerProvider from ..models import SafeContract diff --git a/safe_transaction_service/history/tests/test_reorg_service.py b/safe_transaction_service/history/tests/test_reorg_service.py index c8e90a47b..b6957e76e 100644 --- a/safe_transaction_service/history/tests/test_reorg_service.py +++ b/safe_transaction_service/history/tests/test_reorg_service.py @@ -3,7 +3,7 @@ from django.test import TestCase -from gnosis.eth import EthereumClient +from safe_eth.eth import EthereumClient from ..models import ( EthereumBlock, diff --git a/safe_transaction_service/history/tests/test_safe_events_indexer.py b/safe_transaction_service/history/tests/test_safe_events_indexer.py index 8ab6f3db8..27266d452 100644 --- a/safe_transaction_service/history/tests/test_safe_events_indexer.py +++ b/safe_transaction_service/history/tests/test_safe_events_indexer.py @@ -3,15 +3,14 @@ from eth_account import Account from eth_typing import ChecksumAddress from hexbytes import HexBytes +from safe_eth.eth.constants import NULL_ADDRESS, SENTINEL_ADDRESS +from safe_eth.eth.contracts import get_safe_V1_3_0_contract, get_safe_V1_4_1_contract +from safe_eth.safe import Safe +from safe_eth.safe.tests.safe_test_case import SafeTestCaseMixin from web3 import Web3 from web3.datastructures import AttributeDict from web3.types import LogReceipt -from gnosis.eth.constants import NULL_ADDRESS, SENTINEL_ADDRESS -from gnosis.eth.contracts import get_safe_V1_3_0_contract, get_safe_V1_4_1_contract -from gnosis.safe import Safe -from gnosis.safe.tests.safe_test_case import SafeTestCaseMixin - from ..indexers import SafeEventsIndexer, SafeEventsIndexerProvider from ..indexers.tx_processor import SafeTxProcessor from ..models import ( diff --git a/safe_transaction_service/history/tests/test_safe_service.py b/safe_transaction_service/history/tests/test_safe_service.py index d3bcb5216..61779667f 100644 --- a/safe_transaction_service/history/tests/test_safe_service.py +++ b/safe_transaction_service/history/tests/test_safe_service.py @@ -4,10 +4,9 @@ from django.test import TestCase from eth_account import Account - -from gnosis.eth.constants import NULL_ADDRESS -from gnosis.eth.ethereum_client import TracingManager -from gnosis.safe.tests.safe_test_case import SafeTestCaseMixin +from safe_eth.eth.constants import NULL_ADDRESS +from safe_eth.eth.ethereum_client import TracingManager +from safe_eth.safe.tests.safe_test_case import SafeTestCaseMixin from ..models import SafeMasterCopy from ..services.safe_service import ( diff --git a/safe_transaction_service/history/tests/test_signals.py b/safe_transaction_service/history/tests/test_signals.py index b371b106a..4de40a259 100644 --- a/safe_transaction_service/history/tests/test_signals.py +++ b/safe_transaction_service/history/tests/test_signals.py @@ -6,9 +6,8 @@ from django.test import TestCase import factory - -from gnosis.eth import EthereumNetwork -from gnosis.safe.tests.safe_test_case import SafeTestCaseMixin +from safe_eth.eth import EthereumNetwork +from safe_eth.safe.tests.safe_test_case import SafeTestCaseMixin from ...events.services.queue_service import QueueService from ...safe_messages.models import SafeMessage, SafeMessageConfirmation diff --git a/safe_transaction_service/history/tests/test_tx_processor.py b/safe_transaction_service/history/tests/test_tx_processor.py index 75b3f24ec..7255de065 100644 --- a/safe_transaction_service/history/tests/test_tx_processor.py +++ b/safe_transaction_service/history/tests/test_tx_processor.py @@ -5,11 +5,10 @@ from eth_account import Account from eth_utils import keccak - -from gnosis.eth.ethereum_client import TracingManager -from gnosis.eth.utils import fast_keccak_text -from gnosis.safe.safe_signature import SafeSignatureType -from gnosis.safe.tests.safe_test_case import SafeTestCaseMixin +from safe_eth.eth.ethereum_client import TracingManager +from safe_eth.eth.utils import fast_keccak_text +from safe_eth.safe.safe_signature import SafeSignatureType +from safe_eth.safe.tests.safe_test_case import SafeTestCaseMixin from safe_transaction_service.safe_messages.models import SafeMessageConfirmation from safe_transaction_service.safe_messages.tests.factories import ( diff --git a/safe_transaction_service/history/tests/test_views.py b/safe_transaction_service/history/tests/test_views.py index dab857c6e..789ecd3c2 100644 --- a/safe_transaction_service/history/tests/test_views.py +++ b/safe_transaction_service/history/tests/test_views.py @@ -15,14 +15,13 @@ from rest_framework import status from rest_framework.exceptions import ErrorDetail from rest_framework.test import APIRequestFactory, APITestCase, force_authenticate - -from gnosis.eth.constants import NULL_ADDRESS -from gnosis.eth.ethereum_client import EthereumClient, TracingManager -from gnosis.eth.utils import fast_is_checksum_address, fast_keccak_text -from gnosis.safe import CannotEstimateGas, Safe, SafeOperationEnum -from gnosis.safe.safe_signature import SafeSignature, SafeSignatureType -from gnosis.safe.signatures import signature_to_bytes -from gnosis.safe.tests.safe_test_case import SafeTestCaseMixin +from safe_eth.eth.constants import NULL_ADDRESS +from safe_eth.eth.ethereum_client import EthereumClient, TracingManager +from safe_eth.eth.utils import fast_is_checksum_address, fast_keccak_text +from safe_eth.safe import CannotEstimateGas, Safe, SafeOperationEnum +from safe_eth.safe.safe_signature import SafeSignature, SafeSignatureType +from safe_eth.safe.signatures import signature_to_bytes +from safe_eth.safe.tests.safe_test_case import SafeTestCaseMixin from safe_transaction_service.account_abstraction.tests import factories as aa_factories from safe_transaction_service.contracts.models import ContractQuerySet @@ -210,6 +209,7 @@ def test_indexing_view(self, current_block_number_mock: PropertyMock): def test_safe_deployments_view(self, get_chain_id_mock): url = reverse("v1:history:deployments") response = self.client.get(url, format="json") + self.maxDiff = None self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response.json(), mainnet_deployments) diff --git a/safe_transaction_service/history/tests/test_views_v2.py b/safe_transaction_service/history/tests/test_views_v2.py index dce19f26a..9a0b3e981 100644 --- a/safe_transaction_service/history/tests/test_views_v2.py +++ b/safe_transaction_service/history/tests/test_views_v2.py @@ -6,10 +6,9 @@ from hexbytes import HexBytes from rest_framework import status from rest_framework.test import APITestCase - -from gnosis.eth.constants import NULL_ADDRESS -from gnosis.safe.signatures import signature_to_bytes -from gnosis.safe.tests.safe_test_case import SafeTestCaseMixin +from safe_eth.eth.constants import NULL_ADDRESS +from safe_eth.safe.signatures import signature_to_bytes +from safe_eth.safe.tests.safe_test_case import SafeTestCaseMixin from ...tokens.models import Token from ..helpers import DelegateSignatureHelperV2 @@ -504,7 +503,7 @@ def test_delegate_delete(self): # Try an invalid signature with mock.patch( - "gnosis.safe.safe_signature.SafeSignature.parse_signature", + "safe_eth.safe.safe_signature.SafeSignature.parse_signature", return_value=[], ) as parse_signature_mock: # No signatures diff --git a/safe_transaction_service/history/views.py b/safe_transaction_service/history/views.py index 4431b39b1..3c29c1566 100644 --- a/safe_transaction_service/history/views.py +++ b/safe_transaction_service/history/views.py @@ -23,12 +23,11 @@ from rest_framework.renderers import JSONRenderer from rest_framework.response import Response from rest_framework.views import APIView - -from gnosis.eth import EthereumClient, EthereumNetwork, get_auto_ethereum_client -from gnosis.eth.constants import NULL_ADDRESS -from gnosis.eth.utils import fast_is_checksum_address -from gnosis.safe import CannotEstimateGas -from gnosis.safe.safe_deployments import safe_deployments +from safe_eth.eth import EthereumClient, EthereumNetwork, get_auto_ethereum_client +from safe_eth.eth.constants import NULL_ADDRESS +from safe_eth.eth.utils import fast_is_checksum_address +from safe_eth.safe import CannotEstimateGas +from safe_eth.safe.safe_deployments import safe_deployments from safe_transaction_service import __version__ from safe_transaction_service.utils.ethereum import get_chain_id @@ -224,20 +223,22 @@ def get(self, request): if filter_contract: # Filter by contract name if addresses := safe_deployments[version].get(filter_contract): - contracts.append( - { - "contract_name": filter_contract, - "address": addresses.get(str(chain_id)), - } - ) + for address in addresses.get(str(chain_id)): + contracts.append( + { + "contract_name": filter_contract, + "address": address, + } + ) else: for contract_name, addresses in safe_deployments[version].items(): - contracts.append( - { - "contract_name": contract_name, - "address": addresses.get(chain_id), - } - ) + for address in addresses.get(chain_id): + contracts.append( + { + "contract_name": contract_name, + "address": address, + } + ) data_response.append({"version": version, "contracts": contracts}) diff --git a/safe_transaction_service/history/views_v2.py b/safe_transaction_service/history/views_v2.py index 60938ad1a..a7c74c1a9 100644 --- a/safe_transaction_service/history/views_v2.py +++ b/safe_transaction_service/history/views_v2.py @@ -8,8 +8,7 @@ from rest_framework import status from rest_framework.generics import GenericAPIView, ListCreateAPIView from rest_framework.response import Response - -from gnosis.eth.utils import fast_is_checksum_address +from safe_eth.eth.utils import fast_is_checksum_address from safe_transaction_service.utils.utils import parse_boolean_query_param diff --git a/safe_transaction_service/notifications/migrations/0003_firebasedeviceowner.py b/safe_transaction_service/notifications/migrations/0003_firebasedeviceowner.py index b22deaeab..a6e7c13a1 100644 --- a/safe_transaction_service/notifications/migrations/0003_firebasedeviceowner.py +++ b/safe_transaction_service/notifications/migrations/0003_firebasedeviceowner.py @@ -3,7 +3,7 @@ import django.db.models.deletion from django.db import migrations, models -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -24,7 +24,10 @@ class Migration(migrations.Migration): verbose_name="ID", ), ), - ("owner", gnosis.eth.django.models.EthereumAddressField(db_index=True)), + ( + "owner", + safe_eth.eth.django.models.EthereumAddressField(db_index=True), + ), ( "firebase_device", models.ForeignKey( diff --git a/safe_transaction_service/notifications/migrations/0005_ethereum_address_field_v2.py b/safe_transaction_service/notifications/migrations/0005_ethereum_address_field_v2.py index a291bbb9f..c67b986cb 100644 --- a/safe_transaction_service/notifications/migrations/0005_ethereum_address_field_v2.py +++ b/safe_transaction_service/notifications/migrations/0005_ethereum_address_field_v2.py @@ -2,7 +2,7 @@ from django.db import migrations -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -24,6 +24,6 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="firebasedeviceowner", name="owner", - field=gnosis.eth.django.models.EthereumAddressV2Field(db_index=True), + field=safe_eth.eth.django.models.EthereumAddressV2Field(db_index=True), ), ] diff --git a/safe_transaction_service/notifications/migrations/0007_alter_firebasedeviceowner_owner.py b/safe_transaction_service/notifications/migrations/0007_alter_firebasedeviceowner_owner.py index d96e35586..33c105274 100644 --- a/safe_transaction_service/notifications/migrations/0007_alter_firebasedeviceowner_owner.py +++ b/safe_transaction_service/notifications/migrations/0007_alter_firebasedeviceowner_owner.py @@ -2,7 +2,7 @@ from django.db import migrations -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -15,6 +15,6 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="firebasedeviceowner", name="owner", - field=gnosis.eth.django.models.EthereumAddressBinaryField(db_index=True), + field=safe_eth.eth.django.models.EthereumAddressBinaryField(db_index=True), ), ] diff --git a/safe_transaction_service/notifications/models.py b/safe_transaction_service/notifications/models.py index 1d38d9ce1..01a06468a 100644 --- a/safe_transaction_service/notifications/models.py +++ b/safe_transaction_service/notifications/models.py @@ -4,7 +4,7 @@ from django.db import models -from gnosis.eth.django.models import EthereumAddressBinaryField +from safe_eth.eth.django.models import EthereumAddressBinaryField from safe_transaction_service.history.models import SafeContract diff --git a/safe_transaction_service/notifications/serializers.py b/safe_transaction_service/notifications/serializers.py index 23c0adcad..545d845f5 100644 --- a/safe_transaction_service/notifications/serializers.py +++ b/safe_transaction_service/notifications/serializers.py @@ -8,9 +8,8 @@ from packaging import version as semantic_version from rest_framework import serializers from rest_framework.exceptions import ValidationError - -from gnosis.eth.django.serializers import EthereumAddressField, HexadecimalField -from gnosis.safe.safe_signature import SafeSignature, SafeSignatureType +from safe_eth.eth.django.serializers import EthereumAddressField, HexadecimalField +from safe_eth.safe.safe_signature import SafeSignature, SafeSignatureType from safe_transaction_service.history.models import SafeContract, SafeContractDelegate from safe_transaction_service.utils.serializers import get_safe_owners diff --git a/safe_transaction_service/notifications/tests/test_tasks.py b/safe_transaction_service/notifications/tests/test_tasks.py index 396f24930..8226ef82a 100644 --- a/safe_transaction_service/notifications/tests/test_tasks.py +++ b/safe_transaction_service/notifications/tests/test_tasks.py @@ -3,8 +3,7 @@ from django.test import TestCase from eth_account import Account - -from gnosis.eth.utils import fast_keccak_text +from safe_eth.eth.utils import fast_keccak_text from safe_transaction_service.history.models import ( EthereumTxCallType, diff --git a/safe_transaction_service/notifications/tests/test_views.py b/safe_transaction_service/notifications/tests/test_views.py index 4d055186c..c5bc8c4db 100644 --- a/safe_transaction_service/notifications/tests/test_views.py +++ b/safe_transaction_service/notifications/tests/test_views.py @@ -8,8 +8,7 @@ from eth_account.messages import encode_defunct from rest_framework import status from rest_framework.test import APITestCase - -from gnosis.safe.tests.safe_test_case import SafeTestCaseMixin +from safe_eth.safe.tests.safe_test_case import SafeTestCaseMixin from safe_transaction_service.history.tests.factories import ( SafeContractDelegateFactory, diff --git a/safe_transaction_service/notifications/utils.py b/safe_transaction_service/notifications/utils.py index c64b43d22..75f8d0269 100644 --- a/safe_transaction_service/notifications/utils.py +++ b/safe_transaction_service/notifications/utils.py @@ -7,8 +7,7 @@ from eth_account.messages import defunct_hash_message from hexbytes import HexBytes - -from gnosis.eth.utils import fast_keccak +from safe_eth.eth.utils import fast_keccak from safe_transaction_service.utils.redis import get_redis diff --git a/safe_transaction_service/safe_messages/migrations/0001_initial.py b/safe_transaction_service/safe_messages/migrations/0001_initial.py index 01c68ac81..97b098063 100644 --- a/safe_transaction_service/safe_messages/migrations/0001_initial.py +++ b/safe_transaction_service/safe_messages/migrations/0001_initial.py @@ -5,8 +5,7 @@ from django.db import migrations, models import model_utils.fields - -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -36,16 +35,16 @@ class Migration(migrations.Migration): ), ( "message_hash", - gnosis.eth.django.models.Keccak256Field( + safe_eth.eth.django.models.Keccak256Field( primary_key=True, serialize=False ), ), ( "safe", - gnosis.eth.django.models.EthereumAddressV2Field(db_index=True), + safe_eth.eth.django.models.EthereumAddressV2Field(db_index=True), ), ("message", models.JSONField()), - ("proposed_by", gnosis.eth.django.models.EthereumAddressV2Field()), + ("proposed_by", safe_eth.eth.django.models.EthereumAddressV2Field()), ("safe_app_id", models.PositiveIntegerField(blank=True, null=True)), ], options={ @@ -82,9 +81,9 @@ class Migration(migrations.Migration): ), ( "owner", - gnosis.eth.django.models.EthereumAddressV2Field(db_index=True), + safe_eth.eth.django.models.EthereumAddressV2Field(db_index=True), ), - ("signature", gnosis.eth.django.models.HexField(max_length=5000)), + ("signature", safe_eth.eth.django.models.HexField(max_length=5000)), ( "signature_type", models.PositiveSmallIntegerField( diff --git a/safe_transaction_service/safe_messages/migrations/0003_alter_safemessageconfirmation_signature.py b/safe_transaction_service/safe_messages/migrations/0003_alter_safemessageconfirmation_signature.py index be8c1476c..1ba913997 100644 --- a/safe_transaction_service/safe_messages/migrations/0003_alter_safemessageconfirmation_signature.py +++ b/safe_transaction_service/safe_messages/migrations/0003_alter_safemessageconfirmation_signature.py @@ -2,7 +2,7 @@ from django.db import migrations -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -26,6 +26,6 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="safemessageconfirmation", name="signature", - field=gnosis.eth.django.models.HexV2Field(max_length=5000), + field=safe_eth.eth.django.models.HexV2Field(max_length=5000), ), ] diff --git a/safe_transaction_service/safe_messages/migrations/0004_alter_safemessage_proposed_by_alter_safemessage_safe_and_more.py b/safe_transaction_service/safe_messages/migrations/0004_alter_safemessage_proposed_by_alter_safemessage_safe_and_more.py index 367460a72..51311a636 100644 --- a/safe_transaction_service/safe_messages/migrations/0004_alter_safemessage_proposed_by_alter_safemessage_safe_and_more.py +++ b/safe_transaction_service/safe_messages/migrations/0004_alter_safemessage_proposed_by_alter_safemessage_safe_and_more.py @@ -2,7 +2,7 @@ from django.db import migrations -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -15,16 +15,16 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="safemessage", name="proposed_by", - field=gnosis.eth.django.models.EthereumAddressBinaryField(), + field=safe_eth.eth.django.models.EthereumAddressBinaryField(), ), migrations.AlterField( model_name="safemessage", name="safe", - field=gnosis.eth.django.models.EthereumAddressBinaryField(db_index=True), + field=safe_eth.eth.django.models.EthereumAddressBinaryField(db_index=True), ), migrations.AlterField( model_name="safemessageconfirmation", name="owner", - field=gnosis.eth.django.models.EthereumAddressBinaryField(db_index=True), + field=safe_eth.eth.django.models.EthereumAddressBinaryField(db_index=True), ), ] diff --git a/safe_transaction_service/safe_messages/models.py b/safe_transaction_service/safe_messages/models.py index 10d01a6c1..9da99bb59 100644 --- a/safe_transaction_service/safe_messages/models.py +++ b/safe_transaction_service/safe_messages/models.py @@ -5,13 +5,12 @@ from hexbytes import HexBytes from model_utils.models import TimeStampedModel - -from gnosis.eth.django.models import ( +from safe_eth.eth.django.models import ( EthereumAddressBinaryField, HexV2Field, Keccak256Field, ) -from gnosis.safe.safe_signature import SafeSignatureType +from safe_eth.safe.safe_signature import SafeSignatureType from safe_transaction_service.utils.constants import SIGNATURE_LENGTH diff --git a/safe_transaction_service/safe_messages/serializers.py b/safe_transaction_service/safe_messages/serializers.py index cefcc938f..8a91fb680 100644 --- a/safe_transaction_service/safe_messages/serializers.py +++ b/safe_transaction_service/safe_messages/serializers.py @@ -1,14 +1,13 @@ from typing import Any, Dict, Optional, Sequence, Tuple, Union +import safe_eth.eth.django.serializers as eth_serializers from eth_typing import ChecksumAddress, HexStr from hexbytes import HexBytes from rest_framework import serializers from rest_framework.exceptions import ValidationError - -import gnosis.eth.django.serializers as eth_serializers -from gnosis.eth import get_auto_ethereum_client -from gnosis.eth.eip712 import eip712_encode_hash -from gnosis.safe.safe_signature import SafeSignature, SafeSignatureType +from safe_eth.eth import get_auto_ethereum_client +from safe_eth.eth.eip712 import eip712_encode_hash +from safe_eth.safe.safe_signature import SafeSignature, SafeSignatureType from safe_transaction_service.utils.serializers import get_safe_owners diff --git a/safe_transaction_service/safe_messages/tests/factories.py b/safe_transaction_service/safe_messages/tests/factories.py index 08921b1ac..ae41270d9 100644 --- a/safe_transaction_service/safe_messages/tests/factories.py +++ b/safe_transaction_service/safe_messages/tests/factories.py @@ -1,8 +1,7 @@ import factory from eth_account import Account from factory.django import DjangoModelFactory - -from gnosis.safe.safe_signature import SafeSignatureType +from safe_eth.safe.safe_signature import SafeSignatureType from ..models import SafeMessage, SafeMessageConfirmation from ..utils import get_hash_for_message, get_safe_message_hash_for_message diff --git a/safe_transaction_service/safe_messages/tests/test_models.py b/safe_transaction_service/safe_messages/tests/test_models.py index b3b4335bc..17b7c7134 100644 --- a/safe_transaction_service/safe_messages/tests/test_models.py +++ b/safe_transaction_service/safe_messages/tests/test_models.py @@ -5,8 +5,7 @@ from eth_account import Account from hexbytes import HexBytes - -from gnosis.safe.tests.safe_test_case import SafeTestCaseMixin +from safe_eth.safe.tests.safe_test_case import SafeTestCaseMixin from ..utils import get_hash_for_message, get_safe_message_hash_for_message from .factories import SafeMessageConfirmationFactory, SafeMessageFactory @@ -35,7 +34,7 @@ def test_str(self): ]: with self.subTest(input=input): with mock.patch( - "gnosis.safe.safe.Safe.domain_separator", + "safe_eth.safe.safe.Safe.domain_separator", return_value=mock_domain_separator, new_callable=PropertyMock, ): diff --git a/safe_transaction_service/safe_messages/tests/test_signals.py b/safe_transaction_service/safe_messages/tests/test_signals.py index 74e31ada7..221a6bab2 100644 --- a/safe_transaction_service/safe_messages/tests/test_signals.py +++ b/safe_transaction_service/safe_messages/tests/test_signals.py @@ -5,9 +5,8 @@ from django.test import TestCase import factory - -from gnosis.eth import EthereumNetwork -from gnosis.safe.tests.safe_test_case import SafeTestCaseMixin +from safe_eth.eth import EthereumNetwork +from safe_eth.safe.tests.safe_test_case import SafeTestCaseMixin from safe_transaction_service.events.services.queue_service import QueueService from safe_transaction_service.history.models import TransactionServiceEventType diff --git a/safe_transaction_service/safe_messages/tests/test_views.py b/safe_transaction_service/safe_messages/tests/test_views.py index 466b2eb5c..ede9b51fb 100644 --- a/safe_transaction_service/safe_messages/tests/test_views.py +++ b/safe_transaction_service/safe_messages/tests/test_views.py @@ -11,11 +11,10 @@ from rest_framework import status from rest_framework.exceptions import ErrorDetail from rest_framework.test import APITestCase - -from gnosis.eth.eip712 import eip712_encode_hash -from gnosis.safe.safe_signature import SafeSignatureEOA -from gnosis.safe.signatures import signature_to_bytes -from gnosis.safe.tests.safe_test_case import SafeTestCaseMixin +from safe_eth.eth.eip712 import eip712_encode_hash +from safe_eth.safe.safe_signature import SafeSignatureEOA +from safe_eth.safe.signatures import signature_to_bytes +from safe_eth.safe.tests.safe_test_case import SafeTestCaseMixin from safe_transaction_service.safe_messages.models import ( SafeMessage, diff --git a/safe_transaction_service/safe_messages/utils.py b/safe_transaction_service/safe_messages/utils.py index 0d6481b94..480c182c0 100644 --- a/safe_transaction_service/safe_messages/utils.py +++ b/safe_transaction_service/safe_messages/utils.py @@ -2,10 +2,9 @@ from eth_account.messages import defunct_hash_message from eth_typing import ChecksumAddress, Hash32 - -from gnosis.eth import get_auto_ethereum_client -from gnosis.eth.eip712 import eip712_encode_hash -from gnosis.safe import Safe +from safe_eth.eth import get_auto_ethereum_client +from safe_eth.eth.eip712 import eip712_encode_hash +from safe_eth.safe import Safe def get_hash_for_message(message: str | Dict[str, Any]) -> Hash32: diff --git a/safe_transaction_service/safe_messages/views.py b/safe_transaction_service/safe_messages/views.py index 5b256ee7e..adafeb370 100644 --- a/safe_transaction_service/safe_messages/views.py +++ b/safe_transaction_service/safe_messages/views.py @@ -8,8 +8,7 @@ from rest_framework.filters import OrderingFilter from rest_framework.generics import CreateAPIView, ListCreateAPIView, RetrieveAPIView from rest_framework.response import Response - -from gnosis.eth.utils import fast_is_checksum_address +from safe_eth.eth.utils import fast_is_checksum_address from . import pagination, serializers from .models import SafeMessage diff --git a/safe_transaction_service/tokens/clients/coingecko_client.py b/safe_transaction_service/tokens/clients/coingecko_client.py index 09d72f782..a572eb056 100644 --- a/safe_transaction_service/tokens/clients/coingecko_client.py +++ b/safe_transaction_service/tokens/clients/coingecko_client.py @@ -4,8 +4,7 @@ from urllib.parse import urljoin from eth_typing import ChecksumAddress - -from gnosis.eth import EthereumNetwork +from safe_eth.eth import EthereumNetwork from safe_transaction_service.tokens.clients.base_client import BaseHTTPClient from safe_transaction_service.tokens.clients.exceptions import ( diff --git a/safe_transaction_service/tokens/clients/coinmarketcap_client.py b/safe_transaction_service/tokens/clients/coinmarketcap_client.py index da322ce8a..40be7542c 100644 --- a/safe_transaction_service/tokens/clients/coinmarketcap_client.py +++ b/safe_transaction_service/tokens/clients/coinmarketcap_client.py @@ -4,7 +4,7 @@ from typing import Any, Dict, List from urllib.parse import urljoin -from gnosis.eth.utils import fast_to_checksum_address +from safe_eth.eth.utils import fast_to_checksum_address from .base_client import BaseHTTPClient diff --git a/safe_transaction_service/tokens/clients/kleros_client.py b/safe_transaction_service/tokens/clients/kleros_client.py index b1be366ea..401253158 100644 --- a/safe_transaction_service/tokens/clients/kleros_client.py +++ b/safe_transaction_service/tokens/clients/kleros_client.py @@ -2,9 +2,8 @@ from typing import List, Sequence from hexbytes import HexBytes - -from gnosis.eth import EthereumClient -from gnosis.eth.constants import NULL_ADDRESS +from safe_eth.eth import EthereumClient +from safe_eth.eth.constants import NULL_ADDRESS from .kleros_abi import kleros_abi diff --git a/safe_transaction_service/tokens/clients/zerion_client.py b/safe_transaction_service/tokens/clients/zerion_client.py index 32c6c19c5..4394387d8 100644 --- a/safe_transaction_service/tokens/clients/zerion_client.py +++ b/safe_transaction_service/tokens/clients/zerion_client.py @@ -2,11 +2,10 @@ from typing import List, Optional from eth_typing import ChecksumAddress +from safe_eth.eth import EthereumClient +from safe_eth.eth.constants import NULL_ADDRESS from web3.exceptions import ContractLogicError -from gnosis.eth import EthereumClient -from gnosis.eth.constants import NULL_ADDRESS - @dataclass class UniswapComponent: diff --git a/safe_transaction_service/tokens/filters.py b/safe_transaction_service/tokens/filters.py index 68210dc92..9c70cfb0d 100644 --- a/safe_transaction_service/tokens/filters.py +++ b/safe_transaction_service/tokens/filters.py @@ -1,7 +1,6 @@ from django_filters import rest_framework as filters - -from gnosis.eth.django.filters import EthereumAddressFilter -from gnosis.eth.django.models import EthereumAddressBinaryField +from safe_eth.eth.django.filters import EthereumAddressFilter +from safe_eth.eth.django.models import EthereumAddressBinaryField from .models import Token diff --git a/safe_transaction_service/tokens/management/commands/add_token.py b/safe_transaction_service/tokens/management/commands/add_token.py index b2d4a1d1e..aa8197adf 100644 --- a/safe_transaction_service/tokens/management/commands/add_token.py +++ b/safe_transaction_service/tokens/management/commands/add_token.py @@ -1,8 +1,8 @@ from django.core.management.base import BaseCommand -from gnosis.eth import get_auto_ethereum_client -from gnosis.eth.ethereum_client import InvalidERC20Info -from gnosis.eth.utils import fast_to_checksum_address +from safe_eth.eth import get_auto_ethereum_client +from safe_eth.eth.ethereum_client import InvalidERC20Info +from safe_eth.eth.utils import fast_to_checksum_address from ...models import Token diff --git a/safe_transaction_service/tokens/management/commands/update_tokens_from_coinmarketcap.py b/safe_transaction_service/tokens/management/commands/update_tokens_from_coinmarketcap.py index 88fb5a905..7be2671be 100644 --- a/safe_transaction_service/tokens/management/commands/update_tokens_from_coinmarketcap.py +++ b/safe_transaction_service/tokens/management/commands/update_tokens_from_coinmarketcap.py @@ -1,7 +1,7 @@ from django.core.management.base import BaseCommand -from gnosis.eth import get_auto_ethereum_client -from gnosis.eth.ethereum_client import InvalidERC20Info, InvalidERC721Info +from safe_eth.eth import get_auto_ethereum_client +from safe_eth.eth.ethereum_client import InvalidERC20Info, InvalidERC721Info from ...clients import CoinMarketCapClient from ...models import Token diff --git a/safe_transaction_service/tokens/migrations/0001_initial.py b/safe_transaction_service/tokens/migrations/0001_initial.py index 2e799222e..a4e840893 100644 --- a/safe_transaction_service/tokens/migrations/0001_initial.py +++ b/safe_transaction_service/tokens/migrations/0001_initial.py @@ -2,7 +2,7 @@ from django.db import migrations, models -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -16,7 +16,7 @@ class Migration(migrations.Migration): fields=[ ( "address", - gnosis.eth.django.models.EthereumAddressField( + safe_eth.eth.django.models.EthereumAddressField( primary_key=True, serialize=False ), ), diff --git a/safe_transaction_service/tokens/migrations/0002_auto_20200903_1045.py b/safe_transaction_service/tokens/migrations/0002_auto_20200903_1045.py index 68b80e00b..f9900cdf7 100644 --- a/safe_transaction_service/tokens/migrations/0002_auto_20200903_1045.py +++ b/safe_transaction_service/tokens/migrations/0002_auto_20200903_1045.py @@ -3,10 +3,9 @@ from django.db import migrations, models from eth_abi.exceptions import DecodingError +from safe_eth.eth import get_auto_ethereum_client from web3.exceptions import Web3Exception -from gnosis.eth import get_auto_ethereum_client - def fix_token_decimals(apps, schema_editor): Token = apps.get_model("tokens", "Token") diff --git a/safe_transaction_service/tokens/migrations/0004_ethereum_address_field_v2_20211201_1512.py b/safe_transaction_service/tokens/migrations/0004_ethereum_address_field_v2_20211201_1512.py index 522853920..15b86b2ab 100644 --- a/safe_transaction_service/tokens/migrations/0004_ethereum_address_field_v2_20211201_1512.py +++ b/safe_transaction_service/tokens/migrations/0004_ethereum_address_field_v2_20211201_1512.py @@ -2,7 +2,7 @@ from django.db import migrations -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -21,7 +21,7 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="token", name="address", - field=gnosis.eth.django.models.EthereumAddressV2Field( + field=safe_eth.eth.django.models.EthereumAddressV2Field( primary_key=True, serialize=False ), ), diff --git a/safe_transaction_service/tokens/migrations/0006_auto_20220214_1629.py b/safe_transaction_service/tokens/migrations/0006_auto_20220214_1629.py index eb3898953..2d06df20c 100644 --- a/safe_transaction_service/tokens/migrations/0006_auto_20220214_1629.py +++ b/safe_transaction_service/tokens/migrations/0006_auto_20220214_1629.py @@ -2,7 +2,7 @@ from django.db import migrations, models -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -14,7 +14,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name="token", name="copy_price", - field=gnosis.eth.django.models.EthereumAddressV2Field( + field=safe_eth.eth.django.models.EthereumAddressV2Field( help_text="If provided, copy the price from the token", null=True ), ), diff --git a/safe_transaction_service/tokens/migrations/0008_alter_token_copy_price.py b/safe_transaction_service/tokens/migrations/0008_alter_token_copy_price.py index acf0ef18d..e864d0c0b 100644 --- a/safe_transaction_service/tokens/migrations/0008_alter_token_copy_price.py +++ b/safe_transaction_service/tokens/migrations/0008_alter_token_copy_price.py @@ -2,7 +2,7 @@ from django.db import migrations -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -14,7 +14,7 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="token", name="copy_price", - field=gnosis.eth.django.models.EthereumAddressV2Field( + field=safe_eth.eth.django.models.EthereumAddressV2Field( blank=True, help_text="If provided, copy the price from the token", null=True, diff --git a/safe_transaction_service/tokens/migrations/0010_tokenlist.py b/safe_transaction_service/tokens/migrations/0010_tokenlist.py index 75a0fdba0..3d8eaed8a 100644 --- a/safe_transaction_service/tokens/migrations/0010_tokenlist.py +++ b/safe_transaction_service/tokens/migrations/0010_tokenlist.py @@ -1,7 +1,7 @@ # Generated by Django 4.1.3 on 2023-01-24 12:31 from django.db import migrations, models -from gnosis.eth import EthereumNetwork +from safe_eth.eth import EthereumNetwork from safe_transaction_service.utils.ethereum import get_ethereum_network diff --git a/safe_transaction_service/tokens/migrations/0012_alter_token_address_alter_token_copy_price.py b/safe_transaction_service/tokens/migrations/0012_alter_token_address_alter_token_copy_price.py index a29e9aab2..cb12948cc 100644 --- a/safe_transaction_service/tokens/migrations/0012_alter_token_address_alter_token_copy_price.py +++ b/safe_transaction_service/tokens/migrations/0012_alter_token_address_alter_token_copy_price.py @@ -2,7 +2,7 @@ from django.db import migrations -import gnosis.eth.django.models +import safe_eth.eth.django.models class Migration(migrations.Migration): @@ -15,14 +15,14 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="token", name="address", - field=gnosis.eth.django.models.EthereumAddressBinaryField( + field=safe_eth.eth.django.models.EthereumAddressBinaryField( primary_key=True, serialize=False ), ), migrations.AlterField( model_name="token", name="copy_price", - field=gnosis.eth.django.models.EthereumAddressBinaryField( + field=safe_eth.eth.django.models.EthereumAddressBinaryField( blank=True, help_text="If provided, copy the price from the token", null=True, diff --git a/safe_transaction_service/tokens/models.py b/safe_transaction_service/tokens/models.py index 94b9e830e..88b889fde 100644 --- a/safe_transaction_service/tokens/models.py +++ b/safe_transaction_service/tokens/models.py @@ -16,11 +16,10 @@ from eth_typing import ChecksumAddress from imagekit.models import ProcessedImageField from pilkit.processors import Resize +from safe_eth.eth import InvalidERC20Info, InvalidERC721Info, get_auto_ethereum_client +from safe_eth.eth.django.models import EthereumAddressBinaryField from web3.exceptions import Web3Exception -from gnosis.eth import InvalidERC20Info, InvalidERC721Info, get_auto_ethereum_client -from gnosis.eth.django.models import EthereumAddressBinaryField - from .clients.zerion_client import ( BalancerTokenAdapterClient, ZerionTokenAdapterClient, diff --git a/safe_transaction_service/tokens/serializers.py b/safe_transaction_service/tokens/serializers.py index 035491d1f..e69d722a9 100644 --- a/safe_transaction_service/tokens/serializers.py +++ b/safe_transaction_service/tokens/serializers.py @@ -1,8 +1,7 @@ from enum import Enum from rest_framework import serializers - -from gnosis.eth.django.serializers import EthereumAddressField +from safe_eth.eth.django.serializers import EthereumAddressField from .models import Token diff --git a/safe_transaction_service/tokens/tasks.py b/safe_transaction_service/tokens/tasks.py index 131e37cb1..640821157 100644 --- a/safe_transaction_service/tokens/tasks.py +++ b/safe_transaction_service/tokens/tasks.py @@ -7,11 +7,10 @@ from celery import app from celery.utils.log import get_task_logger +from safe_eth.eth.ethereum_client import EthereumNetwork, get_auto_ethereum_client +from safe_eth.eth.utils import fast_to_checksum_address from web3.exceptions import Web3Exception -from gnosis.eth.ethereum_client import EthereumNetwork, get_auto_ethereum_client -from gnosis.eth.utils import fast_to_checksum_address - from safe_transaction_service.utils.ethereum import get_ethereum_network from safe_transaction_service.utils.utils import close_gevent_db_connection_decorator diff --git a/safe_transaction_service/tokens/tests/clients/test_coingecko_client.py b/safe_transaction_service/tokens/tests/clients/test_coingecko_client.py index 00a799d0f..b4d61f4d7 100644 --- a/safe_transaction_service/tokens/tests/clients/test_coingecko_client.py +++ b/safe_transaction_service/tokens/tests/clients/test_coingecko_client.py @@ -1,6 +1,6 @@ from django.test import TestCase -from gnosis.eth import EthereumNetwork +from safe_eth.eth import EthereumNetwork from safe_transaction_service.history.tests.utils import skip_on diff --git a/safe_transaction_service/tokens/tests/clients/test_coinmarketcap_client.py b/safe_transaction_service/tokens/tests/clients/test_coinmarketcap_client.py index 1d06018f4..426a87749 100644 --- a/safe_transaction_service/tokens/tests/clients/test_coinmarketcap_client.py +++ b/safe_transaction_service/tokens/tests/clients/test_coinmarketcap_client.py @@ -3,7 +3,7 @@ from django.test import TestCase -from gnosis.eth.utils import fast_is_checksum_address +from safe_eth.eth.utils import fast_is_checksum_address from ...clients import CoinMarketCapClient diff --git a/safe_transaction_service/tokens/tests/clients/test_kleros_client.py b/safe_transaction_service/tokens/tests/clients/test_kleros_client.py index 6f83e8a9d..9efa1187a 100644 --- a/safe_transaction_service/tokens/tests/clients/test_kleros_client.py +++ b/safe_transaction_service/tokens/tests/clients/test_kleros_client.py @@ -1,7 +1,7 @@ from django.test import TestCase -from gnosis.eth import EthereumClient -from gnosis.eth.utils import fast_is_checksum_address +from safe_eth.eth import EthereumClient +from safe_eth.eth.utils import fast_is_checksum_address from safe_transaction_service.history.tests.utils import just_test_if_mainnet_node diff --git a/safe_transaction_service/tokens/tests/clients/test_zerion_client.py b/safe_transaction_service/tokens/tests/clients/test_zerion_client.py index 09a36f147..d010d46c1 100644 --- a/safe_transaction_service/tokens/tests/clients/test_zerion_client.py +++ b/safe_transaction_service/tokens/tests/clients/test_zerion_client.py @@ -1,8 +1,7 @@ from django.test import TestCase from eth_account import Account - -from gnosis.eth import EthereumClient +from safe_eth.eth import EthereumClient from safe_transaction_service.history.tests.utils import just_test_if_mainnet_node diff --git a/safe_transaction_service/tokens/tests/migrations/test_migrations.py b/safe_transaction_service/tokens/tests/migrations/test_migrations.py index dd6eab6d0..90f6f81e9 100644 --- a/safe_transaction_service/tokens/tests/migrations/test_migrations.py +++ b/safe_transaction_service/tokens/tests/migrations/test_migrations.py @@ -5,8 +5,7 @@ from django.test import TestCase from django_test_migrations.migrator import Migrator - -from gnosis.eth import EthereumNetwork +from safe_eth.eth import EthereumNetwork # https://github.com/python/cpython/issues/100950 token_list_migration = importlib.import_module( diff --git a/safe_transaction_service/tokens/tests/test_commands.py b/safe_transaction_service/tokens/tests/test_commands.py index b6b487fbe..cbbf87c8c 100644 --- a/safe_transaction_service/tokens/tests/test_commands.py +++ b/safe_transaction_service/tokens/tests/test_commands.py @@ -6,10 +6,9 @@ from django.test import TestCase from eth_account import Account - -from gnosis.eth.ethereum_client import Erc20Info, Erc20Manager -from gnosis.eth.tests.ethereum_test_case import EthereumTestCaseMixin -from gnosis.eth.tests.utils import deploy_erc20 +from safe_eth.eth.ethereum_client import Erc20Info, Erc20Manager +from safe_eth.eth.tests.ethereum_test_case import EthereumTestCaseMixin +from safe_eth.eth.tests.utils import deploy_erc20 from ..clients import CoinMarketCapClient, CoinMarketCapToken from ..models import Token @@ -34,7 +33,7 @@ "symbol": "GNO", "description": "Crowd Sourced Wisdom - The next generation blockchain network. Speculate on anything with an easy-to-use prediction market", "decimals": 18, - "websiteUri": "https://gnosis.pm", + "websiteUri": "https://safe.global", "gas": False, }, { @@ -45,7 +44,7 @@ "symbol": "OWL", "description": "", "decimals": 18, - "websiteUri": "https://owl.gnosis.io/", + "websiteUri": "https://owl.safe_eth.io/", "gas": True, }, ] diff --git a/safe_transaction_service/tokens/tests/test_models.py b/safe_transaction_service/tokens/tests/test_models.py index 2b8128d7f..d4dd88110 100644 --- a/safe_transaction_service/tokens/tests/test_models.py +++ b/safe_transaction_service/tokens/tests/test_models.py @@ -6,8 +6,7 @@ from django.test import TestCase from eth_account import Account - -from gnosis.eth.ethereum_client import Erc20Info, Erc20Manager +from safe_eth.eth.ethereum_client import Erc20Info, Erc20Manager from ..clients.zerion_client import ( BalancerTokenAdapterClient, @@ -56,7 +55,7 @@ def test_token_get_full_logo_uri(self): f"https://tokens-logo.localhost/tokens/logos/{t.address}.png", ) - assets_url = "https://assets.gnosis.io" + assets_url = "https://assets.safe_eth.io" with self.settings(AWS_S3_PUBLIC_URL=assets_url): self.assertEqual( t.get_full_logo_uri(), f"{assets_url}/tokens/logos/{t.address}.png" diff --git a/safe_transaction_service/tokens/tests/test_tasks.py b/safe_transaction_service/tokens/tests/test_tasks.py index 88f631657..5dac0b82a 100644 --- a/safe_transaction_service/tokens/tests/test_tasks.py +++ b/safe_transaction_service/tokens/tests/test_tasks.py @@ -5,8 +5,7 @@ from django.test import TestCase from ens import ENS - -from gnosis.eth.ethereum_client import EthereumNetwork +from safe_eth.eth.ethereum_client import EthereumNetwork from ...utils.redis import get_redis from ..models import TokenList diff --git a/safe_transaction_service/tokens/tests/test_views.py b/safe_transaction_service/tokens/tests/test_views.py index 3d3f61f62..855671222 100644 --- a/safe_transaction_service/tokens/tests/test_views.py +++ b/safe_transaction_service/tokens/tests/test_views.py @@ -8,9 +8,8 @@ from rest_framework import status from rest_framework.exceptions import ErrorDetail from rest_framework.test import APITestCase - -from gnosis.eth.ethereum_client import Erc20Manager, InvalidERC20Info -from gnosis.safe.tests.safe_test_case import SafeTestCaseMixin +from safe_eth.eth.ethereum_client import Erc20Manager, InvalidERC20Info +from safe_eth.safe.tests.safe_test_case import SafeTestCaseMixin from ..models import Token from .factories import TokenFactory diff --git a/safe_transaction_service/tokens/views.py b/safe_transaction_service/tokens/views.py index b9055497a..f11929433 100644 --- a/safe_transaction_service/tokens/views.py +++ b/safe_transaction_service/tokens/views.py @@ -5,8 +5,7 @@ from rest_framework import response, status from rest_framework.filters import OrderingFilter, SearchFilter from rest_framework.generics import ListAPIView, RetrieveAPIView - -from gnosis.eth.utils import fast_is_checksum_address +from safe_eth.eth.utils import fast_is_checksum_address from . import filters, serializers from .models import Token diff --git a/safe_transaction_service/utils/auth.py b/safe_transaction_service/utils/auth.py index ce967d33d..157a8cca6 100644 --- a/safe_transaction_service/utils/auth.py +++ b/safe_transaction_service/utils/auth.py @@ -6,9 +6,9 @@ class CustomHeaderRemoteUserMiddleware(RemoteUserMiddleware): """ Headers that buzfeed SSO sends - X-Forwarded-Email: tanjiro.kamado@gnosis.pm + X-Forwarded-Email: tanjiro.kamado@safe.global X-Forwarded-For: 81.211.153.216, 81.13.44.29 - X-Forwarded-Groups: developers@gnosis.pm + X-Forwarded-Groups: developers@safe.global X-Forwarded-Host: safe-transaction.dev.gnosisdev.com X-Forwarded-Host: safe-transaction.dev.gnosisdev.com X-Forwarded-Port: 443 diff --git a/safe_transaction_service/utils/ethereum.py b/safe_transaction_service/utils/ethereum.py index c0c5ec647..7adc1dea3 100644 --- a/safe_transaction_service/utils/ethereum.py +++ b/safe_transaction_service/utils/ethereum.py @@ -1,4 +1,4 @@ -from gnosis.eth import EthereumNetwork, get_auto_ethereum_client +from safe_eth.eth import EthereumNetwork, get_auto_ethereum_client def get_chain_id() -> int: diff --git a/safe_transaction_service/utils/serializers.py b/safe_transaction_service/utils/serializers.py index 9269e24af..d5315bc66 100644 --- a/safe_transaction_service/utils/serializers.py +++ b/safe_transaction_service/utils/serializers.py @@ -2,11 +2,10 @@ from eth_typing import ChecksumAddress from rest_framework.exceptions import ValidationError +from safe_eth.eth import get_auto_ethereum_client +from safe_eth.safe import Safe from web3.exceptions import Web3Exception -from gnosis.eth import get_auto_ethereum_client -from gnosis.safe import Safe - def get_safe_owners(safe_address: ChecksumAddress) -> List[ChecksumAddress]: """ diff --git a/scripts/benchmark_node.py b/scripts/benchmark_node.py index 355f46de0..91fad272f 100644 --- a/scripts/benchmark_node.py +++ b/scripts/benchmark_node.py @@ -2,8 +2,7 @@ from contextlib import contextmanager from gevent.pool import Pool - -from gnosis.eth import EthereumClient +from safe_eth.eth import EthereumClient @contextmanager