Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix issue with python linter #132

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions tests/application_client/boilerplate_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,20 @@ def __init__(self,
nonce: int,
to: Union[str, bytes],
value: int,
memo: str,
do_check: bool = True) -> None:
memo: str) -> None:
self.nonce: int = nonce
self.to: bytes = bytes.fromhex(to[2:]) if isinstance(to, str) else to
self.value: int = value
self.memo: bytes = memo.encode("ascii")

if do_check:
if not 0 <= self.nonce <= UINT64_MAX:
raise TransactionError(f"Bad nonce: '{self.nonce}'!")
if not 0 <= self.nonce <= UINT64_MAX:
raise TransactionError(f"Bad nonce: '{self.nonce}'!")

if not 0 <= self.value <= UINT64_MAX:
raise TransactionError(f"Bad value: '{self.value}'!")
if not 0 <= self.value <= UINT64_MAX:
raise TransactionError(f"Bad value: '{self.value}'!")

if len(self.to) != 20:
raise TransactionError(f"Bad address: '{self.to.hex()}'!")
if len(self.to) != 20:
raise TransactionError(f"Bad address: '{self.to.hex()}'!")

def serialize(self) -> bytes:
return b"".join([
Expand Down
4 changes: 3 additions & 1 deletion tests/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ disable = C0114, # missing-module-docstring
C0116, # missing-function-docstring
C0103, # invalid-name
R0801, # duplicate-code
R0913 # too-many-arguments
R0913, # too-many-arguments
R0917 # too-many-positional-arguments

max-line-length=100
extension-pkg-whitelist=hid

Expand Down
Loading