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

Clean up DHT test helpers #928

Merged
merged 3 commits into from
Sep 19, 2023
Merged

Clean up DHT test helpers #928

merged 3 commits into from
Sep 19, 2023

Conversation

iand
Copy link

@iand iand commented Sep 19, 2023

For #912

@iand iand added the v2 All issues related to the v2 rewrite label Sep 19, 2023
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 {
Copy link
Contributor

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) {
Copy link
Contributor

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?

Copy link
Author

Choose a reason for hiding this comment

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

👍

Comment on lines 20 to 25
_, pub, _ := crypto.GenerateEd25519Key(rng)
v, err := crypto.MarshalPublicKey(pub)
require.NoError(t, err)

id, err := peer.IDFromPublicKey(pub)
require.NoError(t, err)
Copy link
Contributor

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

Copy link
Author

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

@iand iand marked this pull request as ready for review September 19, 2023 14:39
@iand iand changed the title Implement GetValue Clean up DHT test helpers Sep 19, 2023
@iand iand merged commit 83329a4 into v2-develop Sep 19, 2023
11 checks passed
@iand iand deleted the v2-routing-getvalue branch September 19, 2023 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v2 All issues related to the v2 rewrite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants