mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-06-26 15:31:34 +00:00
feat: cerified addressbook
This commit is contained in:
@ -112,11 +112,6 @@ const formatSignaturePayload = (domain, payloadType, payload) => {
|
||||
])
|
||||
}
|
||||
|
||||
/**
|
||||
* Unmarshal a serialized Envelope protobuf message.
|
||||
* @param {Buffer} data
|
||||
* @return {Envelope}
|
||||
*/
|
||||
const unmarshalEnvelope = async (data) => {
|
||||
const envelopeData = Protobuf.decode(data)
|
||||
const peerId = await PeerId.createFromPubKey(envelopeData.public_key)
|
||||
@ -129,6 +124,13 @@ const unmarshalEnvelope = async (data) => {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Unmarshal a serialized Envelope protobuf message.
|
||||
* @param {Buffer} data
|
||||
* @return {Promise<Envelope>}
|
||||
*/
|
||||
Envelope.createFromProtobuf = unmarshalEnvelope
|
||||
|
||||
/**
|
||||
* Seal marshals the given Record, places the marshaled bytes inside an Envelope
|
||||
* and signs it with the given peerId's private key.
|
||||
|
Reference in New Issue
Block a user