@@ -92,10 +92,6 @@ def get_canonical_block_by_slot(self,
92
92
block_class : Type [BaseBeaconBlock ]) -> BaseBeaconBlock :
93
93
pass
94
94
95
- @abstractmethod
96
- def get_canonical_block_root_by_slot (self , slot : int ) -> Hash32 :
97
- pass
98
-
99
95
@abstractmethod
100
96
def get_canonical_head (self , block_class : Type [BaseBeaconBlock ]) -> BaseBeaconBlock :
101
97
pass
@@ -263,26 +259,9 @@ def _get_canonical_block_by_slot(
263
259
db : BaseDB ,
264
260
slot : int ,
265
261
block_class : Type [BaseBeaconBlock ]) -> BaseBeaconBlock :
266
- canonical_block_root = cls ._get_canonical_block_root_by_slot (db , slot )
262
+ canonical_block_root = cls ._get_canonical_block_root (db , slot )
267
263
return cls ._get_block_by_root (db , canonical_block_root , block_class )
268
264
269
- def get_canonical_block_root_by_slot (self , slot : int ) -> Hash32 :
270
- """
271
- Return the block root with the given slot in the canonical chain.
272
-
273
- Raise BlockNotFound if there's no block with the given slot in the
274
- canonical chain.
275
- """
276
- return self ._get_canonical_block_root_by_slot (self .db , slot )
277
-
278
- @classmethod
279
- def _get_canonical_block_root_by_slot (
280
- cls ,
281
- db : BaseDB ,
282
- slot : int ) -> Hash32 :
283
- validate_slot (slot )
284
- return cls ._get_canonical_block_root (db , slot )
285
-
286
265
def get_canonical_head (self , block_class : Type [BaseBeaconBlock ]) -> BaseBeaconBlock :
287
266
"""
288
267
Return the current block at the head of the chain.
@@ -323,8 +302,8 @@ def _get_finalized_head(cls,
323
302
finalized_head_root = cls ._get_finalized_head_root (db )
324
303
return cls ._get_block_by_root (db , Hash32 (finalized_head_root ), block_class )
325
304
326
- @classmethod
327
- def _get_finalized_head_root (cls , db : BaseDB ) -> Hash32 :
305
+ @staticmethod
306
+ def _get_finalized_head_root (db : BaseDB ) -> Hash32 :
328
307
try :
329
308
finalized_head_root = db [SchemaV1 .make_finalized_head_root_lookup_key ()]
330
309
except KeyError :
@@ -344,8 +323,8 @@ def _get_justified_head(cls,
344
323
justified_head_root = cls ._get_justified_head_root (db )
345
324
return cls ._get_block_by_root (db , Hash32 (justified_head_root ), block_class )
346
325
347
- @classmethod
348
- def _get_justified_head_root (cls , db : BaseDB ) -> Hash32 :
326
+ @staticmethod
327
+ def _get_justified_head_root (db : BaseDB ) -> Hash32 :
349
328
try :
350
329
justified_head_root = db [SchemaV1 .make_justified_head_root_lookup_key ()]
351
330
except KeyError :
@@ -426,9 +405,8 @@ def persist_block_chain(
426
405
with self .db .atomic_batch () as db :
427
406
return self ._persist_block_chain (db , blocks , block_class )
428
407
429
- @classmethod
408
+ @staticmethod
430
409
def _set_block_scores_to_db (
431
- cls ,
432
410
db : BaseDB ,
433
411
block : BaseBeaconBlock
434
412
) -> int :
0 commit comments