chore: store self protocols in protobook#760
Merged
vasco-santos merged 2 commits into0.30.xfrom Oct 27, 2020
Merged
Conversation
d42da6c to
f6ccca0
Compare
8f40eb6 to
72fe150
Compare
f6ccca0 to
a263547
Compare
628cbce to
24a16df
Compare
24a16df to
bb6e463
Compare
jacobheun
approved these changes
Oct 27, 2020
Contributor
jacobheun
left a comment
There was a problem hiding this comment.
overall looks good, just some nits in the tests
test/peer-store/proto-book.spec.js
Outdated
| if (changeTrigger === 0 && arraysAreEqual(protocols, finalProtocols)) { | ||
| defer.resolve() | ||
| } | ||
| }) |
Contributor
There was a problem hiding this comment.
just a nit, you could pass a sinon spy as the event handler, then you could validate the emitted data after each update. Then you dont have to deal with the trigger counter.
test/peer-store/proto-book.spec.js
Outdated
| // Wait 50ms for incorrect second event | ||
| setTimeout(() => { | ||
| defer.resolve() | ||
| }, 50) |
Contributor
There was a problem hiding this comment.
spy as the handler would also avoid you needing to use a timeout here
Co-authored-by: Jacob Heun <jacobheun@gmail.com>
106ddfa to
102ccd3
Compare
vasco-santos
added a commit
that referenced
this pull request
Nov 9, 2020
vasco-santos
added a commit
that referenced
this pull request
Dec 10, 2020
vasco-santos
added a commit
that referenced
this pull request
Dec 16, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR stores the self protocols in the Protobook on
handle/unhandle.This allows the identify service to be consistent, by tracking self protocols change in the same way as #748 does for multiaddrs.
Protobook.removeAPI method was added for the unhandle.Needs: