@libp2p/peer-id-factory
Advanced tools
Comparing version 4.1.4-6573cb8b0 to 4.1.4-b0b6cae12
@@ -80,4 +80,10 @@ /** | ||
} | ||
return peerIdFromBytes(multihash); | ||
const peerId = peerIdFromBytes(multihash); | ||
if (peerId.type !== 'Ed25519' && peerId.type !== 'secp256k1' && peerId.type !== 'RSA') { | ||
// should not be possible since `multihash` is derived from keys and these | ||
// are the cryptographic peer id types | ||
throw new Error('Supplied PeerID is invalid'); | ||
} | ||
return peerId; | ||
} | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@libp2p/peer-id-factory", | ||
"version": "4.1.4-6573cb8b0", | ||
"version": "4.1.4-b0b6cae12", | ||
"description": "Create PeerId instances", | ||
@@ -61,5 +61,5 @@ "license": "Apache-2.0 OR MIT", | ||
"dependencies": { | ||
"@libp2p/crypto": "4.1.4-6573cb8b0", | ||
"@libp2p/interface": "1.5.0-6573cb8b0", | ||
"@libp2p/peer-id": "4.1.4-6573cb8b0", | ||
"@libp2p/crypto": "4.1.4-b0b6cae12", | ||
"@libp2p/interface": "1.5.0-b0b6cae12", | ||
"@libp2p/peer-id": "4.1.4-b0b6cae12", | ||
"protons-runtime": "^5.4.0", | ||
@@ -66,0 +66,0 @@ "uint8arraylist": "^2.4.8", |
@@ -112,3 +112,11 @@ /** | ||
return peerIdFromBytes(multihash) | ||
const peerId = peerIdFromBytes(multihash) | ||
if (peerId.type !== 'Ed25519' && peerId.type !== 'secp256k1' && peerId.type !== 'RSA') { | ||
// should not be possible since `multihash` is derived from keys and these | ||
// are the cryptographic peer id types | ||
throw new Error('Supplied PeerID is invalid') | ||
} | ||
return peerId | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
175477
1005
+ Added@libp2p/crypto@4.1.4-b0b6cae12(transitive)
+ Added@libp2p/interface@1.5.0-b0b6cae12(transitive)
+ Added@libp2p/peer-id@4.1.4-b0b6cae12(transitive)
- Removed@libp2p/crypto@4.1.4-6573cb8b0(transitive)
- Removed@libp2p/interface@1.5.0-6573cb8b0(transitive)
- Removed@libp2p/peer-id@4.1.4-6573cb8b0(transitive)