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

client: fix config object issue #694

Merged
merged 4 commits into from
Dec 18, 2024
Merged

client: fix config object issue #694

merged 4 commits into from
Dec 18, 2024

Conversation

ScottyPoi
Copy link
Collaborator

This fixes an issue where discv5 was not being instantiated with configuration options set during PortalNetwork.create.

We define a defaultConfig object for PortalNetwork.create, and modify it using args passed to the function like this:

const config = { ...defaultConfig, ...opts.config }

However, this was not effectively combining configuration options set specifically for discv5 which were in nested object config.config.

To fix this, we add this line after the one above:

config.config = { ...defaultConfig.config, ...opts.config.config }

This solves the issue, and now discv5 starts with the expected configuration.

Copy link
Collaborator

@acolytec3 acolytec3 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@acolytec3 acolytec3 left a comment

Choose a reason for hiding this comment

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

Added one additional opt update where the shouldRefresh opt wasn't being populated in the create function.

@ScottyPoi ScottyPoi merged commit 5e475e2 into master Dec 18, 2024
5 checks passed
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.

2 participants