mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-24 23:38:09 +00:00
fix(core/paths): make sure containers are copied along with the numbers they contain
This commit is contained in:
parent
791ac56f2f
commit
1e0a23c133
@ -22,7 +22,7 @@ hardware core regular device test:
|
|||||||
- core fw regular debug build
|
- core fw regular debug build
|
||||||
variables:
|
variables:
|
||||||
PYTEST_TIMEOUT: "1200"
|
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:
|
script:
|
||||||
- cd ci/hardware_tests
|
- cd ci/hardware_tests
|
||||||
- set -a
|
- set -a
|
||||||
|
@ -108,12 +108,14 @@ class PathSchema:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _copy_container(container: Container[int]) -> Container[int]:
|
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):
|
if isinstance(container, Interval):
|
||||||
return Interval(container.min, container.max)
|
return Interval(container.min + 0, container.max + 0)
|
||||||
if isinstance(container, set):
|
if isinstance(container, set):
|
||||||
return set(container)
|
return set(i + 0 for i in container)
|
||||||
if isinstance(container, tuple):
|
if isinstance(container, tuple):
|
||||||
return container[:]
|
return tuple(i + 0 for i in container)
|
||||||
raise RuntimeError("Unsupported container for copy")
|
raise RuntimeError("Unsupported container for copy")
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
|
Loading…
Reference in New Issue
Block a user