1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-02-21 20:12:02 +00:00

src/apps/wallet: implement cashaddr in verify message

This commit is contained in:
Pavol Rusnak 2018-06-01 21:29:50 +02:00
parent 9fa4ac2c13
commit 321bc2787f
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -6,7 +6,7 @@ from trezor.ui.text import Text
from apps.common import coins
from apps.common.confirm import require_confirm
from apps.common.signverify import message_digest, split_message
from apps.wallet.sign_tx.addresses import address_pkh, address_p2wpkh_in_p2sh, address_p2wpkh
from apps.wallet.sign_tx.addresses import address_pkh, address_p2wpkh_in_p2sh, address_p2wpkh, address_to_cashaddr
from apps.wallet.get_address import _split_address
@ -39,6 +39,8 @@ async def verify_message(ctx, msg):
if script_type == SPENDADDRESS:
addr = address_pkh(pubkey, coin.address_type)
if coin.cashaddr_prefix is not None:
addr = address_to_cashaddr(addr, coin)
elif script_type == SPENDP2SHWITNESS:
addr = address_p2wpkh_in_p2sh(pubkey, coin.address_type_p2sh)
elif script_type == SPENDWITNESS: