fix: useless import
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from speculos.client import SpeculosClient
|
||||
|
||||
@@ -3,7 +3,6 @@ import logging
|
||||
import struct
|
||||
from typing import List, Tuple, Union, Iterator, cast
|
||||
|
||||
|
||||
from ethereum_client.transaction import PersonalTransaction, Transaction
|
||||
from ethereum_client.plugin import Plugin
|
||||
from ethereum_client.utils import bip32_path_from_string
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
from typing import Union
|
||||
|
||||
from ethereum_client.utils import (read, read_uint, read_varint,
|
||||
write_varint, UINT64_MAX)
|
||||
from ethereum_client.utils import write_varint
|
||||
|
||||
class Plugin:
|
||||
"""Plugin class
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
from io import BytesIO
|
||||
from typing import Union
|
||||
|
||||
from ethereum_client.utils import (read, read_uint, read_varint,
|
||||
write_varint, UINT64_MAX)
|
||||
from ethereum_client.utils import write_varint, UINT64_MAX
|
||||
|
||||
|
||||
class TransactionError(Exception):
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
from io import BytesIO
|
||||
from typing import List, Optional, Literal, Tuple
|
||||
import PIL.Image as Image
|
||||
|
||||
import speculos.client
|
||||
|
||||
import PIL.Image as Image
|
||||
import io
|
||||
|
||||
UINT64_MAX: int = 18446744073709551615
|
||||
UINT32_MAX: int = 4294967295
|
||||
UINT16_MAX: int = 65535
|
||||
@@ -26,13 +24,13 @@ def apdu_as_string(apdu: str) -> bytes:
|
||||
|
||||
def save_screenshot(cmd, path: str):
|
||||
screenshot = cmd.client.get_screenshot()
|
||||
img = Image.open(io.BytesIO(screenshot))
|
||||
img = Image.open(BytesIO(screenshot))
|
||||
img.save(path)
|
||||
|
||||
|
||||
def compare_screenshot(cmd, path: str):
|
||||
screenshot = cmd.client.get_screenshot()
|
||||
assert speculos.client.screenshot_equal(path, io.BytesIO(screenshot))
|
||||
assert speculos.client.screenshot_equal(path, BytesIO(screenshot))
|
||||
|
||||
|
||||
def parse_sign_response(response : bytes) -> Tuple[bytes, bytes, bytes]:
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
from time import sleep
|
||||
from ethereum_client.utils import UINT64_MAX, apdu_as_string, compare_screenshot, save_screenshot, PATH_IMG, parse_sign_response
|
||||
from ethereum_client.plugin import Plugin
|
||||
import ethereum_client
|
||||
|
||||
from ethereum_client.utils import apdu_as_string, compare_screenshot, save_screenshot, PATH_IMG, parse_sign_response
|
||||
|
||||
def test_sign_eip_1559(cmd):
|
||||
result: list = []
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from time import sleep
|
||||
import ethereum_client
|
||||
|
||||
from ethereum_client.utils import UINT64_MAX, apdu_as_string, compare_screenshot, compare_screenshot, parse_sign_response, save_screenshot, PATH_IMG
|
||||
import ethereum_client
|
||||
from ethereum_client.utils import apdu_as_string, compare_screenshot, compare_screenshot, parse_sign_response, save_screenshot, PATH_IMG
|
||||
from ethereum_client.transaction import PersonalTransaction
|
||||
|
||||
def test_personal_sign_metamask(cmd):
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
from time import sleep
|
||||
from ethereum_client.utils import UINT64_MAX, apdu_as_string, compare_screenshot, save_screenshot, PATH_IMG, parse_sign_response
|
||||
from ethereum_client.plugin import Plugin
|
||||
|
||||
import ethereum_client
|
||||
from ethereum_client.utils import apdu_as_string, compare_screenshot, save_screenshot, PATH_IMG, parse_sign_response
|
||||
from ethereum_client.plugin import Plugin
|
||||
|
||||
SIGN_FIRST = apdu_as_string("e004000096058000002c8000003c800000000000000000000000f901090b8520b673dd0082bcb394495f947276749ce646f68ac8c248420045cb7b5e80b8e4f242432a0000000000000000000000006cbcd73cd8e8a42844662f0a0e76d7f79afd933d000000000000000000000000c2907efcce4011c491bbeda8a0fa63ba7aab596cabf06640f8ca8fc5e0ed471b10befcdf65a33e4300000000")
|
||||
SIGN_MORE = apdu_as_string("e00480008b00006a0000000064000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000043078303000000000000000000000000000000000000000000000000000000000018080")
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
from time import sleep
|
||||
from ethereum_client.utils import UINT64_MAX, apdu_as_string, compare_screenshot, save_screenshot, PATH_IMG, parse_sign_response
|
||||
from ethereum_client.plugin import Plugin
|
||||
|
||||
import ethereum_client
|
||||
from ethereum_client.utils import apdu_as_string, compare_screenshot, save_screenshot, PATH_IMG, parse_sign_response
|
||||
from ethereum_client.plugin import Plugin
|
||||
|
||||
SIGN_FIRST = apdu_as_string("e004000096058000002c8000003c800000000000000000000000f88a0a852c3ce1ec008301f5679460f80121c31a0d46b5279700f9df786054aa5ee580b86442842e0e0000000000000000000000006cbcd73cd8e8a42844662f0a0e76d7f79afd933d000000000000000000000000c2907efcce4011c491bbeda8a0fa63ba7aab596c000000000000000000000000000000000000000000000000")
|
||||
SIGN_MORE = apdu_as_string("e00480000b0000000000112999018080")
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
|
||||
from cgitb import reset
|
||||
from pickle import TRUE
|
||||
from typing import Tuple
|
||||
|
||||
from time import sleep
|
||||
|
||||
import ethereum_client
|
||||
from ethereum_client.utils import UINT64_MAX, compare_screenshot, save_screenshot, PATH_IMG
|
||||
from ethereum_client.utils import compare_screenshot, save_screenshot, PATH_IMG
|
||||
|
||||
|
||||
def test_get_public_key(cmd):
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
from time import sleep
|
||||
|
||||
import ethereum_client
|
||||
|
||||
|
||||
from ethereum_client.utils import UINT64_MAX, compare_screenshot, compare_screenshot, save_screenshot, PATH_IMG
|
||||
from ethereum_client.utils import compare_screenshot, compare_screenshot, save_screenshot, PATH_IMG
|
||||
from ethereum_client.transaction import Transaction
|
||||
|
||||
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
#from warnings import catch_warnings
|
||||
#
|
||||
#import boilerplate_client
|
||||
#
|
||||
#
|
||||
#def test_version(cmd):
|
||||
# try:
|
||||
# cmd.get_version()
|
||||
# except boilerplate_client.exception.errors.InsNotSupportedError as error:
|
||||
# assert error.args[0] == '0x6d00'
|
||||
Reference in New Issue
Block a user