1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-23 23:08:14 +00:00

fix(core/paths): make sure containers are copied along with the numbers they contain

This commit is contained in:
matejcik 2021-05-05 12:27:21 +02:00 committed by matejcik
parent 791ac56f2f
commit 1e0a23c133
2 changed files with 6 additions and 4 deletions

View File

@ -22,7 +22,7 @@ hardware core regular device test:
- core fw regular debug build
variables:
PYTEST_TIMEOUT: "1200"
TESTS_SKIP: "-k 'not 15_of_15 and not signtx_bgold and not send_bch_multisig_change'"
TESTS_SKIP: "-k 'not 15_of_15'"
script:
- cd ci/hardware_tests
- set -a

View File

@ -108,12 +108,14 @@ class PathSchema:
@staticmethod
def _copy_container(container: Container[int]) -> Container[int]:
# On hardware, hardened indices do not fit into smallint.
# The n+0 operation ensures that a new instance of a longint is created.
if isinstance(container, Interval):
return Interval(container.min, container.max)
return Interval(container.min + 0, container.max + 0)
if isinstance(container, set):
return set(container)
return set(i + 0 for i in container)
if isinstance(container, tuple):
return container[:]
return tuple(i + 0 for i in container)
raise RuntimeError("Unsupported container for copy")
def __init__(