fix typos

This commit is contained in:
lla-dane
2025-08-12 13:57:16 +05:30
parent 292bd1a942
commit 53db128f69
10 changed files with 569 additions and 157 deletions

View File

@ -15,8 +15,7 @@ from libp2p.custom_types import (
from libp2p.network.stream.exceptions import (
StreamClosed,
)
from libp2p.peer.envelope import seal_record
from libp2p.peer.peer_record import PeerRecord
from libp2p.peer.peerstore import create_signed_peer_record
from libp2p.utils import (
decode_varint_with_size,
get_agent_version,
@ -66,9 +65,11 @@ def _mk_identify_protobuf(
protocols = tuple(str(p) for p in host.get_mux().get_protocols() if p is not None)
# Create a signed peer-record for the remote peer
record = PeerRecord(host.get_id(), host.get_addrs())
envelope = seal_record(record, host.get_private_key())
protobuf = envelope.marshal_envelope()
envelope = create_signed_peer_record(
host.get_id(),
host.get_addrs(),
host.get_private_key(),
)
observed_addr = observed_multiaddr.to_bytes() if observed_multiaddr else b""
return Identify(
@ -78,7 +79,7 @@ def _mk_identify_protobuf(
listen_addrs=map(_multiaddr_to_bytes, laddrs),
observed_addr=observed_addr,
protocols=protocols,
signedPeerRecord=protobuf,
signedPeerRecord=envelope.marshal_envelope(),
)