Сryptocurrency development analysis

Description

We want to reduce the size of the `core` package and put everything related to blocks and chains in the `chain` package. This first PR clears the way for that and move the `Pos.Core.Block` modules across.

## Linked issue

[CDEC-485](https://iohk.myjetbrains.com/youtrack/issue/CDEC-485)

## Type of change

— [~] 🐞 Bug fix (non-breaking change which fixes an issue)
— [~] 🛠 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

— [x] 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.
— [x] If my code deals with exceptions, it follows the [guidelines](https://github.com/input-output-hk/cardano-sl/blob/develop/docs/exceptions.md).
— [x] 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.

## 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:

https://github.com/input-output-hk/cardano-sl/pull/3351

— Commit Summary —

* [CDEC-485] Move some JsonLog functions to chain
* [CDEC-485] Move Pos.Core.StateLock to db
* [CDEC-485] Move Pos.Core.Block files to chain

— File Changes —

M auxx/src/Command/Rollback.hs (2)
M chain/bench/block-bench.hs (2)
M chain/cardano-sl-chain.cabal (18)
M chain/src/Pos/Chain/Block.hs (6)
M chain/src/Pos/Chain/Block/BHelpers.hs (12)
R chain/src/Pos/Chain/Block/Blockchain.hs (3)
R chain/src/Pos/Chain/Block/Constructors.hs (14)
M chain/src/Pos/Chain/Block/Error.hs (2)
A chain/src/Pos/Chain/Block/Genesis.hs (12)
R chain/src/Pos/Chain/Block/Genesis/Instances.hs (10)
R chain/src/Pos/Chain/Block/Genesis/Lens.hs (8)
R chain/src/Pos/Chain/Block/Genesis/Types.hs (2)
A chain/src/Pos/Chain/Block/JsonLog.hs (45)
M chain/src/Pos/Chain/Block/Logic/Integrity.hs (12)
A chain/src/Pos/Chain/Block/Main.hs (10)
R chain/src/Pos/Chain/Block/Main/Instances.hs (8)
R chain/src/Pos/Chain/Block/Main/Types.hs (7)
M chain/src/Pos/Chain/Block/Types.hs (2)
A chain/src/Pos/Chain/Block/Union.hs (7)
R chain/src/Pos/Chain/Block/Union/ComponentBlock.hs (8)
R chain/src/Pos/Chain/Block/Union/Types.hs (13)
M chain/src/Pos/Chain/Delegation/Class.hs (2)
M chain/src/Pos/Chain/Delegation/Types.hs (2)
M chain/src/Pos/Chain/Ssc/Functions.hs (2)
M chain/src/Pos/Chain/Ssc/Toss/Logic.hs (2)
M chain/src/Pos/Chain/Ssc/Types.hs (2)
M chain/src/Pos/Chain/Txp/Toil/Failure.hs (2)
M chain/src/Pos/Chain/Update/Poll/Failure.hs (2)
M chain/src/Pos/Chain/Update/Poll/Types.hs (2)
M chain/test/Test/Pos/Chain/Block/Arbitrary.hs (3)
M chain/test/Test/Pos/Chain/Block/Arbitrary/Generate.hs (2)
A chain/test/Test/Pos/Chain/Block/Bi.hs (308)
M chain/test/Test/Pos/Chain/Block/BlockSpec.hs (2)
M chain/test/Test/Pos/Chain/Block/CborSpec.hs (2)
A chain/test/Test/Pos/Chain/Block/Gen.hs (154)
M chain/test/Test/Pos/Chain/Block/SafeCopySpec.hs (2)
M chain/test/cardano-sl-chain-test.cabal (3)
R chain/test/golden/BlockBodyAttributes (0)
R chain/test/golden/BlockHeaderAttributes (0)
R chain/test/golden/BlockHeaderMain (0)
R chain/test/golden/BlockHeader_Genesis (0)
R chain/test/golden/BlockSignature (0)
R chain/test/golden/BlockSignature_Heavy (0)
R chain/test/golden/BlockSignature_Light (0)
R chain/test/golden/GenesisBlockHeader (0)
R chain/test/golden/GenesisBody (0)
R chain/test/golden/GenesisConsensusData (0)
R chain/test/golden/GenesisProof (0)
R chain/test/golden/HeaderHash (0)
R chain/test/golden/MainBlockHeader (0)
R chain/test/golden/MainBody (0)
R chain/test/golden/MainConsensusData (0)
R chain/test/golden/MainExtraBodyData (0)
R chain/test/golden/MainExtraHeaderData (0)
R chain/test/golden/MainProof (0)
R chain/test/golden/MainToSign (0)
M chain/test/test.hs (4)
M client/src/Pos/Client/Txp/History.hs (5)
M core/cardano-sl-core.cabal (17)
D core/src/Pos/Core/Block.hs (14)
D core/src/Pos/Core/Block/Genesis.hs (12)
D core/src/Pos/Core/Block/Main.hs (10)
D core/src/Pos/Core/Block/Union.hs (7)
M core/src/Pos/Core/JsonLog/LogEvents.hs (39)
M core/test/Test/Pos/Core/Bi.hs (292)
M core/test/Test/Pos/Core/Gen.hs (151)
M db/cardano-sl-db.cabal (2)
M db/src/Pos/DB/Block.hs (4)
M db/src/Pos/DB/Block/GState/BlockExtra.hs (2)
M db/src/Pos/DB/Block/Load.hs (4)
M db/src/Pos/DB/Block/Logic/Creation.hs (14)
M db/src/Pos/DB/Block/Logic/Header.hs (2)
M db/src/Pos/DB/Block/Logic/Internal.hs (2)
M db/src/Pos/DB/Block/Logic/Util.hs (2)
M db/src/Pos/DB/Block/Logic/VAR.hs (2)
M db/src/Pos/DB/Block/Slog/Logic.hs (2)
M db/src/Pos/DB/BlockIndex.hs (2)
M db/src/Pos/DB/Class.hs (2)
M db/src/Pos/DB/Delegation/Cede/Logic.hs (2)
M db/src/Pos/DB/Delegation/Logic/Mempool.hs (4)
M db/src/Pos/DB/Delegation/Logic/VAR.hs (2)
M db/src/Pos/DB/Delegation/Var.hs (2)
M db/src/Pos/DB/GState/Common.hs (2)
R db/src/Pos/DB/GState/Lock.hs (6)
M db/src/Pos/DB/Pure.hs (2)
M db/src/Pos/DB/Ssc/Logic/VAR.hs (2)
M db/src/Pos/DB/Txp/Logic/Global.hs (2)
M db/src/Pos/DB/Txp/Logic/Local.hs (6)
M db/src/Pos/DB/Txp/MemState/Class.hs (2)
M db/src/Pos/DB/Txp/MemState/Metrics.hs (2)
M db/src/Pos/DB/Txp/MemState/Types.hs (2)
M db/src/Pos/DB/Txp/Settings.hs (2)
M db/src/Pos/DB/Update/Logic/Global.hs (2)
M db/src/Pos/DB/Update/Logic/Local.hs (4)
M db/src/Pos/DB/Update/MemState/Functions.hs (4)
M db/src/Pos/DB/Update/MemState/Types.hs (2)
M db/src/Pos/DB/Update/Poll/Logic/Apply.hs (2)
M db/src/Pos/DB/Update/Poll/Logic/Base.hs (2)
M db/src/Pos/DB/Update/Poll/Logic/Softfork.hs (2)
M explorer/src/Pos/Explorer/BListener.hs (2)
M explorer/src/Pos/Explorer/Core/Types.hs (2)
M explorer/src/Pos/Explorer/DB.hs (2)
M explorer/src/Pos/Explorer/ExtraContext.hs (2)
M explorer/src/Pos/Explorer/Socket/Methods.hs (2)
M explorer/src/Pos/Explorer/TestUtil.hs (7)
M explorer/src/Pos/Explorer/Txp/Global.hs (2)
M explorer/src/Pos/Explorer/Txp/Toil/Logic.hs (2)
M explorer/src/Pos/Explorer/Web/ClientTypes.hs (2)
M explorer/src/Pos/Explorer/Web/Server.hs (2)
M generator/app/VerificationBench.hs (2)
M generator/bench/Bench/Pos/Criterion/Block/Logic.hs (2)
M generator/src/Pos/Generator/Block/Logic.hs (4)
M generator/src/Pos/Generator/BlockEvent.hs (2)
M generator/src/Test/Pos/Block/Logic/Event.hs (2)
M generator/src/Test/Pos/Block/Logic/Util.hs (2)
M generator/test/Test/Pos/Block/Logic/CreationSpec.hs (2)
M generator/test/Test/Pos/Block/Logic/VarSpec.hs (2)
M generator/test/Test/Pos/Generator/Block/LrcSpec.hs (2)
M infra/src/Pos/Infra/Diffusion/Types.hs (2)
M infra/src/Pos/Infra/Recovery/Types.hs (2)
M infra/src/Pos/Infra/StateLock.hs (2)
M infra/src/Pos/Infra/Util/JsonLog/Events.hs (1)
M lib/bench/Bench/Pos/Diffusion/BlockDownload.hs (4)
M lib/src/Pos/Communication/Limits.hs (2)
M lib/src/Pos/DB/DB.hs (2)
M lib/src/Pos/Diffusion/Full.hs (2)
M lib/src/Pos/Diffusion/Full/Block.hs (2)
M lib/src/Pos/GState/GState.hs (2)
M lib/src/Pos/Logic/Full.hs (2)
M lib/src/Pos/Logic/Pure.hs (2)
M lib/src/Pos/Logic/Types.hs (2)
M lib/src/Pos/Network/Block/Logic.hs (4)
M lib/src/Pos/Network/Block/Retrieval.hs (2)
M lib/src/Pos/Network/Block/RetrievalQueue.hs (2)
M lib/src/Pos/Network/Block/Types.hs (2)
M lib/src/Pos/Web/Api.hs (2)
M lib/src/Pos/Worker/Block.hs (2)
M lib/test/Test/Pos/Diffusion/BlockSpec.hs (4)
M pkgs/default.nix (10)
M tools/src/blockchain-analyser/Main.hs (2)
M tools/src/blockchain-analyser/Rendering.hs (2)
M tools/src/blockchain-analyser/Types.hs (2)
M wallet-new/src/Cardano/Wallet/Kernel/Types.hs (2)
M wallet-new/test/unit/UTxO/Context.hs (2)
M wallet-new/test/unit/UTxO/Interpreter.hs (2)
M wallet-new/test/unit/UTxO/Translate.hs (2)
M wallet-new/test/unit/UTxO/Verify.hs (2)
M wallet/src/Pos/Wallet/Redirect.hs (2)
M wallet/src/Pos/Wallet/Web/State/State.hs (2)
M wallet/src/Pos/Wallet/Web/State/Storage.hs (2)
M wallet/src/Pos/Wallet/Web/State/Transactions.hs (2)
M wallet/src/Pos/Wallet/Web/Tracking/BListener.hs (2)
M wallet/src/Pos/Wallet/Web/Tracking/Modifier.hs (2)
M wallet/src/Pos/Wallet/Web/Tracking/Restore.hs (2)
M wallet/src/Pos/Wallet/Web/Tracking/Sync.hs (2)
M wallet/test/Test/Pos/Wallet/Web/Util.hs (2)

— Patch Links —

https://github.com/input-output-hk/cardano-sl/pull/3351.patch
https://github.com/input-output-hk/cardano-sl/pull/3351.diff

Добавить комментарий