Small refactoring : renamed the Ragger client

This commit is contained in:
Alexandre Paillier
2023-02-27 18:15:41 +01:00
parent be3aa9f1ba
commit 25b57bb830
8 changed files with 50 additions and 50 deletions

View File

@@ -2,17 +2,17 @@ import pytest
import os
import fnmatch
from typing import List
from ethereum_client.client import EthereumClient, SettingType
from app.client import EthereumClient, SettingType
from eip712 import InputData
from pathlib import Path
from configparser import ConfigParser
bip32 = [
0x8000002c,
0x8000003c,
0x80000000,
bip32_path = [
44,
60,
0,
0
None,
None
]
@@ -38,7 +38,7 @@ def filtering(request) -> bool:
def test_eip712_legacy(app_client: EthereumClient):
v, r, s = app_client.eip712_sign_legacy(
bip32,
bip32_path,
bytes.fromhex('6137beb405d9ff777172aa879e33edb34a1460e701802746c5ef96e741710e59'),
bytes.fromhex('eb4221181ff3f1a83ea7313993ca9218496e424604ba9492bb4052c03d5c3df8')
)
@@ -47,10 +47,10 @@ def test_eip712_legacy(app_client: EthereumClient):
assert r == bytes.fromhex("ea66f747173762715751c889fea8722acac3fc35db2c226d37a2e58815398f64")
assert s == bytes.fromhex("52d8ba9153de9255da220ffd36762c0b027701a3b5110f0a765f94b16a9dfb55")
def test_eip712_new(app_client: EthereumClient, input_file: Path, verbose: bool, filtering: bool):
print("=====> %s" % (input_file))
if app_client._client.firmware.device != "nanos":
if app_client._client.firmware.device == "nanos":
pytest.skip("Not supported on LNS")
else:
test_path = "%s/%s" % (input_file.parent, "-".join(input_file.stem.split("-")[:-1]))
conf_file = "%s.ini" % (test_path)
filter_file = None
@@ -74,7 +74,7 @@ def test_eip712_new(app_client: EthereumClient, input_file: Path, verbose: bool,
})
assert InputData.process_file(app_client, input_file, filter_file) == True
v, r, s = app_client.eip712_sign_new(bip32)
v, r, s = app_client.eip712_sign_new(bip32_path)
#print("[signature]")
#print("v = %s" % (v.hex()))
#print("r = %s" % (r.hex()))
@@ -84,6 +84,4 @@ def test_eip712_new(app_client: EthereumClient, input_file: Path, verbose: bool,
assert r == bytes.fromhex(config["signature"]["r"])
assert s == bytes.fromhex(config["signature"]["s"])
else:
print("No filter file found, skipping...")
else:
print("Not supported by LNS, skipping...")
pytest.skip("No filter file found")