Skip to content

Commit

Permalink
fix flake8 problems
Browse files Browse the repository at this point in the history
  • Loading branch information
MHHukiewitz committed Aug 12, 2023
1 parent 50b0b87 commit 2076a09
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions tests/unit/test_chain_ethereum.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ async def test_ETHAccount(ethereum_account):

address = account.get_address()
assert address
assert type(address) == str
assert isinstance(address, str)
assert len(address) == 42

pubkey = account.get_public_key()
assert type(pubkey) == str
assert isinstance(pubkey, str)
assert len(pubkey) == 68


Expand Down Expand Up @@ -111,9 +111,9 @@ async def test_decrypt_secp256k1(ethereum_account):
content = b"SomeContent"

encrypted = await account.encrypt(content)
assert type(encrypted) == bytes
assert isinstance(encrypted, bytes)
decrypted = await account.decrypt(encrypted)
assert type(decrypted) == bytes
assert isinstance(decrypted, bytes)
assert content == decrypted


Expand Down
10 changes: 5 additions & 5 deletions tests/unit/test_chain_nuls1.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ async def test_sign_data():
)

assert sign
assert type(sign.pub_key) == bytes
assert type(sign.digest_bytes) == bytes
assert type(sign.sig_ser) == bytes
assert isinstance(sign.pub_key, bytes)
assert isinstance(sign.digest_bytes, bytes)
assert isinstance(sign.sig_ser, bytes)
assert sign.ecc_type is None


Expand All @@ -37,9 +37,9 @@ async def test_sign_message():
assert len(sign.sig_ser) == 70

assert sign
assert type(sign.pub_key) == bytes
assert isinstance(sign.pub_key, bytes)
assert sign.digest_bytes is None
assert type(sign.sig_ser) == bytes
assert isinstance(sign.sig_ser, bytes)
assert sign.ecc_type is None


Expand Down
14 changes: 7 additions & 7 deletions tests/unit/test_chain_solana.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def test_get_fallback_account():
assert account.CHAIN == "SOL"
assert account.CURVE == "curve25519"
assert account._signing_key.verify_key
assert type(account.private_key) == bytes
assert isinstance(account._signing_key.verify_key, VerifyKey)
assert len(account.private_key) == 32


Expand All @@ -42,12 +42,12 @@ async def test_SOLAccount(solana_account):

address = message["sender"]
assert address
assert type(address) == str
assert isinstance(address, str)
# assert len(address) == 44 # can also be 43?
signature = json.loads(message["signature"])

pubkey = base58.b58decode(signature["publicKey"])
assert type(pubkey) == bytes
assert isinstance(pubkey, bytes)
assert len(pubkey) == 32

verify_key = VerifyKey(pubkey)
Expand All @@ -61,7 +61,7 @@ async def test_SOLAccount(solana_account):
assert message["sender"] == signature["publicKey"]

pubkey = solana_account.get_public_key()
assert type(pubkey) == str
assert isinstance(pubkey, str)
assert len(pubkey) == 64


Expand All @@ -71,9 +71,9 @@ async def test_decrypt_curve25516(solana_account):
content = b"SomeContent"

encrypted = await solana_account.encrypt(content)
assert type(encrypted) == bytes
assert isinstance(encrypted, bytes)
decrypted = await solana_account.decrypt(encrypted)
assert type(decrypted) == bytes
assert isinstance(decrypted, bytes)
assert content == decrypted


Expand All @@ -90,7 +90,7 @@ async def test_verify_signature(solana_account):
await solana_account.sign_message(message)
assert message["signature"]
raw_signature = json.loads(message["signature"])["signature"]
assert type(raw_signature) == str
assert isinstance(raw_signature, str)

verify_signature(raw_signature, message["sender"], get_verification_buffer(message))

Expand Down

0 comments on commit 2076a09

Please sign in to comment.