Skip to content
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

Add setIdentity Method #62

Merged
merged 1 commit into from Jul 31, 2019
Merged

Add setIdentity Method #62

merged 1 commit into from Jul 31, 2019

Conversation

oed
Copy link
Contributor

@oed oed commented Jul 30, 2019

This PR adds a new method to the base store class for setting the identity to be used. It currently relies on an unreleased feature in ipfs-log. orbitdb/ipfs-log#260

Looks like there are no tests for this library :)

@@ -149,6 +149,10 @@ class Store {
return this._replicationStatus
}

setIdentity (identity) {
this._oplog.setIdentity(identity)
Copy link
Member

@shamb0t shamb0t Jul 30, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should need a this.identity = identity here as well, as this.identity is used elsewhere (when the db is dropped and when loading the db for example)

Copy link
Contributor Author

@oed oed Jul 30, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, totally forgot to do that!

@shamb0t
Copy link
Member

@shamb0t shamb0t commented Jul 30, 2019

Thanks for following up @oed! I think we still need to reset the identity variable and we should use another unique string for the Index key here and here, maybe this.address.root? What do you think?

@oed
Copy link
Contributor Author

@oed oed commented Jul 30, 2019

Good point, yeah I think this.address.root makes much more sense :)

@oed
Copy link
Contributor Author

@oed oed commented Jul 30, 2019

@shamb0t Alright, pushed a fix to those comments!

@shamb0t
Copy link
Member

@shamb0t shamb0t commented Jul 31, 2019

Thank you @oed ! LGTM 👍

Re: tests, added some here which pass locally orbitdb/orbit-db#658

@shamb0t shamb0t merged commit ddf234c into orbitdb:master Jul 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants