fix: test nft and rm useless screenshot

This commit is contained in:
Coline
2022-06-29 10:22:06 +02:00
parent 8a47d4ecea
commit 4850ee083e
21 changed files with 24 additions and 100 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 414 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 328 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 710 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 457 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 823 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 792 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 558 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 312 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 472 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 414 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 328 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 710 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 457 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 770 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 463 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 472 B

View File

@@ -1,10 +1,10 @@
def test_configuration(cmd):
if cmd.model == "nanos":
assert cmd.get_configuration() == (14, 1, 9, 17)
assert cmd.get_configuration() == (14, 1, 9, 20)
if cmd.model == "nanox":
assert cmd.get_configuration() == (14, 1, 9, 17)
assert cmd.get_configuration() == (14, 1, 9, 20)
if cmd.model == "nanosp":
assert cmd.get_configuration() == (14, 1, 9, 17)
assert cmd.get_configuration() == (14, 1, 9, 20)

View File

@@ -91,57 +91,17 @@ def test_transfer_erc1155_without_nft_provide_info(cmd):
result: list = []
if cmd.model == "nanox" or cmd.model == "nanosp":
cmd.set_plugin(plugin=PLUGIN)
cmd.send_apdu(SIGN_FIRST)
try:
cmd.set_plugin(plugin=PLUGIN)
with cmd.send_apdu_context(SIGN_MORE, result) as ex:
sleep(0.5)
# Review transaction
compare_screenshot(cmd, f"screenshots/erc1155/{PATH_IMG[cmd.model]}/transfer_erc1155_without_nft_provide_info/00000.png")
cmd.client.press_and_release('right')
# NFT Transfert
compare_screenshot(cmd, f"screenshots/erc1155/{PATH_IMG[cmd.model]}/transfer_erc1155_without_nft_provide_info/00001.png")
cmd.client.press_and_release('right')
cmd.send_apdu(SIGN_FIRST)
# To
compare_screenshot(cmd, f"screenshots/erc1155/{PATH_IMG[cmd.model]}/transfer_erc1155_without_nft_provide_info/00002.png")
cmd.client.press_and_release('right')
# Collection Name
compare_screenshot(cmd, f"screenshots/erc1155/{PATH_IMG[cmd.model]}/transfer_erc1155_without_nft_provide_info/00003.png")
cmd.client.press_and_release('right')
# NFT Address
compare_screenshot(cmd, f"screenshots/erc1155/{PATH_IMG[cmd.model]}/transfer_erc1155_without_nft_provide_info/00004.png")
cmd.client.press_and_release('right')
# NFT ID 1/2, 2/2
compare_screenshot(cmd, f"screenshots/erc1155/{PATH_IMG[cmd.model]}/transfer_erc1155_without_nft_provide_info/00005.png")
cmd.client.press_and_release('right')
compare_screenshot(cmd, f"screenshots/erc1155/{PATH_IMG[cmd.model]}/transfer_erc1155_without_nft_provide_info/00006.png")
cmd.client.press_and_release('right')
# Quantity
compare_screenshot(cmd, f"screenshots/erc1155/{PATH_IMG[cmd.model]}/transfer_erc1155_without_nft_provide_info/00007.png")
cmd.client.press_and_release('right')
# Max Fees
compare_screenshot(cmd, f"screenshots/erc1155/{PATH_IMG[cmd.model]}/transfer_erc1155_without_nft_provide_info/00008.png")
cmd.client.press_and_release('right')
# Accept and send
compare_screenshot(cmd, f"screenshots/erc1155/{PATH_IMG[cmd.model]}/transfer_erc1155_without_nft_provide_info/00009.png")
cmd.client.press_and_release('both')
response: bytes = result[0]
v, r, s = parse_sign_response(response)
assert v == 0x25 # 37
assert r.hex() == "ab3eca1a0b5c66bfe603252037682a024a12f92d799b4d74993a8bf4221bbe7d"
assert s.hex() == "24de0c0598d1d8e5ea99b75fa26105478f45f43b510e504fc1b14f07fe7dda2a"
with cmd.send_apdu_context(SIGN_MORE, result) as ex:
pass
except ethereum_client.exception.errors.UnknownDeviceError as error:
assert error.args[0] == '0x6a80'
def test_transfer_erc1155_without_set_plugin(cmd):
@@ -156,5 +116,5 @@ def test_transfer_erc1155_without_set_plugin(cmd):
with cmd.send_apdu_context(SIGN_MORE, result) as ex:
pass
except ethereum_client.exception.errors.UnknownDeviceError as error:
assert error.args[0] == '0x6a80'
except ethereum_client.exception.errors.DenyError as error:
assert error.args[0] == '0x6985'

View File

@@ -84,52 +84,16 @@ def test_transfer_erc721_without_nft_provide_info(cmd):
result: list = []
if cmd.model == "nanox" or cmd.model == "nanosp":
cmd.set_plugin(plugin=PLUGIN)
cmd.send_apdu(SIGN_FIRST)
try:
cmd.set_plugin(plugin=PLUGIN)
with cmd.send_apdu_context(SIGN_MORE, result) as ex:
sleep(0.5)
# Review transaction
compare_screenshot(cmd, f"screenshots/erc721/{PATH_IMG[cmd.model]}/transfer_erc721_without_nft_provide_info/00000.png")
cmd.client.press_and_release('right')
# NFT Transfer
compare_screenshot(cmd, f"screenshots/erc721/{PATH_IMG[cmd.model]}/transfer_erc721_without_nft_provide_info/00001.png")
cmd.client.press_and_release('right')
# To
compare_screenshot(cmd, f"screenshots/erc721/{PATH_IMG[cmd.model]}/transfer_erc721_without_nft_provide_info/00002.png")
cmd.client.press_and_release('right')
# Collection Name
compare_screenshot(cmd, f"screenshots/erc721/{PATH_IMG[cmd.model]}/transfer_erc721_without_nft_provide_info/00003.png")
cmd.client.press_and_release('right')
# NFT Address
compare_screenshot(cmd, f"screenshots/erc721/{PATH_IMG[cmd.model]}/transfer_erc721_without_nft_provide_info/00004.png")
cmd.client.press_and_release('right')
# NFT ID
compare_screenshot(cmd, f"screenshots/erc721/{PATH_IMG[cmd.model]}/transfer_erc721_without_nft_provide_info/00005.png")
cmd.client.press_and_release('right')
# Max Fees
compare_screenshot(cmd, f"screenshots/erc721/{PATH_IMG[cmd.model]}/transfer_erc721_without_nft_provide_info/00006.png")
cmd.client.press_and_release('right')
# Accept and send
compare_screenshot(cmd, f"screenshots/erc721/{PATH_IMG[cmd.model]}/transfer_erc721_without_nft_provide_info/00007.png")
cmd.client.press_and_release('both')
response: bytes = result[0]
v, r, s = parse_sign_response(response)
assert v == 0x25 # 37
assert r.hex() == "68ba082523584adbfc31d36d68b51d6f209ce0838215026bf1802a8f17dcdff4"
assert s.hex() == "7c92908fa05c8bc86507a3d6a1c8b3c2722ee01c836d89a61df60c1ab0b43fff"
cmd.send_apdu(SIGN_FIRST)
with cmd.send_apdu_context(SIGN_MORE, result) as ex:
pass
except ethereum_client.exception.errors.UnknownDeviceError as error:
assert error.args[0] == '0x6a80'
def test_transfer_erc721_without_set_plugin(cmd):
@@ -144,5 +108,5 @@ def test_transfer_erc721_without_set_plugin(cmd):
with cmd.send_apdu_context(SIGN_MORE, result) as ex:
pass
except ethereum_client.exception.errors.UnknownDeviceError as error:
assert error.args[0] == '0x6a80'
except ethereum_client.exception.errors.DenyError as error:
assert error.args[0] == '0x6985'