This repository was archived by the owner on Jul 21, 2023. It is now read-only.
File tree 4 files changed +8
-8
lines changed
4 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 176
176
},
177
177
"devDependencies" : {
178
178
"@libp2p/crypto" : " ^1.0.11" ,
179
- "aegir" : " ^38.1.7 " ,
179
+ "aegir" : " ^39.0.10 " ,
180
180
"protons" : " ^7.0.2"
181
181
}
182
182
}
Original file line number Diff line number Diff line change 1
- import type { Uint8ArrayList } from 'uint8arraylist'
2
1
import {
3
2
Record
4
3
} from './record.js'
5
4
import * as utils from './utils.js'
5
+ import type { Uint8ArrayList } from 'uint8arraylist'
6
6
7
7
export class Libp2pRecord {
8
8
public key : Uint8Array
Original file line number Diff line number Diff line change 1
1
import { CodeError } from '@libp2p/interfaces/errors'
2
+ import { sha256 } from 'multiformats/hashes/sha2'
3
+ import { equals as uint8ArrayEquals } from 'uint8arrays/equals'
2
4
import { toString as uint8ArrayToString } from 'uint8arrays/to-string'
3
5
import type { Libp2pRecord } from './index.js'
4
6
import type { Validators } from '@libp2p/interface-dht'
5
- import { sha256 } from 'multiformats/hashes/sha2'
6
- import { equals as uint8ArrayEquals } from 'uint8arrays/equals'
7
7
8
8
/**
9
9
* Checks a record and ensures it is still valid.
Original file line number Diff line number Diff line change 1
1
/* eslint max-nested-callbacks: ["error", 8] */
2
2
/* eslint-env mocha */
3
3
4
- import { expect } from 'aegir/chai'
5
4
import { generateKeyPair , unmarshalPublicKey } from '@libp2p/crypto/keys'
5
+ import { expect } from 'aegir/chai'
6
6
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
7
- import * as validator from '../src/validators.js'
8
7
import { Libp2pRecord } from '../src/index.js'
8
+ import * as validator from '../src/validators.js'
9
9
import * as fixture from './fixtures/go-key-records.js'
10
10
import type { Validators } from '@libp2p/interface-dht'
11
11
@@ -105,13 +105,13 @@ describe('validator', () => {
105
105
} )
106
106
107
107
it ( 'does not error on valid record' , async ( ) => {
108
- return await Promise . all ( cases . valid . publicKey . map ( async ( k ) => {
108
+ return Promise . all ( cases . valid . publicKey . map ( async ( k ) => {
109
109
await validator . validators . pk ( k , key . public . bytes )
110
110
} ) )
111
111
} )
112
112
113
113
it ( 'throws on invalid records' , async ( ) => {
114
- return await Promise . all ( cases . invalid . publicKey . map ( async ( { data, code } ) => {
114
+ return Promise . all ( cases . invalid . publicKey . map ( async ( { data, code } ) => {
115
115
try {
116
116
//
117
117
await validator . validators . pk ( data , key . public . bytes )
You can’t perform that action at this time.
0 commit comments