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

chore: refactor NewWakuRest #859

Closed
richard-ramos opened this issue Nov 2, 2023 · 0 comments
Closed

chore: refactor NewWakuRest #859

richard-ramos opened this issue Nov 2, 2023 · 0 comments
Assignees

Comments

@richard-ramos
Copy link
Member

This function receives way too many parameters. It probably makes sense to extract these to a struct that acts as a config and pass that instead

func NewWakuRest(node *node.WakuNode, address string, port int, enablePProf bool, enableAdmin bool, relayCacheCapacity int, log *zap.Logger) *WakuRest {

I'd suggest something like this:

type RestConfig struct {
    Address string
    Port uint
    PProf bool
    RelayCacheCapacity uint
} 

func NewWakuRest(node *node.WakuNode, config *RestConfig, log *zap.Logger) {
...
}
@fryorcraken fryorcraken added this to Waku Nov 2, 2023
@chaitanyaprem chaitanyaprem self-assigned this Nov 7, 2023
@chaitanyaprem chaitanyaprem moved this to Code Review / QA in Waku Nov 7, 2023
@github-project-automation github-project-automation bot moved this from Code Review / QA to Done in Waku Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants