File: abc.py

package info (click to toggle)
python-eth-hash 0.7.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 308 kB
  • sloc: python: 659; makefile: 233
file content (35 lines) | stat: -rw-r--r-- 629 bytes parent folder | download | duplicates (2)
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:
        ...