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

mining: Move to internal. #2275

Merged
merged 2 commits into from Jul 21, 2020
Merged

mining: Move to internal. #2275

merged 2 commits into from Jul 21, 2020

Conversation

davecgh
Copy link
Member

@davecgh davecgh commented Jul 19, 2020

This requires #2274.

This makes the mining package an internal package such that it will no longer be an exported module. The only place its functionality is really needed is for the internal implementation of dcrd itself and thus having an unnecessary exported module significantly increases the maintenance burden.

This is part of the overall effort to reduce the total number of modules and eventually get to the point it will be possible to follow semver for the root module.

It is worth noting that there are a few constants, which will be listed below, that were exported from this module that callers might have previously relied upon. However, due to previous discussions about the goal of removing the module, a code search has revealed that there are no known callers that still rely on them.

The aforementioned constants are:

  • UnminedHeight
  • MinHighPriority

Overview of the major changes:

  • Move the following files from mining -> internal/mining:
    • README.md
    • cpuminer.go
    • doc.go
    • miningerror.go -> error.go
    • log.go
    • mining.go
    • mining_test.go
    • policy.go
    • policy_test.go
  • Remove mining/go.mod and mining/go.sum
  • Make the README.md and doc.go files match the new reality
  • Update all import paths in the repository accordingly
  • Remove the dependency from the root go.mod
  • Run go mod tidy on all modules

Copy link
Member

@dnldd dnldd left a comment

Choose a reason for hiding this comment

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

Looks good.

This makes the mining package an internal package such that it will no
longer be an exported module.  The only place its functionality is
really needed is for the internal implementation of dcrd itself and thus
having an unnecessary exported module significantly increases the
maintenance burden.

This is part of the overall effort to reduce the total number of modules
and eventually get to the point it will be possible to follow semver for
the root module.

It is worth noting that there are a few constants, which will be listed
below, that were exported from this module that callers might have
previously relied upon.  However, due to previous discussions about the
goal of removing the module, a code search has revealed that there are
no known callers that still rely on them.

The aforementioned constants are:

- UnminedHeight
- MinHighPriority

Overview of the major changes:

- Move the following files from mining -> internal/mining:
  - README.md
  - cpuminer.go
  - doc.go
  - miningerror.go -> error.go
  - log.go
  - mining.go
  - mining_test.go
  - policy.go
  - policy_test.go
- Remove mining/go.mod and mining/go.sum
- Make the README.md and doc.go files match the new reality
- Update all import paths in the repository accordingly
- Remove the dependency from the root go.mod
- Run go mod tidy on all modules
@davecgh davecgh merged commit 3a88a1b into decred:master Jul 21, 2020
@davecgh davecgh deleted the mining_internal branch July 21, 2020 17:30
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.

None yet

5 participants