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

pull/1610/head
matejcik 3 years ago committed by matejcik
parent 791ac56f2f
commit 1e0a23c133

@ -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

@ -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__(

Loading…
Cancel
Save