wallet: use coin's .curve_name

pull/25/head
Yura Pakhuchiy 6 years ago committed by Pavol Rusnak
parent 7db1061123
commit a3542a6441

@ -9,7 +9,7 @@ async def get_address(ctx, msg):
coin_name = msg.coin_name or 'Bitcoin'
coin = coins.by_name(coin_name)
node = await seed.derive_node(ctx, msg.address_n)
node = await seed.derive_node(ctx, msg.address_n, curve_name=coin.curve_name)
address = addresses.get_address(msg.script_type, coin, node, msg.multisig)
address_short = addresses.address_short(coin, address)

@ -11,13 +11,12 @@ from ubinascii import hexlify
async def get_public_key(ctx, msg):
coin_name = msg.coin_name or 'Bitcoin'
coin = coins.by_name(coin_name)
curve_name = msg.ecdsa_curve_name
if not curve_name:
node = await seed.derive_node(ctx, msg.address_n)
else:
node = await seed.derive_node(ctx, msg.address_n, curve_name=curve_name)
coin = coins.by_name(coin_name)
curve_name = coin.curve_name
node = await seed.derive_node(ctx, msg.address_n, curve_name=curve_name)
node_xpub = node.serialize_public(coin.xpub_magic)
pubkey = node.public_key()

@ -18,7 +18,7 @@ async def sign_message(ctx, msg):
await require_confirm_sign_message(ctx, message)
node = await seed.derive_node(ctx, address_n)
node = await seed.derive_node(ctx, address_n, curve_name=coin.curve_name)
seckey = node.private_key()
address = get_address(script_type, coin, node)

@ -2,7 +2,7 @@ from trezor import ui, wire
from trezor.messages.MessageType import TxAck
from trezor.messages.TxRequest import TxRequest
from trezor.messages.RequestType import TXFINISHED
from apps.common import seed
from apps.common import seed, coins
from apps.wallet.sign_tx.helpers import UiConfirmOutput, UiConfirmTotal, UiConfirmFeeOverThreshold, UiConfirmForeignAddress
@ -10,8 +10,10 @@ from apps.wallet.sign_tx.helpers import UiConfirmOutput, UiConfirmTotal, UiConfi
async def sign_tx(ctx, msg):
from apps.wallet.sign_tx import layout, progress, signing
coin_name = msg.coin_name or 'Bitcoin'
coin = coins.by_name(coin_name)
# TODO: rework this so we don't have to pass root to signing.sign_tx
root = await seed.derive_node(ctx, [])
root = await seed.derive_node(ctx, [], curve_name=coin.curve_name)
signer = signing.sign_tx(msg, root)
res = None

Loading…
Cancel
Save