lightning: use decoded object properties
This commit is contained in:
parent
e718fb0834
commit
8624552268
@ -858,7 +858,7 @@ def DerivePrivKey(json):
|
|||||||
|
|
||||||
m = rpc_pb2.DerivePrivKeyResponse()
|
m = rpc_pb2.DerivePrivKeyResponse()
|
||||||
|
|
||||||
m.privKey = derivePrivKey(json.keyDescriptor).privkey.secret_multiplier
|
m.privKey = derivePrivKey(req.keyDescriptor).privkey.secret_multiplier
|
||||||
|
|
||||||
msg = json_format.MessageToJson(m)
|
msg = json_format.MessageToJson(m)
|
||||||
return msg
|
return msg
|
||||||
@ -870,7 +870,7 @@ def DeriveNextKey(json):
|
|||||||
req = rpc_pb2.DeriveNextKeyRequest()
|
req = rpc_pb2.DeriveNextKeyRequest()
|
||||||
json_format.Parse(json, req)
|
json_format.Parse(json, req)
|
||||||
|
|
||||||
family = json.keyFamily
|
family = req.keyFamily
|
||||||
|
|
||||||
m = rpc_pb2.DeriveNextKeyResponse()
|
m = rpc_pb2.DeriveNextKeyResponse()
|
||||||
|
|
||||||
@ -889,8 +889,8 @@ def DeriveKey(json):
|
|||||||
req = rpc_pb2.DeriveKeyRequest()
|
req = rpc_pb2.DeriveKeyRequest()
|
||||||
json_format.Parse(json, req)
|
json_format.Parse(json, req)
|
||||||
|
|
||||||
family = json.keyLocator.family
|
family = req.keyLocator.family
|
||||||
idx = json.keyLocator.index
|
idx = req.keyLocator.index
|
||||||
|
|
||||||
m = rpc_pb2.DeriveKeyResponse()
|
m = rpc_pb2.DeriveKeyResponse()
|
||||||
|
|
||||||
@ -914,9 +914,9 @@ def ScalarMult(json):
|
|||||||
req = rpc_pb2.ScalarMultRequest()
|
req = rpc_pb2.ScalarMultRequest()
|
||||||
json_format.Parse(json, req)
|
json_format.Parse(json, req)
|
||||||
|
|
||||||
privKey = derivePrivKey(json.keyDescriptor)
|
privKey = derivePrivKey(req.keyDescriptor)
|
||||||
|
|
||||||
point = bitcoin.ser_to_point(json.pubKey)
|
point = bitcoin.ser_to_point(req.pubKey)
|
||||||
|
|
||||||
point = point * int.from_bytes(privKey.secret_multiplier, "big")
|
point = point * int.from_bytes(privKey.secret_multiplier, "big")
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user