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

rm unnecessary import dependency from statecouchdb package #966

Merged
merged 1 commit into from
Apr 7, 2020

Conversation

cendhu
Copy link
Contributor

@cendhu cendhu commented Mar 31, 2020

Type of change

  • Improvement (improvement to code)

Description

The statecouchdb package should not be dependent on too many other packages. It should be self-sufficient. Currently, we have imported ccprovider just for a struct. Further, the test file imports a ccprovider to call a utility function. As these are not justifiable, we remove it and duplicate code as needed.

Additional details

In the ledger refactoring work, we plan to merge the following packages to reduce the folder depth

  • merge kvledger with the ledger package
  • merge lockbasedtxmgr to txmgr
  • many more

Due to some unnecessary import dependency, we get import cycles in the refactoring process. Hence, we remove one such unnecessary dependency from the statecouchdb package. In the upcoming PR, we will move structs that are used across packages from core/ledger to internal/pkg/ledger. This will also help us reduce the import cycles and do the refactoring without any blockers.

Related issues

FAB-17699

@cendhu cendhu requested a review from a team as a code owner March 31, 2020 20:27
@cendhu cendhu changed the title rm unnecessary import dependency from statecouchdb package [DONT MERGE] rm unnecessary import dependency from statecouchdb package Apr 1, 2020
@cendhu cendhu changed the title [DONT MERGE] rm unnecessary import dependency from statecouchdb package [WIP] rm unnecessary import dependency from statecouchdb package Apr 1, 2020
@cendhu cendhu force-pushed the rm-unnecessary-dep branch from 18e4f5b to 1a26e63 Compare April 2, 2020 14:37
@cendhu cendhu changed the title [WIP] rm unnecessary import dependency from statecouchdb package rm unnecessary import dependency from statecouchdb package Apr 2, 2020
@cendhu cendhu force-pushed the rm-unnecessary-dep branch 2 times, most recently from 36c200b to 2dfe4ba Compare April 6, 2020 17:15
manish-sethi
manish-sethi previously approved these changes Apr 6, 2020
The statecouchdb package should not be dependent on too many
other packages. It should be self-sufficient. Currently, we
have imported ccprovider just for a struct. Further, the test
imports ccprovider to use a function. As these are not
justified, we remove it.

Given that we pass map[string][]byte to the function that
processes the index data, we don't need to create a tarFile.

Signed-off-by: senthil <cendhu@gmail.com>
@cendhu
Copy link
Contributor Author

cendhu commented Apr 7, 2020

@manish-sethi fixed conflicts.

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.

3 participants