Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

chore: replace err-code with CodeError #42

Merged
merged 1 commit into from
Jan 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,11 @@
"@libp2p/crypto": "^1.0.11",
"@libp2p/interface-peer-id": "^2.0.0",
"@libp2p/interface-record": "^2.0.1",
"@libp2p/interfaces": "^3.2.0",
"@libp2p/logger": "^2.0.5",
"@libp2p/peer-id": "^2.0.0",
"@libp2p/utils": "^3.0.0",
"@multiformats/multiaddr": "^11.0.0",
"err-code": "^3.0.1",
"interface-datastore": "^7.0.0",
"it-all": "^2.0.0",
"it-filter": "^2.0.0",
Expand Down
4 changes: 2 additions & 2 deletions src/envelope/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import errCode from 'err-code'
import { CodeError } from '@libp2p/interfaces/errors'
import { fromString as uint8arraysFromString } from 'uint8arrays/from-string'
import { equals as uint8ArrayEquals } from 'uint8arrays/equals'
import { unmarshalPrivateKey, unmarshalPublicKey } from '@libp2p/crypto/keys'
Expand Down Expand Up @@ -66,7 +66,7 @@ export class RecordEnvelope implements Envelope {
const valid = await envelope.validate(domain)

if (!valid) {
throw errCode(new Error('envelope signature is not valid for the given domain'), codes.ERR_SIGNATURE_NOT_VALID)
throw new CodeError('envelope signature is not valid for the given domain', codes.ERR_SIGNATURE_NOT_VALID)
}

return envelope
Expand Down