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

Refactoring to depend on nodeDB interface #21

Conversation

rohanspersonalgit
Copy link
Collaborator

Currently a work in progress, just PRing to get some feedback on progress.
Description: This PR changes immutable_tree and mutable_tree to depend on a NodeDB interface instead of concrete implementation. As a result lots of new getter/setters are introduced and other function signatures changed. In addition to this unit tests for mutable_tree have been changed to mock nodeDB rather then relying on the concrete implementation.

Issue: #15

saveFastNodeUnlocked(node *FastNode, shouldAddToCache bool) error
Has(hash []byte) (bool, error)
SaveBranch(node *Node) []byte
resetBatch() error
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the PR. Just a quick note. We should only be adding exported methods to the interface. If there are places where we call unexported methods of nodedb (such as immutable tree, that should be fixed by either:

  • finding an exported method to accomplish the task
  • exporting the private method

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