fix(core): create protobuf messages correctly

pull/1423/head
matejcik 3 years ago committed by matejcik
parent 0964517fe7
commit 73a28e12f2

@ -35,19 +35,20 @@ if False:
def get_features() -> Features: def get_features() -> Features:
f = Features() f = Features(
f.vendor = "trezor.io" vendor="trezor.io",
f.language = "en-US" language="en-US",
f.major_version = utils.VERSION_MAJOR major_version=utils.VERSION_MAJOR,
f.minor_version = utils.VERSION_MINOR minor_version=utils.VERSION_MINOR,
f.patch_version = utils.VERSION_PATCH patch_version=utils.VERSION_PATCH,
f.revision = utils.GITREV.encode() revision=utils.GITREV.encode(),
f.model = utils.MODEL model=utils.MODEL,
f.device_id = storage.device.get_device_id() device_id=storage.device.get_device_id(),
f.label = storage.device.get_label() label=storage.device.get_label(),
f.pin_protection = config.has_pin() pin_protection=config.has_pin(),
f.unlocked = config.is_unlocked() unlocked=config.is_unlocked(),
f.passphrase_protection = storage.device.is_passphrase_enabled() passphrase_protection=storage.device.is_passphrase_enabled(),
)
if utils.BITCOIN_ONLY: if utils.BITCOIN_ONLY:
f.capabilities = [ f.capabilities = [

@ -32,7 +32,7 @@ async def sign_message(ctx, msg, keychain):
secp256k1.CANONICAL_SIG_ETHEREUM, secp256k1.CANONICAL_SIG_ETHEREUM,
) )
sig = EthereumMessageSignature() return EthereumMessageSignature(
sig.address = address.address_from_bytes(node.ethereum_pubkeyhash()) address=address.address_from_bytes(node.ethereum_pubkeyhash()),
sig.signature = signature[1:] + bytearray([signature[0]]) signature=signature[1:] + bytearray([signature[0]]),
return sig )

@ -72,7 +72,7 @@ async def sign_tx(ctx, msg: NEMSignTx, keychain):
signature = ed25519.sign(node.private_key(), tx, NEM_HASH_ALG) signature = ed25519.sign(node.private_key(), tx, NEM_HASH_ALG)
resp = NEMSignedTx() return NEMSignedTx(
resp.data = tx data=tx,
resp.signature = signature signature=signature,
return resp )

Loading…
Cancel
Save