|
|
@ -161,6 +161,8 @@ class TestMsgApplysettings:
|
|
|
|
def test_safety_checks(self, client):
|
|
|
|
def test_safety_checks(self, client):
|
|
|
|
BAD_ADDRESS = parse_path("m/0")
|
|
|
|
BAD_ADDRESS = parse_path("m/0")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assert client.features.safety_checks == messages.SafetyCheckLevel.Strict
|
|
|
|
|
|
|
|
|
|
|
|
with pytest.raises(
|
|
|
|
with pytest.raises(
|
|
|
|
exceptions.TrezorFailure, match="Forbidden key path"
|
|
|
|
exceptions.TrezorFailure, match="Forbidden key path"
|
|
|
|
), client:
|
|
|
|
), client:
|
|
|
@ -173,6 +175,8 @@ class TestMsgApplysettings:
|
|
|
|
client, safety_checks=messages.SafetyCheckLevel.Prompt
|
|
|
|
client, safety_checks=messages.SafetyCheckLevel.Prompt
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assert client.features.safety_checks == messages.SafetyCheckLevel.Prompt
|
|
|
|
|
|
|
|
|
|
|
|
with client:
|
|
|
|
with client:
|
|
|
|
client.set_expected_responses(
|
|
|
|
client.set_expected_responses(
|
|
|
|
[messages.ButtonRequest(), messages.Address()]
|
|
|
|
[messages.ButtonRequest(), messages.Address()]
|
|
|
@ -185,6 +189,8 @@ class TestMsgApplysettings:
|
|
|
|
client, safety_checks=messages.SafetyCheckLevel.Strict
|
|
|
|
client, safety_checks=messages.SafetyCheckLevel.Strict
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assert client.features.safety_checks == messages.SafetyCheckLevel.Strict
|
|
|
|
|
|
|
|
|
|
|
|
with pytest.raises(
|
|
|
|
with pytest.raises(
|
|
|
|
exceptions.TrezorFailure, match="Forbidden key path"
|
|
|
|
exceptions.TrezorFailure, match="Forbidden key path"
|
|
|
|
), client:
|
|
|
|
), client:
|
|
|
|