Skip to content

Commit

Permalink
fix issue with python linter
Browse files Browse the repository at this point in the history
  • Loading branch information
tdejoigny-ledger committed Oct 4, 2024
1 parent f1ff5e2 commit 7d03372
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
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

0 comments on commit 7d03372

Please sign in to comment.