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

Conversation

@oed
Copy link
Contributor

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)

This comment has been minimized.

Copy link
@shamb0t

shamb0t Jul 30, 2019

Member

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)

This comment has been minimized.

Copy link
@oed

oed Jul 30, 2019

Author Contributor

Good catch, totally forgot to do that!

@shamb0t

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Contributor Author

oed commented Jul 30, 2019

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

@oed oed force-pushed the 3box:feat/set-identity branch from 54a3e50 to 862e0a2 Jul 30, 2019
@oed

This comment has been minimized.

Copy link
Contributor Author

oed commented Jul 30, 2019

@shamb0t Alright, pushed a fix to those comments!

@shamb0t shamb0t mentioned this pull request Jul 31, 2019
@shamb0t

This comment has been minimized.

Copy link
Member

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
Projects
None yet
2 participants
You can’t perform that action at this time.