As per title. This is the first PR of a series of 2.
Along with the refactoring it adds a function `whenAcquireWrite` which will be used to ensure that the code to consolidate blunds into epoch files is not re-entered (ie only one thread is allow to consolidate blunds).
## Linked issue
## Type of change
— [ ] 🐞 Bug fix (non-breaking change which fixes an issue)
— [x] 🛠 New feature (non-breaking change which adds functionality)
— [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to change)
— [x] 🏭 Refactoring that does not change existing functionality but does improve things like code readability, structure etc
— [ ] 🔨 New or improved tests for existing code
— [ ] ⛑ git-flow chore (backport, hotfix, etc)
## Developer checklist
— [ ] I have read the [style guide](https://github.com/input-output-hk/cardano-sl/blob/develop/docs/style-guide.md) document, and my code follows the code style of this project.
— [ ] If my code deals with exceptions, it follows the [guidelines](https://github.com/input-output-hk/cardano-sl/blob/develop/docs/exceptions.md).
— [ ] I have updated any documentation accordingly, if needed. Documentation changes can be reflected in opening a PR on [cardanodocs.com](https://github.com/input-output-hk/cardanodocs.com), amending the inline [Haddock](https://www.haskell.org/haddock/) comments, any relevant README file or one of the document listed in the [docs](https://github.com/input-output-hk/cardano-sl/tree/develop/docs) directory.
— [ ] CHANGELOG entry has been added and is linked to the correct PR on GitHub.
## Testing checklist
— [ ] I have added tests to cover my changes.
— [x] All new and existing tests passed.
## QA Steps
## Screenshots (if available)
You can view, comment on, or merge this pull request online at:
— Commit Summary —
* CDEC-494: Pos.Util…RWLock: Add whenAcquireWrite
* CDEC-494: Rename getEpochBlockOffset to getEpochBlundOffset
* CDEC-494: Rearrange Pos.DB.Block to prepare for consolidation
— File Changes —
M db/cardano-sl-db.cabal (1)
M db/src/Pos/DB/Block.hs (268)
A db/src/Pos/DB/Block/Internal.hs (290)
M db/src/Pos/DB/Epoch/Index.hs (6)
M db/test/Test/Pos/DB/Epoch/Index.hs (2)
M util/Pos/Util/Concurrent/RWLock.hs (11)
— Patch Links —