mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-07-15 00:31:36 +00:00
Compare commits
2 Commits
v0.28.7
...
fix/return
Author | SHA1 | Date | |
---|---|---|---|
ed2dbd9bea | |||
856b38de67 |
45
MIGRATION_TEMPLATE.md
Normal file
45
MIGRATION_TEMPLATE.md
Normal file
@ -0,0 +1,45 @@
|
||||
<!--Specify versions for migration below-->
|
||||
# Migrating to libp2p@__
|
||||
|
||||
A migration guide for refactoring your application code from libp2p v__ to v__.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
- [API](#api)
|
||||
- [Module Updates](#module-updates)
|
||||
|
||||
## API
|
||||
|
||||
<!--Describe breaking APIs with examples for Before and After
|
||||
Example:
|
||||
|
||||
### Peer Discovery
|
||||
|
||||
__Describe__
|
||||
|
||||
**Before**
|
||||
|
||||
```js
|
||||
|
||||
```
|
||||
|
||||
**After**
|
||||
|
||||
```js
|
||||
|
||||
```
|
||||
|
||||
-->
|
||||
|
||||
## Module Updates
|
||||
|
||||
With this release you should update the following libp2p modules if you are relying on them:
|
||||
|
||||
<!--Specify module versions in JSON for migration below.
|
||||
It's recommended to check package.json changes for this:
|
||||
`git diff <release> <prev> -- package.json`
|
||||
-->
|
||||
|
||||
```json
|
||||
|
||||
```
|
@ -179,7 +179,7 @@ class AddressBook extends Book {
|
||||
const record = this.data.get(peerId.toB58String())
|
||||
|
||||
if (!record) {
|
||||
return undefined
|
||||
return []
|
||||
}
|
||||
|
||||
return record.map((address) => {
|
||||
|
@ -323,10 +323,10 @@ describe('addressBook', () => {
|
||||
throw new Error('invalid peerId should throw error')
|
||||
})
|
||||
|
||||
it('returns undefined if no multiaddrs are known for the provided peer', () => {
|
||||
it('returns empty array if no multiaddrs are known for the provided peer', () => {
|
||||
const addresses = ab.getMultiaddrsForPeer(peerId)
|
||||
|
||||
expect(addresses).to.not.exist()
|
||||
expect(addresses).to.be.empty()
|
||||
})
|
||||
|
||||
it('returns the multiaddrs stored', () => {
|
||||
|
Reference in New Issue
Block a user