rainbowadn/rainbowadn/chain/chaincollectioninterface.py

29 lines
632 B
Python

import abc
from typing import Generic, TypeVar
from rainbowadn.core import *
from .blockcollectioninterface import *
__all__ = ('ChainCollectionInterface',)
BlockType = TypeVar('BlockType')
HeaderType = TypeVar('HeaderType')
class ChainCollectionInterface(
BlockCollectionInterface[
BlockType,
HeaderType
],
Generic[BlockType, HeaderType],
abc.ABC
):
async def add(
self,
header: HashPoint[HeaderType]
) -> 'ChainCollectionInterface[BlockType, HeaderType]':
raise NotImplementedError
async def verify(self) -> bool:
raise NotImplementedError