1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-09 06:50:58 +00:00

cardano: add high-level support for passhrase

This commit is contained in:
Pavol Rusnak 2018-10-26 12:16:56 +02:00
parent c8ad355032
commit e6f297075a
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
3 changed files with 7 additions and 4 deletions

View File

@ -5,12 +5,13 @@ from trezor.messages.CardanoAddress import CardanoAddress
from .address import derive_address_and_node
from .layout import confirm_with_pagination
from apps.common import storage
from apps.common import seed, storage
async def get_address(ctx, msg):
mnemonic = storage.get_mnemonic()
root_node = bip32.from_mnemonic_cardano(mnemonic, "")
passphrase = await seed._get_cached_passphrase(ctx)
root_node = bip32.from_mnemonic_cardano(mnemonic, passphrase)
try:
address, _ = derive_address_and_node(root_node, msg.address_n)

View File

@ -12,7 +12,8 @@ from apps.common import layout, seed, storage
async def get_public_key(ctx, msg):
mnemonic = storage.get_mnemonic()
root_node = bip32.from_mnemonic_cardano(mnemonic, "")
passphrase = await seed._get_cached_passphrase(ctx)
root_node = bip32.from_mnemonic_cardano(mnemonic, passphrase)
try:
key = _get_public_key(root_node, msg.address_n)

View File

@ -80,7 +80,8 @@ async def request_transaction(ctx, tx_req: CardanoTxRequest, index: int):
async def sign_tx(ctx, msg):
mnemonic = storage.get_mnemonic()
root_node = bip32.from_mnemonic_cardano(mnemonic, "")
passphrase = await seed._get_cached_passphrase(ctx)
root_node = bip32.from_mnemonic_cardano(mnemonic, passphrase)
progress.init(msg.transactions_count, "Loading data")