mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-03-16 15:40:49 +00:00
chore: apply suggestions from code review
Co-authored-by: Jacob Heun <jacobheun@gmail.com>
This commit is contained in:
parent
f574e82a5d
commit
ca57e65ecc
@ -125,9 +125,10 @@ class AddressBook extends Book {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a peer raw envelope.
|
||||
* Get the raw Envelope for a peer. Returns
|
||||
* undefined if no Envelope is found.
|
||||
* @param {PeerId} peerId
|
||||
* @return {Buffer}
|
||||
* @return {Buffer|undefined}
|
||||
*/
|
||||
getRawEnvelope (peerId) {
|
||||
const entry = this.data.get(peerId.toB58String())
|
||||
@ -141,8 +142,9 @@ class AddressBook extends Book {
|
||||
|
||||
/**
|
||||
* Get an Envelope containing a PeerRecord for the given peer.
|
||||
* Returns undefined if no record exists.
|
||||
* @param {PeerId} peerId
|
||||
* @return {Promise<Envelope>}
|
||||
* @return {Promise<Envelope|void>}
|
||||
*/
|
||||
getPeerRecord (peerId) {
|
||||
const raw = this.getRawEnvelope(peerId)
|
||||
|
Loading…
x
Reference in New Issue
Block a user