|
| 1 | +from __future__ import annotations |
| 2 | + |
| 3 | +from typing import Optional, Protocol |
| 4 | + |
| 5 | +from chia_rs import BlockRecord, FullBlock, SubEpochChallengeSegment |
| 6 | +from chia_rs.sized_bytes import bytes32 |
| 7 | +from chia_rs.sized_ints import uint32 |
| 8 | + |
| 9 | +from chia.full_node.full_block_utils import GeneratorBlockInfo |
| 10 | + |
| 11 | + |
| 12 | +class BlockStoreProtocol(Protocol): |
| 13 | + async def add_full_block(self, header_hash: bytes32, block: FullBlock, block_record: BlockRecord) -> None: ... |
| 14 | + |
| 15 | + async def get_full_block(self, header_hash: bytes32) -> Optional[FullBlock]: ... |
| 16 | + |
| 17 | + async def get_full_block_bytes(self, header_hash: bytes32) -> Optional[bytes]: ... |
| 18 | + |
| 19 | + async def get_full_blocks_at(self, heights: list[uint32]) -> list[FullBlock]: ... |
| 20 | + |
| 21 | + async def get_block_info(self, header_hash: bytes32) -> Optional[GeneratorBlockInfo]: ... |
| 22 | + |
| 23 | + async def get_generator(self, header_hash: bytes32) -> Optional[bytes]: ... |
| 24 | + |
| 25 | + async def get_generators_at(self, heights: set[uint32]) -> dict[uint32, bytes]: ... |
| 26 | + |
| 27 | + async def get_block_record(self, header_hash: bytes32) -> Optional[BlockRecord]: ... |
| 28 | + |
| 29 | + async def get_block_records_in_range( |
| 30 | + self, |
| 31 | + start: int, |
| 32 | + stop: int, |
| 33 | + ) -> dict[bytes32, BlockRecord]: ... |
| 34 | + |
| 35 | + async def get_block_records_by_hash(self, header_hashes: list[bytes32]) -> list[BlockRecord]: ... |
| 36 | + |
| 37 | + async def get_block_bytes_by_hash(self, header_hashes: list[bytes32]) -> list[bytes]: ... |
| 38 | + |
| 39 | + async def get_blocks_by_hash(self, header_hashes: list[bytes32]) -> list[FullBlock]: ... |
| 40 | + |
| 41 | + async def get_peak(self) -> Optional[tuple[bytes32, uint32]]: ... |
| 42 | + |
| 43 | + async def get_block_bytes_in_range( |
| 44 | + self, |
| 45 | + start: int, |
| 46 | + stop: int, |
| 47 | + ) -> list[bytes]: ... |
| 48 | + |
| 49 | + async def get_random_not_compactified(self, number: int) -> list[int]: ... |
| 50 | + |
| 51 | + async def persist_sub_epoch_challenge_segments( |
| 52 | + self, ses_block_hash: bytes32, segments: list[SubEpochChallengeSegment] |
| 53 | + ) -> None: ... |
| 54 | + |
| 55 | + async def get_sub_epoch_challenge_segments( |
| 56 | + self, |
| 57 | + ses_block_hash: bytes32, |
| 58 | + ) -> Optional[list[SubEpochChallengeSegment]]: ... |
| 59 | + |
| 60 | + async def rollback(self, height: int) -> None: ... |
| 61 | + |
| 62 | + async def set_in_chain(self, header_hashes: list[tuple[bytes32]]) -> None: ... |
| 63 | + |
| 64 | + async def set_peak(self, header_hash: bytes32) -> None: ... |
| 65 | + |
| 66 | + async def is_fully_compactified(self, header_hash: bytes32) -> Optional[bool]: ... |
| 67 | + |
| 68 | + async def replace_proof(self, header_hash: bytes32, block: FullBlock) -> None: ... |
| 69 | + |
| 70 | + async def count_compactified_blocks(self) -> int: ... |
| 71 | + |
| 72 | + async def count_uncompactified_blocks(self) -> int: ... |
0 commit comments