Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Commit 2b032ec

Browse files
cburgdorfpipermerriam
authored andcommitted
Inherit from ABC rather than setting metaclass
1 parent 14c0303 commit 2b032ec

File tree

15 files changed

+31
-31
lines changed

15 files changed

+31
-31
lines changed

evm/chains/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import absolute_import
22

33
from abc import (
4-
ABCMeta,
4+
ABC,
55
abstractmethod
66
)
77
import operator
@@ -102,7 +102,7 @@
102102
AccountState = Dict[Address, Dict[str, Union[int, bytes, Dict[int, int]]]]
103103

104104

105-
class BaseChain(Configurable, metaclass=ABCMeta):
105+
class BaseChain(Configurable, ABC):
106106
"""
107107
The base class for all Chain objects
108108
"""

evm/chains/header.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from abc import ABCMeta, abstractmethod
1+
from abc import ABC, abstractmethod
22
from typing import Dict, Any, Tuple, Type # noqa: F401
33

44
from eth_typing import (
@@ -18,7 +18,7 @@
1818
from evm.vm.base import BaseVM # noqa: F401
1919

2020

21-
class BaseHeaderChain(Configurable, metaclass=ABCMeta):
21+
class BaseHeaderChain(Configurable, ABC):
2222
_base_db = None # type: BaseDB
2323

2424
_headerdb_class = None # type: Type[BaseHeaderDB]

evm/db/account.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from abc import (
2-
ABCMeta,
2+
ABC,
33
abstractmethod
44
)
55
from uuid import UUID
@@ -59,7 +59,7 @@
5959
account_cache = LRU(2048)
6060

6161

62-
class BaseAccountDB(metaclass=ABCMeta):
62+
class BaseAccountDB(ABC):
6363

6464
@abstractmethod
6565
def __init__(self) -> None:

evm/db/backends/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
from abc import (
2-
ABCMeta,
2+
ABC,
33
abstractmethod
44
)
55
from collections.abc import (
66
MutableMapping,
77
)
88

99

10-
class BaseDB(MutableMapping, metaclass=ABCMeta):
10+
class BaseDB(MutableMapping, ABC):
1111
"""
1212
This is an abstract key/value lookup with all :class:`bytes` values,
1313
with some convenience methods for databases. As much as possible,

evm/db/chain.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import itertools
33

44
from abc import (
5-
ABCMeta,
5+
ABC,
66
abstractmethod
77
)
88
from typing import (
@@ -76,7 +76,7 @@ class TransactionKey(rlp.Serializable):
7676
]
7777

7878

79-
class BaseChainDB(metaclass=ABCMeta):
79+
class BaseChainDB(ABC):
8080
db = None # type: BaseDB
8181

8282
@abstractmethod

evm/db/header.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from abc import ABCMeta, abstractmethod
1+
from abc import ABC, abstractmethod
22
from typing import Tuple, Iterable
33

44
import rlp
@@ -30,7 +30,7 @@
3030
)
3131

3232

33-
class BaseHeaderDB(metaclass=ABCMeta):
33+
class BaseHeaderDB(ABC):
3434
db = None # type: BaseDB
3535

3636
def __init__(self, db: BaseDB) -> None:

evm/db/schema.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
from abc import ABCMeta, abstractmethod
1+
from abc import ABC, abstractmethod
22

33
from eth_typing import (
44
BlockNumber,
55
Hash32,
66
)
77

88

9-
class BaseSchema(metaclass=ABCMeta):
9+
class BaseSchema(ABC):
1010
@staticmethod
1111
@abstractmethod
1212
def make_canonical_head_hash_lookup_key() -> bytes:

evm/rlp/blocks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from abc import (
2-
ABCMeta,
2+
ABC,
33
abstractmethod
44
)
55
from typing import ( # noqa: F401
@@ -22,7 +22,7 @@
2222
from .headers import BlockHeader
2323

2424

25-
class BaseBlock(rlp.Serializable, Configurable, metaclass=ABCMeta):
25+
class BaseBlock(rlp.Serializable, Configurable, ABC):
2626
transaction_class = None # type: Type[BaseTransaction]
2727

2828
@classmethod

evm/rlp/transactions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from abc import (
2-
ABCMeta,
2+
ABC,
33
abstractmethod
44
)
55
from typing import (
@@ -154,7 +154,7 @@ def create_unsigned_transaction(self, *args: Any, **kwargs: Any) -> 'BaseTransac
154154
raise NotImplementedError("Must be implemented by subclasses")
155155

156156

157-
class BaseUnsignedTransaction(rlp.Serializable, BaseTransactionCommonMethods, metaclass=ABCMeta):
157+
class BaseUnsignedTransaction(rlp.Serializable, BaseTransactionCommonMethods, ABC):
158158
fields = [
159159
('nonce', big_endian_int),
160160
('gas_price', big_endian_int),

evm/vm/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import absolute_import
22
from abc import (
3-
ABCMeta,
3+
ABC,
44
abstractmethod,
55
)
66
import contextlib
@@ -63,7 +63,7 @@
6363
from evm.vm.state import BaseState # noqa: F401
6464

6565

66-
class BaseVM(Configurable, metaclass=ABCMeta):
66+
class BaseVM(Configurable, ABC):
6767
block = None # type: BaseBlock
6868
block_class = None # type: Type[BaseBlock]
6969
fork = None # type: str

0 commit comments

Comments
 (0)