1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-23 06:48:16 +00:00

btc: add script_type to get_public_node

This commit is contained in:
Pavol Rusnak 2018-09-05 15:21:11 +02:00
parent fb22b894ba
commit 555bb62e3f
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
3 changed files with 10 additions and 3 deletions

View File

@ -597,9 +597,10 @@ def get_address(connect, coin, address, script_type, show_display):
@click.option("-c", "--coin", default="Bitcoin")
@click.option("-n", "--address", required=True, help="BIP-32 path, e.g. m/44'/0'/0'")
@click.option("-e", "--curve")
@click.option("-t", "--script-type", type=CHOICE_INPUT_SCRIPT_TYPE, default="address")
@click.option("-d", "--show-display", is_flag=True)
@click.pass_obj
def get_public_node(connect, coin, address, curve, show_display):
def get_public_node(connect, coin, address, curve, script_type, show_display):
client = connect()
address_n = tools.parse_path(address)
result = btc.get_public_node(
@ -608,6 +609,7 @@ def get_public_node(connect, coin, address, curve, show_display):
ecdsa_curve_name=curve,
show_display=show_display,
coin_name=coin,
script_type=script_type,
)
return {
"node": {

View File

@ -4,7 +4,12 @@ from .tools import CallException, expect, normalize_nfc, session
@expect(proto.PublicKey)
def get_public_node(
client, n, ecdsa_curve_name=None, show_display=False, coin_name=None
client,
n,
ecdsa_curve_name=None,
show_display=False,
coin_name=None,
script_type=proto.InputScriptType.SPENDADDRESS,
):
return client.call(
proto.GetPublicKey(
@ -12,6 +17,7 @@ def get_public_node(
ecdsa_curve_name=ecdsa_curve_name,
show_display=show_display,
coin_name=coin_name,
script_type=script_type,
)
)

View File

@ -15,7 +15,6 @@
# If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
import mock
from trezorlib.transport import all_transports