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:
parent
fb22b894ba
commit
555bb62e3f
@ -597,9 +597,10 @@ def get_address(connect, coin, address, script_type, show_display):
|
|||||||
@click.option("-c", "--coin", default="Bitcoin")
|
@click.option("-c", "--coin", default="Bitcoin")
|
||||||
@click.option("-n", "--address", required=True, help="BIP-32 path, e.g. m/44'/0'/0'")
|
@click.option("-n", "--address", required=True, help="BIP-32 path, e.g. m/44'/0'/0'")
|
||||||
@click.option("-e", "--curve")
|
@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.option("-d", "--show-display", is_flag=True)
|
||||||
@click.pass_obj
|
@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()
|
client = connect()
|
||||||
address_n = tools.parse_path(address)
|
address_n = tools.parse_path(address)
|
||||||
result = btc.get_public_node(
|
result = btc.get_public_node(
|
||||||
@ -608,6 +609,7 @@ def get_public_node(connect, coin, address, curve, show_display):
|
|||||||
ecdsa_curve_name=curve,
|
ecdsa_curve_name=curve,
|
||||||
show_display=show_display,
|
show_display=show_display,
|
||||||
coin_name=coin,
|
coin_name=coin,
|
||||||
|
script_type=script_type,
|
||||||
)
|
)
|
||||||
return {
|
return {
|
||||||
"node": {
|
"node": {
|
||||||
|
@ -4,7 +4,12 @@ from .tools import CallException, expect, normalize_nfc, session
|
|||||||
|
|
||||||
@expect(proto.PublicKey)
|
@expect(proto.PublicKey)
|
||||||
def get_public_node(
|
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(
|
return client.call(
|
||||||
proto.GetPublicKey(
|
proto.GetPublicKey(
|
||||||
@ -12,6 +17,7 @@ def get_public_node(
|
|||||||
ecdsa_curve_name=ecdsa_curve_name,
|
ecdsa_curve_name=ecdsa_curve_name,
|
||||||
show_display=show_display,
|
show_display=show_display,
|
||||||
coin_name=coin_name,
|
coin_name=coin_name,
|
||||||
|
script_type=script_type,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
# If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
|
# If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
|
|
||||||
from trezorlib.transport import all_transports
|
from trezorlib.transport import all_transports
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user