mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-29 02:48:18 +00:00
fix cardano final part
This commit is contained in:
parent
384ef422fe
commit
c1a2ea8fe0
@ -1163,6 +1163,7 @@ class SessionDebugWrapper(Session):
|
||||
self.button_callback = self.client.button_callback
|
||||
self.pin_callback = self.client.pin_callback
|
||||
self.passphrase_callback = self._session.passphrase_callback
|
||||
self.passphrase = self._session.passphrase
|
||||
|
||||
def __enter__(self) -> "SessionDebugWrapper":
|
||||
# For usage in with/expected_responses
|
||||
|
@ -96,7 +96,7 @@ class Session:
|
||||
class SessionV1(Session):
|
||||
@classmethod
|
||||
def new(
|
||||
cls, client: TrezorClient, passphrase: str | None, derive_cardano: bool
|
||||
cls, client: TrezorClient, passphrase: str = "", derive_cardano: bool = False
|
||||
) -> SessionV1:
|
||||
assert isinstance(client.protocol, ProtocolV1)
|
||||
session_id = client.features.session_id
|
||||
@ -108,6 +108,7 @@ class SessionV1(Session):
|
||||
session.button_callback = client.button_callback
|
||||
session.pin_callback = client.pin_callback
|
||||
session.passphrase_callback = _callback_passphrase
|
||||
session.passphrase = passphrase
|
||||
session._init_session(derive_cardano=derive_cardano)
|
||||
return session
|
||||
|
||||
@ -132,7 +133,7 @@ def _callback_button(session: Session, msg: t.Any) -> t.Any:
|
||||
|
||||
|
||||
def _callback_passphrase(session: Session, msg: messages.PassphraseRequest) -> t.Any:
|
||||
available_on_device = Capability.PassphraseEntry in Session.features.capabilities
|
||||
available_on_device = Capability.PassphraseEntry in session.features.capabilities
|
||||
def send_passphrase(
|
||||
passphrase: str | None = None, on_device: bool | None = None
|
||||
) -> t.Any:
|
||||
|
@ -96,7 +96,7 @@ def test_cardano_get_address(session: Session, chunkify: bool, parameters, resul
|
||||
)
|
||||
def test_cardano_get_public_key(session: Session, parameters, result):
|
||||
with session, session.client as client:
|
||||
IF = InputFlowShowXpubQRCode(client, passphrase=False)
|
||||
IF = InputFlowShowXpubQRCode(client, passphrase=bool(session.passphrase))
|
||||
client.set_input_flow(IF.get())
|
||||
# session.init_device(new_session=True, derive_cardano=True)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user