rebuild protobufs adding ECC_P256 to KeyType

This commit is contained in:
pacrob
2024-04-27 10:51:36 -06:00
committed by Paul Robinson
parent 827d16b106
commit c770a05d23
11 changed files with 80 additions and 91 deletions

View File

@ -2,20 +2,16 @@
@generated by mypy-protobuf. Do not edit manually!
isort:skip_file
"""
import builtins
import google.protobuf.descriptor
import google.protobuf.message
import libp2p.crypto.pb.crypto_pb2
import sys
if sys.version_info >= (3, 8):
import typing as typing_extensions
else:
import typing_extensions
import typing
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
@typing_extensions.final
@typing.final
class Exchange(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor
@ -30,7 +26,7 @@ class Exchange(google.protobuf.message.Message):
id: builtins.bytes | None = ...,
pubkey: libp2p.crypto.pb.crypto_pb2.PublicKey | None = ...,
) -> None: ...
def HasField(self, field_name: typing_extensions.Literal["id", b"id", "pubkey", b"pubkey"]) -> builtins.bool: ...
def ClearField(self, field_name: typing_extensions.Literal["id", b"id", "pubkey", b"pubkey"]) -> None: ...
def HasField(self, field_name: typing.Literal["id", b"id", "pubkey", b"pubkey"]) -> builtins.bool: ...
def ClearField(self, field_name: typing.Literal["id", b"id", "pubkey", b"pubkey"]) -> None: ...
global___Exchange = Exchange

View File

@ -182,8 +182,7 @@ class InsecureTransport(BaseSecureTransport):
def make_exchange_message(pubkey: PublicKey) -> plaintext_pb2.Exchange:
pubkey_pb = crypto_pb2.PublicKey(
# type ignored - TODO add ECD_P256 to KeyType
key_type=pubkey.get_type().value, # type: ignore
key_type=pubkey.get_type().value,
data=pubkey.to_bytes(),
)
id_bytes = ID.from_pubkey(pubkey).to_bytes()