1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
from abc import (
ABC,
abstractmethod,
)
from typing import (
Union,
)
class PreImageAPI(ABC):
@abstractmethod
def __init__(self, value: bytes) -> None:
...
@abstractmethod
def update(self, value: bytes) -> None:
...
@abstractmethod
def digest(self) -> bytes:
...
@abstractmethod
def copy(self) -> "PreImageAPI":
...
class BackendAPI(ABC):
@abstractmethod
def keccak256(self, in_data: Union[bytearray, bytes]) -> bytes:
...
@abstractmethod
def preimage(self, in_data: Union[bytearray, bytes]) -> PreImageAPI:
...
|