1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-14 18:38:08 +00:00

feat(trezorctl): view signature for btc get–address

This commit is contained in:
Tomas Martykan 2024-12-12 12:00:13 +01:00
parent 2ce2443376
commit bb620456e8
No known key found for this signature in database

View File

@ -174,6 +174,7 @@ def cli() -> None:
help="Sort pubkeys lexicographically using BIP-67", help="Sort pubkeys lexicographically using BIP-67",
) )
@click.option("-C", "--chunkify", is_flag=True) @click.option("-C", "--chunkify", is_flag=True)
@click.option("-S", "--with-signature", is_flag=True)
@with_client @with_client
def get_address( def get_address(
client: "TrezorClient", client: "TrezorClient",
@ -186,6 +187,7 @@ def get_address(
multisig_suffix_length: int, multisig_suffix_length: int,
multisig_sort_pubkeys: bool, multisig_sort_pubkeys: bool,
chunkify: bool, chunkify: bool,
with_signature: bool = False,
) -> str: ) -> str:
"""Get address for specified path. """Get address for specified path.
@ -234,7 +236,7 @@ def get_address(
else: else:
multisig = None multisig = None
return btc.get_address( response = btc.get_authenticated_address(
client, client,
coin, coin,
address_n, address_n,
@ -245,6 +247,10 @@ def get_address(
chunkify=chunkify, chunkify=chunkify,
) )
if with_signature:
return "Address: " + response.address + "\n" + "Signature: " + response.signature.hex()
else:
return response.address
@cli.command() @cli.command()
@click.option("-c", "--coin", default=DEFAULT_COIN) @click.option("-c", "--coin", default=DEFAULT_COIN)