mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-06-25 23:11:35 +00:00
chore: deprecate old peer store api (#598)
* chore: deprecate old peer-store api BREAKING CHANGE: the peer-store api changed. Check the API docs for the new specification. * chore: apply suggestions from code review Co-Authored-By: Jacob Heun <jacobheun@gmail.com> * chore: apply suggestions from code review Co-Authored-By: Jacob Heun <jacobheun@gmail.com> Co-authored-by: Jacob Heun <jacobheun@gmail.com>
This commit is contained in:
@ -45,7 +45,7 @@ describe('peer-store', () => {
|
||||
})
|
||||
|
||||
it('returns undefined on trying to find a non existant peerId', () => {
|
||||
const peerInfo = peerStore.find(peerIds[0])
|
||||
const peerInfo = peerStore.get(peerIds[0])
|
||||
expect(peerInfo).to.not.exist()
|
||||
})
|
||||
})
|
||||
@ -101,8 +101,8 @@ describe('peer-store', () => {
|
||||
expect(peers.size).to.equal(3)
|
||||
})
|
||||
|
||||
it('finds the stored information of a peer in all its books', () => {
|
||||
const peerInfo = peerStore.find(peerIds[0])
|
||||
it('gets the stored information of a peer in all its books', () => {
|
||||
const peerInfo = peerStore.get(peerIds[0])
|
||||
expect(peerInfo).to.exist()
|
||||
expect(peerInfo.protocols).to.have.members([proto1])
|
||||
|
||||
@ -110,8 +110,8 @@ describe('peer-store', () => {
|
||||
expect(peerMultiaddrs).to.have.members([addr1, addr2])
|
||||
})
|
||||
|
||||
it('finds the stored information of a peer that is not present in all its books', () => {
|
||||
const peerInfo = peerStore.find(peerIds[2])
|
||||
it('gets the stored information of a peer that is not present in all its books', () => {
|
||||
const peerInfo = peerStore.get(peerIds[2])
|
||||
expect(peerInfo).to.exist()
|
||||
expect(peerInfo.protocols.length).to.eql(0)
|
||||
|
||||
|
Reference in New Issue
Block a user