File tree Expand file tree Collapse file tree 10 files changed +114
-26
lines changed Expand file tree Collapse file tree 10 files changed +114
-26
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,14 @@ DataBase
7
7
:name: toc-eth-api-db
8
8
:caption: Database
9
9
10
- db/api.db.backends
11
10
db/api.db.account
11
+ db/api.db.atomic
12
+ db/api.db.backends
13
+ db/api.db.batch
14
+ db/api.db.cache
15
+ db/api.db.chain
16
+ db/api.db.diff
17
+ db/api.db.header
12
18
db/api.db.journal
13
- db/api.db.chain
19
+ db/api.db.schema
20
+ db/api.db.storage
Original file line number Diff line number Diff line change
1
+ Atomic
2
+ ======
3
+
4
+ AtomicDB
5
+ ~~~~~~~~
6
+
7
+ .. autoclass :: eth.db.atomic.AtomicDB
8
+ :members:
9
+
10
+
11
+ .. autoclass :: eth.db.atomic.AtomicDBWriteBatch
12
+ :members:
13
+
Original file line number Diff line number Diff line change
1
+ Batch
2
+ =====
3
+
4
+ BatchDB
5
+ ~~~~~~~
6
+
7
+ .. autoclass :: eth.db.batch.BatchDB
8
+ :members:
Original file line number Diff line number Diff line change
1
+ Cache
2
+ =====
3
+
4
+ CacheDB
5
+ ~~~~~~~
6
+
7
+ .. autoclass :: eth.db.cache.CacheDB
8
+ :members:
Original file line number Diff line number Diff line change
1
+ DBDiff
2
+ ======
3
+
4
+ DBDiff
5
+ ~~~~~~
6
+
7
+ .. autoclass :: eth.db.diff.DBDiff
8
+ :members:
9
+
10
+ DBDiffTracker
11
+ ~~~~~~~~~~~~~
12
+
13
+ .. autoclass :: eth.db.diff.DBDiffTracker
14
+ :members:
15
+
16
+ DiffMissingError
17
+ ~~~~~~~~~~~~~~~~
18
+
19
+ .. autoclass :: eth.db.diff.DiffMissingError
20
+ :members:
21
+
22
+
Original file line number Diff line number Diff line change
1
+ Header
2
+ ======
3
+
4
+ HeaderDB
5
+ ~~~~~~~~
6
+
7
+ .. autoclass :: eth.db.header.HeaderDB
8
+ :members:
Original file line number Diff line number Diff line change
1
+ Schema
2
+ ======
3
+
4
+ SchemaV1
5
+ --------
6
+
7
+ .. autoclass :: eth.db.schema.SchemaV1
8
+ :members:
Original file line number Diff line number Diff line change
1
+ Storage
2
+ =======
3
+
4
+ AccountStorageDB
5
+ ----------------
6
+
7
+ .. autoclass :: eth.db.storage.AccountStorageDB
8
+ :members:
9
+
10
+ StorageLookup
11
+ -------------
12
+
13
+ .. autoclass :: eth.db.storage.StorageLookup
14
+ :members:
Original file line number Diff line number Diff line change @@ -255,6 +255,28 @@ def is_genesis(self) -> bool:
255
255
...
256
256
257
257
258
+ class SchemaAPI (ABC ):
259
+ @staticmethod
260
+ @abstractmethod
261
+ def make_canonical_head_hash_lookup_key () -> bytes :
262
+ ...
263
+
264
+ @staticmethod
265
+ @abstractmethod
266
+ def make_block_number_to_hash_lookup_key (block_number : BlockNumber ) -> bytes :
267
+ ...
268
+
269
+ @staticmethod
270
+ @abstractmethod
271
+ def make_block_hash_to_score_lookup_key (block_hash : Hash32 ) -> bytes :
272
+ ...
273
+
274
+ @staticmethod
275
+ @abstractmethod
276
+ def make_transaction_hash_to_block_lookup_key (transaction_hash : Hash32 ) -> bytes :
277
+ ...
278
+
279
+
258
280
class DatabaseAPI (MutableMapping [bytes , bytes ], ABC ):
259
281
@abstractmethod
260
282
def set (self , key : bytes , value : bytes ) -> None :
Original file line number Diff line number Diff line change 1
- from abc import ABC , abstractmethod
2
-
3
1
from eth_typing import (
4
2
BlockNumber ,
5
3
Hash32 ,
6
4
)
7
5
8
-
9
- class BaseSchema (ABC ):
10
- @staticmethod
11
- @abstractmethod
12
- def make_canonical_head_hash_lookup_key () -> bytes :
13
- raise NotImplementedError ('Must be implemented by subclasses' )
14
-
15
- @staticmethod
16
- @abstractmethod
17
- def make_block_number_to_hash_lookup_key (block_number : BlockNumber ) -> bytes :
18
- raise NotImplementedError ('Must be implemented by subclasses' )
19
-
20
- @staticmethod
21
- @abstractmethod
22
- def make_block_hash_to_score_lookup_key (block_hash : Hash32 ) -> bytes :
23
- raise NotImplementedError ('Must be implemented by subclasses' )
24
-
25
- @staticmethod
26
- @abstractmethod
27
- def make_transaction_hash_to_block_lookup_key (transaction_hash : Hash32 ) -> bytes :
28
- raise NotImplementedError ('Must be implemented by subclasses' )
6
+ from eth .abc import SchemaAPI
29
7
30
8
31
- class SchemaV1 (BaseSchema ):
9
+ class SchemaV1 (SchemaAPI ):
32
10
@staticmethod
33
11
def make_canonical_head_hash_lookup_key () -> bytes :
34
12
return b'v1:canonical_head_hash'
You can’t perform that action at this time.
0 commit comments