Skip to content

Commit 4b40bc2

Browse files
Move away from typing.Tuple to tuple in Python client
1 parent 6e952d8 commit 4b40bc2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

client/src/ledger_app_clients/ethereum/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import struct
22
from enum import IntEnum
3-
from typing import Optional, Tuple
3+
from typing import Optional
44
from hashlib import sha256
55
import rlp
66
from web3 import Web3
@@ -213,7 +213,7 @@ def eip712_filtering_trusted_name(self,
213213
def eip712_filtering_raw(self, name: str, sig: bytes, discarded: bool):
214214
return self._exchange_async(self._cmd_builder.eip712_filtering_raw(name, sig, discarded))
215215

216-
def serialize_tx(self, tx_params: dict, tx_raw: Optional[bytes] = None) -> Tuple[bytes, bytes]:
216+
def serialize_tx(self, tx_params: dict, tx_raw: Optional[bytes] = None) -> tuple[bytes, bytes]:
217217
"""Computes the serialized TX and its hash"""
218218

219219
if tx_raw is not None:
@@ -338,7 +338,7 @@ def provide_trusted_name_v2(self,
338338
chain_id: int,
339339
nft_id: Optional[int] = None,
340340
challenge: Optional[int] = None,
341-
not_valid_after: Optional[Tuple[int]] = None) -> RAPDU:
341+
not_valid_after: Optional[tuple[int, int, int]] = None) -> RAPDU:
342342
payload = format_tlv(FieldTag.STRUCT_VERSION, 2)
343343
payload += format_tlv(FieldTag.TRUSTED_NAME, name)
344344
payload += format_tlv(FieldTag.ADDRESS, addr)

client/src/ledger_app_clients/ethereum/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def get_selector_from_data(data: str) -> bytes:
99
return raw_data[:4]
1010

1111

12-
def recover_message(msg, vrs: tuple) -> bytes:
12+
def recover_message(msg, vrs: tuple[int, int, int]) -> bytes:
1313
if isinstance(msg, dict): # EIP-712
1414
smsg = encode_typed_data(full_message=msg)
1515
else: # EIP-191
@@ -18,7 +18,7 @@ def recover_message(msg, vrs: tuple) -> bytes:
1818
return bytes.fromhex(addr[2:])
1919

2020

21-
def recover_transaction(tx_params, vrs: tuple, raw_tx_param: Optional[bytes] = None) -> bytes:
21+
def recover_transaction(tx_params, vrs: tuple[int, int, int], raw_tx_param: Optional[bytes] = None) -> bytes:
2222
if raw_tx_param is None:
2323
raw_tx = Account.create().sign_transaction(tx_params).raw_transaction
2424
else:

0 commit comments

Comments
 (0)