1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-14 03:30:02 +00:00

tests: update solana tests

[no changelog]
This commit is contained in:
M1nd3r 2024-10-04 23:31:28 +02:00
parent bf3ae466b9
commit dc95505839
3 changed files with 9 additions and 11 deletions

View File

@ -16,7 +16,7 @@
import pytest
from trezorlib.debuglink import TrezorClientDebugLink as Client
from trezorlib.debuglink import SessionDebugWrapper as Session
from trezorlib.solana import get_address
from trezorlib.tools import parse_path
@ -32,9 +32,9 @@ pytestmark = [
@parametrize_using_common_fixtures(
"solana/get_address.json",
)
def test_solana_get_address(client: Client, parameters, result):
def test_solana_get_address(session: Session, parameters, result):
actual_result = get_address(
client, address_n=parse_path(parameters["path"]), show_display=True
session, address_n=parse_path(parameters["path"]), show_display=True
)
assert actual_result.address == result["expected_address"]

View File

@ -16,7 +16,7 @@
import pytest
from trezorlib.debuglink import TrezorClientDebugLink as Client
from trezorlib.debuglink import SessionDebugWrapper as Session
from trezorlib.solana import get_public_key
from trezorlib.tools import parse_path
@ -32,9 +32,9 @@ pytestmark = [
@parametrize_using_common_fixtures(
"solana/get_public_key.json",
)
def test_solana_get_public_key(client: Client, parameters, result):
def test_solana_get_public_key(session: Session, parameters, result):
actual_result = get_public_key(
client, address_n=parse_path(parameters["path"]), show_display=True
session, address_n=parse_path(parameters["path"]), show_display=True
)
assert actual_result.public_key.hex() == result["expected_public_key"]

View File

@ -17,7 +17,7 @@
import pytest
from trezorlib import messages
from trezorlib.debuglink import TrezorClientDebugLink as Client
from trezorlib.debuglink import SessionDebugWrapper as Session
from trezorlib.solana import sign_tx
from trezorlib.tools import parse_path
@ -42,13 +42,11 @@ pytestmark = [
"solana/sign_tx.unknown_instructions.json",
"solana/sign_tx.predefined_transactions.json",
)
def test_solana_sign_tx(client: Client, parameters, result):
client.init_device(new_session=True)
def test_solana_sign_tx(session: Session, parameters, result):
serialized_tx = _serialize_tx(parameters["construct"])
actual_result = sign_tx(
client,
session,
address_n=parse_path(parameters["address"]),
serialized_tx=serialized_tx,
additional_info=(