mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-06-26 09:52:34 +00:00
cardano: add high-level support for passhrase
This commit is contained in:
parent
c8ad355032
commit
e6f297075a
@ -5,12 +5,13 @@ from trezor.messages.CardanoAddress import CardanoAddress
|
|||||||
from .address import derive_address_and_node
|
from .address import derive_address_and_node
|
||||||
from .layout import confirm_with_pagination
|
from .layout import confirm_with_pagination
|
||||||
|
|
||||||
from apps.common import storage
|
from apps.common import seed, storage
|
||||||
|
|
||||||
|
|
||||||
async def get_address(ctx, msg):
|
async def get_address(ctx, msg):
|
||||||
mnemonic = storage.get_mnemonic()
|
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:
|
try:
|
||||||
address, _ = derive_address_and_node(root_node, msg.address_n)
|
address, _ = derive_address_and_node(root_node, msg.address_n)
|
||||||
|
@ -12,7 +12,8 @@ from apps.common import layout, seed, storage
|
|||||||
|
|
||||||
async def get_public_key(ctx, msg):
|
async def get_public_key(ctx, msg):
|
||||||
mnemonic = storage.get_mnemonic()
|
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:
|
try:
|
||||||
key = _get_public_key(root_node, msg.address_n)
|
key = _get_public_key(root_node, msg.address_n)
|
||||||
|
@ -80,7 +80,8 @@ async def request_transaction(ctx, tx_req: CardanoTxRequest, index: int):
|
|||||||
|
|
||||||
async def sign_tx(ctx, msg):
|
async def sign_tx(ctx, msg):
|
||||||
mnemonic = storage.get_mnemonic()
|
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")
|
progress.init(msg.transactions_count, "Loading data")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user