1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-16 10:20:57 +00:00

app.lisk: add require confirm layout for message signing

This commit is contained in:
Aleksey Popov 2018-05-17 19:24:36 +03:00 committed by Jan Pochyla
parent d331ff245f
commit 83a1df99f4

View File

@ -1,10 +1,15 @@
from .helpers import LISK_CURVE, get_address_from_public_key
from apps.wallet.sign_message import require_confirm_sign_message
async def lisk_sign_message(ctx, msg):
from trezor.messages.LiskMessageSignature import LiskMessageSignature
from trezor.crypto.curve import ed25519
from ..common import seed
message = msg.message
await require_confirm_sign_message(ctx, message)
address_n = msg.address_n or ()
node = await seed.derive_node(ctx, address_n, LISK_CURVE)
@ -12,6 +17,6 @@ async def lisk_sign_message(ctx, msg):
public_key = ed25519.publickey(seckey)
address = get_address_from_public_key(public_key)
signature = ed25519.sign(seckey, msg.message)
signature = ed25519.sign(seckey, message)
return LiskMessageSignature(address=address, signature=signature)