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

store: drop Init function #187

Closed
cristaloleg opened this issue May 29, 2024 · 4 comments
Closed

store: drop Init function #187

cristaloleg opened this issue May 29, 2024 · 4 comments
Assignees

Comments

@cristaloleg
Copy link
Contributor

Looks like this function is just a test helper (used only in 1 place BTW). But also it looks orthogonal to the Store interface which already contains Init method.

I'm proposing to drop this function in favour of NewStoreWithHead which does the initialization.

@cristaloleg
Copy link
Contributor Author

The only thing is that we've 1 usage in celestia-node see nodebuilder/header/constructors.go but this can be easily addressed.

@cristaloleg
Copy link
Contributor Author

After a deeper look looks like we do not use Store.Init properly. By example in celestia-node in cmd/cel-shed/header.go we initialize store manually however Init func can do the same.

I think this issues should be extended to something: store: drop Init function and use Store.Init where appropriate.

WDYT ?

@Wondertan
Copy link
Member

Why not to keep this function for reuse purposes? We already use in one place and as you mentioned we could use it one more place?

@cristaloleg
Copy link
Contributor Author

Yep, after hour of jumping back and forth all over the code looks like there is nothing we can do. We have a way to initialize store via header, via height. Better to leave it as it's for now.

Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants