Repository: rotki/rotki

Issue:
Write test to load all addresses from all_assets.json and assure all are checksummed
## Problem Definition

As seen here: https://github.com/rotki/rotki/pull/1169

it's possible to provide a non-checksummed address in all_assets.json and that is an error in runtime. We need to write a test for this so that we can be sure all addresses in that json file are checksummed.

## Task

Do it.


Discussion:

Resolving patch:
diff --git a/rotkehlchen/db/dbhandler.py b/rotkehlchen/db/dbhandler.py
--- a/rotkehlchen/db/dbhandler.py
+++ b/rotkehlchen/db/dbhandler.py
@@ -18,6 +18,7 @@
 from rotkehlchen.chain.ethereum.structures import AaveEvent
 from rotkehlchen.constants.assets import A_USD, S_BTC, S_ETH
 from rotkehlchen.datatyping import BalancesData
+from rotkehlchen.db.schema import DB_SCRIPT_CREATE_TABLES
 from rotkehlchen.db.settings import (
     DEFAULT_PREMIUM_SHOULD_SYNC,
     ROTKEHLCHEN_DB_VERSION,
@@ -27,7 +28,6 @@
 )
 from rotkehlchen.db.upgrade_manager import DBUpgradeManager
 from rotkehlchen.db.utils import (
-    DB_SCRIPT_CREATE_TABLES,
     AssetBalance,
     BlockchainAccounts,
     DBStartupAction,
diff --git a/rotkehlchen/db/schema.py b/rotkehlchen/db/schema.py
new file mode 100644
--- /dev/null
+++ b/rotkehlchen/db/schema.py
@@ -0,0 +1,275 @@
+# Custom enum table for trade types
+DB_CREATE_TRADE_TYPE = """
+CREATE TABLE IF NOT EXISTS trade_type (
+  type    CHAR(1)       PRIMARY KEY NOT NULL,
+  seq     INTEGER UNIQUE
+);
+/* Buy Type */
+INSERT OR IGNORE INTO trade_type(type, seq) VALUES ('A', 1);
+/* Sell Type */
+INSERT OR IGNORE INTO trade_type(type, seq) VALUES ('B', 2);
+/* Settlement Buy Type */
+INSERT OR IGNORE INTO trade_type(type, seq) VALUES ('C', 3);
+/* Settlement Sell Type */
+INSERT OR IGNORE INTO trade_type(type, seq) VALUES ('D', 4);
+"""
+
+# Custom enum table for locations
+DB_CREATE_LOCATION = """
+CREATE TABLE IF NOT EXISTS location (
+  location    CHAR(1)       PRIMARY KEY NOT NULL,
+  seq     INTEGER UNIQUE
+);
+/* External */
+INSERT OR IGNORE INTO location(location, seq) VALUES ('A', 1);
+/* Kraken */
+INSERT OR IGNORE INTO location(location, seq) VALUES ('B', 2);
+/* Poloniex */
+INSERT OR IGNORE INTO location(location, seq) VALUES ('C', 3);
+/* Bittrex */
+INSERT OR IGNORE INTO location(location, seq) VALUES ('D', 4);
+/* Binance */
+INSERT OR IGNORE INTO location(location, seq) VALUES ('E', 5);
+/* Bitmex */
+INSERT OR IGNORE INTO location(location, seq) VALUES ('F', 6);
+/* Coinbase */
+INSERT OR IGNORE INTO location(location, seq) VALUES ('G', 7);
+/* Total */
+INSERT OR IGNORE INTO location(location, seq) VALUES ('H', 8);
+/* Banks */
+INSERT OR IGNORE INTO location(location, seq) VALUES ('I', 9);
+/* Blockchain */
+INSERT OR IGNORE INTO location(location, seq) VALUES ('J', 10);
+/* Coinbase Pro */
+INSERT OR IGNORE INTO location(location, seq) VALUES ('K', 11);
+/* Gemini */
+INSERT OR IGNORE INTO location(location, seq) VALUES ('L', 12);
+/* Equities */
+INSERT OR IGNORE INTO location(location, seq) VALUES ('M', 13);
+/* Real estate */
+INSERT OR IGNORE INTO location(location, seq) VALUES ('N', 14);
+/* Commodities */
+INSERT OR IGNORE INTO location(location, seq) VALUES ('O', 15);
+"""
+
+# Custom enum table for AssetMovement categories (deposit/withdrawal)
+DB_CREATE_ASSET_MOVEMENT_CATEGORY = """
+CREATE TABLE IF NOT EXISTS asset_movement_category (
+  category    CHAR(1)       PRIMARY KEY NOT NULL,
+  seq     INTEGER UNIQUE
+);
+/* Deposit Category */
+INSERT OR IGNORE INTO asset_movement_category(category, seq) VALUES ('A', 1);
+/* Withdrawal Category */
+INSERT OR IGNORE INTO asset_movement_category(category, seq) VALUES ('B', 2);
+"""
+
+DB_CREATE_TIMED_BALANCES = """
+CREATE TABLE IF NOT EXISTS timed_balances (
+    time INTEGER,
+    currency VARCHAR[12],
+    amount TEXT,
+    usd_value TEXT,
+    PRIMARY KEY (time, currency)
+);
+"""
+
+DB_CREATE_TIMED_LOCATION_DATA = """
+CREATE TABLE IF NOT EXISTS timed_location_data (
+    time INTEGER,
+    location CHAR(1) NOT NULL DEFAULT('A') REFERENCES location(location),
+    usd_value TEXT,
+    PRIMARY KEY (time, location)
+);
+"""
+
+DB_CREATE_USER_CREDENTIALS = """
+CREATE TABLE IF NOT EXISTS user_credentials (
+    name VARCHAR[24] NOT NULL PRIMARY KEY,
+    api_key TEXT,
+    api_secret TEXT,
+    passphrase TEXT
+);
+"""
+
+DB_CREATE_AAVE_EVENTS = """
+CREATE TABLE IF NOT EXISTS aave_events (
+    address VARCHAR[42] NOT NULL,
+    event_type VARCHAR[10] NOT NULL,
+    asset VARCHAR[12] NOT NULL,
+    amount TEXT NOT NULL,
+    usd_value TEXT NOT NULL,
+    block_number INTEGER NOT NULL,
+    timestamp INTEGER NOT NULL,
+    tx_hash VARCHAR[66] NOT NULL,
+    log_index INTEGER NOT NULL,
+    PRIMARY KEY (event_type, tx_hash, log_index)
+);
+"""
+
+DB_CREATE_EXTERNAL_SERVICE_CREDENTIALS = """
+CREATE TABLE IF NOT EXISTS external_service_credentials (
+    name VARCHAR[30] NOT NULL PRIMARY KEY,
+    api_key TEXT
+);
+"""
+
+DB_CREATE_TAGS_TABLE = """
+CREATE TABLE IF NOT EXISTS tags (
+    name TEXT NOT NULL PRIMARY KEY COLLATE NOCASE,
+    description TEXT,
+    background_color TEXT,
+    foreground_color TEXT
+);
+"""
+
+DB_CREATE_BLOCKCHAIN_ACCOUNTS = """
+CREATE TABLE IF NOT EXISTS blockchain_accounts (
+    blockchain VARCHAR[24],
+    account TEXT NOT NULL PRIMARY KEY,
+    label TEXT
+);
+"""
+
+DB_CREATE_MANUALLY_TRACKED_BALANCES = """
+CREATE TABLE IF NOT EXISTS manually_tracked_balances (
+    asset VARCHAR[24] NOT NULL,
+    label TEXT NOT NULL PRIMARY KEY,
+    amount TEXT,
+    location CHAR(1) NOT NULL DEFAULT('A') REFERENCES location(location)
+);
+"""
+
+# Not putting object_reference as a foreign key since multiple objects, not only
+# blockchain accounts can have tag mappings (future-proof thinking here)
+DB_CREATE_TAG_MAPPINGS = """
+CREATE TABLE IF NOT EXISTS tag_mappings (
+    object_reference TEXT,
+    tag_name TEXT,
+    FOREIGN KEY(tag_name) REFERENCES tags(name)
+    PRIMARY KEY (object_reference, tag_name)
+);
+"""
+
+DB_CREATE_MULTISETTINGS = """
+CREATE TABLE IF NOT EXISTS multisettings (
+    name VARCHAR[24] NOT NULL,
+    value TEXT,
+    UNIQUE(name, value)
+);
+"""
+
+DB_CREATE_CURRENT_BALANCES = """
+CREATE TABLE IF NOT EXISTS current_balances (
+    asset VARCHAR[24] NOT NULL PRIMARY KEY,
+    amount TEXT
+);
+"""
+
+DB_CREATE_TRADES = """
+CREATE TABLE IF NOT EXISTS trades (
+    id TEXT PRIMARY KEY,
+    time INTEGER,
+    location CHAR(1) NOT NULL DEFAULT('A') REFERENCES location(location),
+    pair VARCHAR[24],
+    type CHAR(1) NOT NULL DEFAULT ('A') REFERENCES trade_type(type),
+    amount TEXT,
+    rate TEXT,
+    fee TEXT,
+    fee_currency VARCHAR[10],
+    link TEXT,
+    notes TEXT
+);
+"""
+
+DB_CREATE_MARGIN = """
+CREATE TABLE IF NOT EXISTS margin_positions (
+    id TEXT PRIMARY KEY,
+    location CHAR(1) NOT NULL DEFAULT('A') REFERENCES location(location),
+    open_time INTEGER,
+    close_time INTEGER,
+    profit_loss TEXT,
+    pl_currency VARCHAR[10],
+    fee TEXT,
+    fee_currency VARCHAR[10],
+    link TEXT,
+    notes TEXT
+);
+"""
+
+DB_CREATE_ASSET_MOVEMENTS = """
+CREATE TABLE IF NOT EXISTS asset_movements (
+    id TEXT PRIMARY KEY,
+    location CHAR(1) NOT NULL DEFAULT('A') REFERENCES location(location),
+    category CHAR(1) NOT NULL DEFAULT('A') REFERENCES asset_movement_category(category),
+    time INTEGER,
+    asset VARCHAR[10],
+    amount TEXT,
+    fee_asset VARCHAR[10],
+    fee TEXT,
+    link TEXT
+);
+"""
+
+DB_CREATE_ETHEREUM_TRANSACTIONS = """
+CREATE TABLE IF NOT EXISTS ethereum_transactions (
+    tx_hash BLOB,
+    timestamp INTEGER,
+    block_number INTEGER,
+    from_address TEXT,
+    to_address TEXT,
+    value TEXT,
+    gas TEXT,
+    gas_price TEXT,
+    gas_used TEXT,
+    input_data BLOB,
+    nonce INTEGER,
+    /* we determine uniqueness for ethereum internal transactions by using an
+    increasingly negative number */
+    PRIMARY KEY (tx_hash, input_data, nonce)
+);
+"""
+
+DB_CREATE_USED_QUERY_RANGES = """
+CREATE TABLE IF NOT EXISTS used_query_ranges (
+    name VARCHAR[24] NOT NULL PRIMARY KEY,
+    start_ts INTEGER,
+    end_ts INTEGER
+);
+"""
+
+DB_CREATE_SETTINGS = """
+CREATE TABLE IF NOT EXISTS settings (
+    name VARCHAR[24] NOT NULL PRIMARY KEY,
+    value TEXT
+);
+"""
+
+DB_SCRIPT_CREATE_TABLES = """
+PRAGMA foreign_keys=off;
+BEGIN TRANSACTION;
+{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}
+COMMIT;
+PRAGMA foreign_keys=on;
+""".format(
+    DB_CREATE_TRADE_TYPE,
+    DB_CREATE_LOCATION,
+    DB_CREATE_ASSET_MOVEMENT_CATEGORY,
+    DB_CREATE_TIMED_BALANCES,
+    DB_CREATE_TIMED_LOCATION_DATA,
+    DB_CREATE_USER_CREDENTIALS,
+    DB_CREATE_EXTERNAL_SERVICE_CREDENTIALS,
+    DB_CREATE_BLOCKCHAIN_ACCOUNTS,
+    DB_CREATE_MULTISETTINGS,
+    DB_CREATE_MANUALLY_TRACKED_BALANCES,
+    DB_CREATE_CURRENT_BALANCES,
+    DB_CREATE_TRADES,
+    DB_CREATE_ETHEREUM_TRANSACTIONS,
+    DB_CREATE_MARGIN,
+    DB_CREATE_ASSET_MOVEMENTS,
+    DB_CREATE_USED_QUERY_RANGES,
+    DB_CREATE_SETTINGS,
+    DB_CREATE_TAGS_TABLE,
+    DB_CREATE_TAG_MAPPINGS,
+    DB_CREATE_AAVE_EVENTS,
+)
diff --git a/rotkehlchen/db/utils.py b/rotkehlchen/db/utils.py
--- a/rotkehlchen/db/utils.py
+++ b/rotkehlchen/db/utils.py
@@ -123,280 +123,3 @@ def insert_tag_mappings(
     cursor.executemany(
         'INSERT INTO tag_mappings(object_reference, tag_name) VALUES (?, ?)', mapping_tuples,
     )
-
-
-# Custom enum table for trade types
-DB_CREATE_TRADE_TYPE = """
-CREATE TABLE IF NOT EXISTS trade_type (
-  type    CHAR(1)       PRIMARY KEY NOT NULL,
-  seq     INTEGER UNIQUE
-);
-/* Buy Type */
-INSERT OR IGNORE INTO trade_type(type, seq) VALUES ('A', 1);
-/* Sell Type */
-INSERT OR IGNORE INTO trade_type(type, seq) VALUES ('B', 2);
-/* Settlement Buy Type */
-INSERT OR IGNORE INTO trade_type(type, seq) VALUES ('C', 3);
-/* Settlement Sell Type */
-INSERT OR IGNORE INTO trade_type(type, seq) VALUES ('D', 4);
-"""
-
-# Custom enum table for locations
-DB_CREATE_LOCATION = """
-CREATE TABLE IF NOT EXISTS location (
-  location    CHAR(1)       PRIMARY KEY NOT NULL,
-  seq     INTEGER UNIQUE
-);
-/* External */
-INSERT OR IGNORE INTO location(location, seq) VALUES ('A', 1);
-/* Kraken */
-INSERT OR IGNORE INTO location(location, seq) VALUES ('B', 2);
-/* Poloniex */
-INSERT OR IGNORE INTO location(location, seq) VALUES ('C', 3);
-/* Bittrex */
-INSERT OR IGNORE INTO location(location, seq) VALUES ('D', 4);
-/* Binance */
-INSERT OR IGNORE INTO location(location, seq) VALUES ('E', 5);
-/* Bitmex */
-INSERT OR IGNORE INTO location(location, seq) VALUES ('F', 6);
-/* Coinbase */
-INSERT OR IGNORE INTO location(location, seq) VALUES ('G', 7);
-/* Total */
-INSERT OR IGNORE INTO location(location, seq) VALUES ('H', 8);
-/* Banks */
-INSERT OR IGNORE INTO location(location, seq) VALUES ('I', 9);
-/* Blockchain */
-INSERT OR IGNORE INTO location(location, seq) VALUES ('J', 10);
-/* Coinbase Pro */
-INSERT OR IGNORE INTO location(location, seq) VALUES ('K', 11);
-/* Gemini */
-INSERT OR IGNORE INTO location(location, seq) VALUES ('L', 12);
-/* Equities */
-INSERT OR IGNORE INTO location(location, seq) VALUES ('M', 13);
-/* Real estate */
-INSERT OR IGNORE INTO location(location, seq) VALUES ('N', 14);
-/* Commodities */
-INSERT OR IGNORE INTO location(location, seq) VALUES ('O', 15);
-"""
-
-# Custom enum table for AssetMovement categories (deposit/withdrawal)
-DB_CREATE_ASSET_MOVEMENT_CATEGORY = """
-CREATE TABLE IF NOT EXISTS asset_movement_category (
-  category    CHAR(1)       PRIMARY KEY NOT NULL,
-  seq     INTEGER UNIQUE
-);
-/* Deposit Category */
-INSERT OR IGNORE INTO asset_movement_category(category, seq) VALUES ('A', 1);
-/* Withdrawal Category */
-INSERT OR IGNORE INTO asset_movement_category(category, seq) VALUES ('B', 2);
-"""
-
-DB_CREATE_TIMED_BALANCES = """
-CREATE TABLE IF NOT EXISTS timed_balances (
-    time INTEGER,
-    currency VARCHAR[12],
-    amount TEXT,
-    usd_value TEXT,
-    PRIMARY KEY (time, currency)
-);
-"""
-
-DB_CREATE_TIMED_LOCATION_DATA = """
-CREATE TABLE IF NOT EXISTS timed_location_data (
-    time INTEGER,
-    location CHAR(1) NOT NULL DEFAULT('A') REFERENCES location(location),
-    usd_value TEXT,
-    PRIMARY KEY (time, location)
-);
-"""
-
-DB_CREATE_USER_CREDENTIALS = """
-CREATE TABLE IF NOT EXISTS user_credentials (
-    name VARCHAR[24] NOT NULL PRIMARY KEY,
-    api_key TEXT,
-    api_secret TEXT,
-    passphrase TEXT
-);
-"""
-
-DB_CREATE_AAVE_EVENTS = """
-CREATE TABLE IF NOT EXISTS aave_events (
-    address VARCHAR[42] NOT NULL,
-    event_type VARCHAR[10] NOT NULL,
-    asset VARCHAR[12] NOT NULL,
-    amount TEXT NOT NULL,
-    usd_value TEXT NOT NULL,
-    block_number INTEGER NOT NULL,
-    timestamp INTEGER NOT NULL,
-    tx_hash VARCHAR[66] NOT NULL,
-    log_index INTEGER NOT NULL,
-    PRIMARY KEY (event_type, tx_hash, log_index)
-);
-"""
-
-DB_CREATE_EXTERNAL_SERVICE_CREDENTIALS = """
-CREATE TABLE IF NOT EXISTS external_service_credentials (
-    name VARCHAR[30] NOT NULL PRIMARY KEY,
-    api_key TEXT
-);
-"""
-
-DB_CREATE_TAGS_TABLE = """
-CREATE TABLE IF NOT EXISTS tags (
-    name TEXT NOT NULL PRIMARY KEY COLLATE NOCASE,
-    description TEXT,
-    background_color TEXT,
-    foreground_color TEXT
-);
-"""
-
-DB_CREATE_BLOCKCHAIN_ACCOUNTS = """
-CREATE TABLE IF NOT EXISTS blockchain_accounts (
-    blockchain VARCHAR[24],
-    account TEXT NOT NULL PRIMARY KEY,
-    label TEXT
-);
-"""
-
-DB_CREATE_MANUALLY_TRACKED_BALANCES = """
-CREATE TABLE IF NOT EXISTS manually_tracked_balances (
-    asset VARCHAR[24] NOT NULL,
-    label TEXT NOT NULL PRIMARY KEY,
-    amount TEXT,
-    location CHAR(1) NOT NULL DEFAULT('A') REFERENCES location(location)
-);
-"""
-
-# Not putting object_reference as a foreign key since multiple objects, not only
-# blockchain accounts can have tag mappings (future-proof thinking here)
-DB_CREATE_TAG_MAPPINGS = """
-CREATE TABLE IF NOT EXISTS tag_mappings (
-    object_reference TEXT,
-    tag_name TEXT,
-    FOREIGN KEY(tag_name) REFERENCES tags(name)
-    PRIMARY KEY (object_reference, tag_name)
-);
-"""
-
-DB_CREATE_MULTISETTINGS = """
-CREATE TABLE IF NOT EXISTS multisettings (
-    name VARCHAR[24] NOT NULL,
-    value TEXT,
-    UNIQUE(name, value)
-);
-"""
-
-DB_CREATE_CURRENT_BALANCES = """
-CREATE TABLE IF NOT EXISTS current_balances (
-    asset VARCHAR[24] NOT NULL PRIMARY KEY,
-    amount TEXT
-);
-"""
-
-DB_CREATE_TRADES = """
-CREATE TABLE IF NOT EXISTS trades (
-    id TEXT PRIMARY KEY,
-    time INTEGER,
-    location CHAR(1) NOT NULL DEFAULT('A') REFERENCES location(location),
-    pair VARCHAR[24],
-    type CHAR(1) NOT NULL DEFAULT ('A') REFERENCES trade_type(type),
-    amount TEXT,
-    rate TEXT,
-    fee TEXT,
-    fee_currency VARCHAR[10],
-    link TEXT,
-    notes TEXT
-);
-"""
-
-DB_CREATE_MARGIN = """
-CREATE TABLE IF NOT EXISTS margin_positions (
-    id TEXT PRIMARY KEY,
-    location CHAR(1) NOT NULL DEFAULT('A') REFERENCES location(location),
-    open_time INTEGER,
-    close_time INTEGER,
-    profit_loss TEXT,
-    pl_currency VARCHAR[10],
-    fee TEXT,
-    fee_currency VARCHAR[10],
-    link TEXT,
-    notes TEXT
-);
-"""
-
-DB_CREATE_ASSET_MOVEMENTS = """
-CREATE TABLE IF NOT EXISTS asset_movements (
-    id TEXT PRIMARY KEY,
-    location CHAR(1) NOT NULL DEFAULT('A') REFERENCES location(location),
-    category CHAR(1) NOT NULL DEFAULT('A') REFERENCES asset_movement_category(category),
-    time INTEGER,
-    asset VARCHAR[10],
-    amount TEXT,
-    fee_asset VARCHAR[10],
-    fee TEXT,
-    link TEXT
-);
-"""
-
-DB_CREATE_ETHEREUM_TRANSACTIONS = """
-CREATE TABLE IF NOT EXISTS ethereum_transactions (
-    tx_hash BLOB,
-    timestamp INTEGER,
-    block_number INTEGER,
-    from_address TEXT,
-    to_address TEXT,
-    value TEXT,
-    gas TEXT,
-    gas_price TEXT,
-    gas_used TEXT,
-    input_data BLOB,
-    nonce INTEGER,
-    /* we determine uniqueness for ethereum internal transactions by using an
-    increasingly negative number */
-    PRIMARY KEY (tx_hash, input_data, nonce)
-);
-"""
-
-DB_CREATE_USED_QUERY_RANGES = """
-CREATE TABLE IF NOT EXISTS used_query_ranges (
-    name VARCHAR[24] NOT NULL PRIMARY KEY,
-    start_ts INTEGER,
-    end_ts INTEGER
-);
-"""
-
-DB_CREATE_SETTINGS = """
-CREATE TABLE IF NOT EXISTS settings (
-    name VARCHAR[24] NOT NULL PRIMARY KEY,
-    value TEXT
-);
-"""
-
-DB_SCRIPT_CREATE_TABLES = """
-PRAGMA foreign_keys=off;
-BEGIN TRANSACTION;
-{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}
-COMMIT;
-PRAGMA foreign_keys=on;
-""".format(
-    DB_CREATE_TRADE_TYPE,
-    DB_CREATE_LOCATION,
-    DB_CREATE_ASSET_MOVEMENT_CATEGORY,
-    DB_CREATE_TIMED_BALANCES,
-    DB_CREATE_TIMED_LOCATION_DATA,
-    DB_CREATE_USER_CREDENTIALS,
-    DB_CREATE_EXTERNAL_SERVICE_CREDENTIALS,
-    DB_CREATE_BLOCKCHAIN_ACCOUNTS,
-    DB_CREATE_MULTISETTINGS,
-    DB_CREATE_MANUALLY_TRACKED_BALANCES,
-    DB_CREATE_CURRENT_BALANCES,
-    DB_CREATE_TRADES,
-    DB_CREATE_ETHEREUM_TRANSACTIONS,
-    DB_CREATE_MARGIN,
-    DB_CREATE_ASSET_MOVEMENTS,
-    DB_CREATE_USED_QUERY_RANGES,
-    DB_CREATE_SETTINGS,
-    DB_CREATE_TAGS_TABLE,
-    DB_CREATE_TAG_MAPPINGS,
-    DB_CREATE_AAVE_EVENTS,
-)


Test patch:
diff --git a/rotkehlchen/tests/unit/test_assets.py b/rotkehlchen/tests/unit/test_assets.py
--- a/rotkehlchen/tests/unit/test_assets.py
+++ b/rotkehlchen/tests/unit/test_assets.py
@@ -1,6 +1,8 @@
 import pytest
+from eth_utils import is_checksum_address
 
 from rotkehlchen.assets.asset import Asset, EthereumToken
+from rotkehlchen.assets.resolver import AssetResolver, asset_type_mapping
 from rotkehlchen.errors import DeserializationError, UnknownAsset
 from rotkehlchen.typing import AssetType
 
@@ -53,3 +55,17 @@ def test_ethereum_tokens():
 
     with pytest.raises(DeserializationError):
         EthereumToken('BTC')
+
+
+def test_tokens_address_is_checksummed():
+    """Test that all ethereum saved token asset addresses are checksummed"""
+    for _, asset_data in AssetResolver().assets.items():
+        asset_type = asset_type_mapping[asset_data['type']]
+        if asset_type not in (AssetType.ETH_TOKEN_AND_MORE, AssetType.ETH_TOKEN):
+            continue
+
+        msg = (
+            f'Ethereum token\'s {asset_data["name"]} ethereum address '
+            f'is not checksummed {asset_data["ethereum_address"]}'
+        )
+        assert is_checksum_address(asset_data['ethereum_address']), msg