-
Notifications
You must be signed in to change notification settings - Fork 510
refactor: pubsub #467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: pubsub #467
Changes from 1 commit
dca4727
ec5319a
751bc00
dcd127b
cdfd023
4cc9736
340edf5
6240dc0
9b9ac54
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,8 @@ const debug = require('debug') | |
| const log = debug('libp2p:peer-store') | ||
| log.error = debug('libp2p:peer-store:error') | ||
|
|
||
| const Topology = require('libp2p-interfaces/src/topology') | ||
| const MulticodecTopology = require('libp2p-interfaces/src/topology/multicodec-topology') | ||
| const { Connection } = require('libp2p-interfaces/src/connection') | ||
| const PeerInfo = require('peer-info') | ||
|
|
||
|
|
@@ -109,6 +111,11 @@ class Registrar { | |
| * @return {string} registrar identifier | ||
| */ | ||
| register (topology) { | ||
| assert( | ||
| Topology.isTopology(topology) || | ||
| MulticodecTopology.isMulticodecTopology(topology), | ||
| 'topology must be an instance of interfaces/topology') | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cool, that works :) |
||
|
|
||
| // Create topology | ||
| const id = (parseInt(Math.random() * 1e9)).toString(36) + Date.now() | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.