From 545d45299a0b7feefaffd14f791d5d1c84c04e0e Mon Sep 17 00:00:00 2001 From: Jonathan Zernik Date: Thu, 7 Oct 2021 20:06:31 -0700 Subject: [PATCH] Add docstrings for bitcoin client class (#1534) --- squeaknode/bitcoin/bitcoin_client.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/squeaknode/bitcoin/bitcoin_client.py b/squeaknode/bitcoin/bitcoin_client.py index 91a4555c..25ca03ff 100644 --- a/squeaknode/bitcoin/bitcoin_client.py +++ b/squeaknode/bitcoin/bitcoin_client.py @@ -32,16 +32,22 @@ class BitcoinClient(ABC): @abstractmethod def get_best_block_info(self) -> BlockInfo: - pass + """Get block info for the latest Bitcoin block. + + Returns: + BlockInfo: an object containing height, hash, and header. + + Raises: + BitcoinRequestError: If the request fails. + """ @abstractmethod def get_block_info_by_height(self, block_height: int) -> BlockInfo: - pass + """Get block info for the Bitcoin block at the given height. - @abstractmethod - def get_block_hash(self, block_height: int) -> bytes: - pass + Returns: + BlockInfo: an object containing height, hash, and header. - @abstractmethod - def get_block_header(self, block_hash: bytes, verbose: bool) -> bytes: - pass + Raises: + BitcoinRequestError: If the request fails. + """