-
Notifications
You must be signed in to change notification settings - Fork 238
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
Clean up DHT test helpers #928
Conversation
v2/routing.go
Outdated
} | ||
|
||
// PutValueLocal stores a value in the local datastore without querying the network. | ||
func (d *DHT) PutValueLocal(ctx context.Context, key string, value []byte) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rather unexport and only export when it's needed to decrease API surface?
v2/routing.go
Outdated
} | ||
|
||
// GetValueLocal retrieves a value from the local datastore without querying the network. | ||
func (d *DHT) GetValueLocal(ctx context.Context, key string) ([]byte, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rather unexport and only export when it's needed to decrease API surface?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
v2/routing_test.go
Outdated
_, pub, _ := crypto.GenerateEd25519Key(rng) | ||
v, err := crypto.MarshalPublicKey(pub) | ||
require.NoError(t, err) | ||
|
||
id, err := peer.IDFromPublicKey(pub) | ||
require.NoError(t, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in handlers_test.go
is a newPeerID
function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice. I'd like to consolidate all these helpers
For #912