mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-22 15:38:11 +00:00
wallet/get_address: support segwit
This commit is contained in:
parent
7de6a082d3
commit
7a0bfd289b
@ -8,17 +8,19 @@ async def layout_get_address(ctx, msg):
|
||||
from trezor.messages.FailureType import ProcessError
|
||||
from ..common import coins
|
||||
from ..common import seed
|
||||
from ..wallet.sign_tx import addresses
|
||||
|
||||
if msg.multisig:
|
||||
raise wire.FailureError(ProcessError, 'GetAddress.multisig is unsupported')
|
||||
|
||||
address_n = msg.address_n or ()
|
||||
coin_name = msg.coin_name or 'Bitcoin'
|
||||
coin = coins.by_name(coin_name)
|
||||
|
||||
node = await seed.get_root(ctx)
|
||||
node.derive_path(address_n)
|
||||
coin = coins.by_name(coin_name)
|
||||
address = node.address(coin.address_type)
|
||||
|
||||
address = addresses.get_address(msg.script_type, coin, node)
|
||||
|
||||
if msg.show_display:
|
||||
await _show_address(ctx, address)
|
||||
|
@ -16,7 +16,7 @@ class AddressError(Exception):
|
||||
pass
|
||||
|
||||
|
||||
def get_address(script_type: InputScriptType, coin: CoinType, node) -> bytes:
|
||||
def get_address(script_type: InputScriptType, coin: CoinType, node) -> str:
|
||||
|
||||
if script_type == InputScriptType.SPENDADDRESS: # p2pkh
|
||||
return node.address(coin.address_type)
|
||||
|
@ -17,8 +17,6 @@ pytest \
|
||||
--ignore test_msg_ethereum_signmessage.py \
|
||||
--ignore test_msg_ethereum_signtx.py \
|
||||
--ignore test_msg_ethereum_verifymessage.py \
|
||||
--ignore test_msg_getaddress_segwit_native.py \
|
||||
--ignore test_msg_getaddress_segwit.py \
|
||||
--ignore test_msg_getaddress_show.py \
|
||||
--ignore test_msg_loaddevice_xprv.py \
|
||||
--ignore test_msg_nem_getaddress.py \
|
||||
|
Loading…
Reference in New Issue
Block a user