Skip to content

Commit

Permalink
Update and modify files for the project
Browse files Browse the repository at this point in the history
- Added new files:
  - tests/unit/test_bee_debug.py
- Updated files:
  - src/bee_py/bee.py
  - src/bee_py/bee_debug.py
  - src/bee_py/modules/debug/stamps.py
  - src/bee_py/modules/debug/states.py
  - src/bee_py/modules/debug/transactions.py
  - src/bee_py/utils/type.py
  - tests/unit/test_bee.py
  • Loading branch information
Aviksaikat committed Dec 28, 2023
1 parent a6dcd5a commit 5f8d502
Show file tree
Hide file tree
Showing 8 changed files with 1,243 additions and 25 deletions.
13 changes: 8 additions & 5 deletions src/bee_py/bee.py
Original file line number Diff line number Diff line change
Expand Up @@ -1448,8 +1448,10 @@ def make_soc_writer(
assert_request_options(options)

canonical_signer = self.__resolve_signer(signer)
if isinstance(canonical_signer, Signer):
canonical_signer = Signer.singer # type: ignore[attr-defined]

reader = self.make_soc_reader(canonical_signer.address, options)
reader = self.make_soc_reader(canonical_signer.address, options) # type: ignore[attr-defined]

def __upload(postage_batch_id: Union[str, BatchId], identifier: Identifier, data: bytes):
return upload_single_owner_chunk_data(
Expand All @@ -1463,7 +1465,7 @@ def __upload(postage_batch_id: Union[str, BatchId], identifier: Identifier, data
# TODO: Look into it
return SOCWriter(owner=reader.owner, download=reader.download, upload=__upload)

def check_connection(self, options: Optional[BeeRequestOptions] = None) -> bool:
def check_connection(self, options: Optional[BeeRequestOptions] = None) -> None:
"""
Pings the Bee node to see if there's a live Bee node on the URL provided.
Expand All @@ -1478,7 +1480,7 @@ def check_connection(self, options: Optional[BeeRequestOptions] = None) -> bool:
"""
assert_request_options(options)

return status_api.check_connection(self.__get_request_options_for_call(options))
status_api.check_connection(self.__get_request_options_for_call(options))

def is_connected(self, options: Optional[BeeRequestOptions] = None) -> bool:
"""
Expand All @@ -1494,5 +1496,6 @@ def is_connected(self, options: Optional[BeeRequestOptions] = None) -> bool:

try:
status_api.check_connection(self.__get_request_options_for_call(options))
except HTTPError as e:
raise HTTPError() from e
except HTTPError:
return False
return True
Loading

0 comments on commit 5f8d502

Please sign in to comment.