forked from LBRYCommunity/lbry-sdk
17 lines
685 B
Python
17 lines
685 B
Python
from copy import deepcopy
|
|
|
|
from lbrynet.schema.proto import signature_pb2 as signature_pb
|
|
from lbrynet.schema.schema import VERSION_MAP, ECDSA_CURVES
|
|
from lbrynet.schema.schema.schema import Schema
|
|
|
|
|
|
class Signature(Schema):
|
|
@classmethod
|
|
def load(cls, message):
|
|
_signature = deepcopy(message)
|
|
_message_pb = signature_pb.Signature()
|
|
_message_pb.version = VERSION_MAP[_signature.pop("version")]
|
|
_message_pb.signatureType = ECDSA_CURVES[_signature.pop("signatureType")]
|
|
_message_pb.certificateId = _signature.pop("certificateId")
|
|
_message_pb.signature = _signature.pop("signature")
|
|
return cls._load(_signature, _message_pb)
|