Сryptocurrency development analysis

Description

Remove the `HasProtocolConstants` constraint and replace it with explicit parameters. For testing code we use the `dummyProtocolConstants` defined in `Test.Pos.Core.Dummy`.

## Linked issue

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

## 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/3133

— Commit Summary —

* [CDEC-369] Remove HasProtocolConstants in favour of parameters

— File Changes —

M auxx/Main.hs (95)
M auxx/src/Command/BlockGen.hs (51)
M auxx/src/Command/Proc.hs (50)
M auxx/src/Command/Rollback.hs (64)
M auxx/src/Command/Tx.hs (68)
M auxx/src/Mode.hs (40)
M auxx/src/Plugin.hs (55)
M block/bench/Block.hs (13)
M block/src/Pos/Block/BHelpers.hs (14)
M block/src/Pos/Block/BListener.hs (7)
M block/src/Pos/Block/Logic/Creation.hs (180)
M block/src/Pos/Block/Logic/Header.hs (41)
M block/src/Pos/Block/Logic/Integrity.hs (22)
M block/src/Pos/Block/Logic/Internal.hs (77)
M block/src/Pos/Block/Logic/Util.hs (49)
M block/src/Pos/Block/Logic/VAR.hs (64)
M block/src/Pos/Block/Lrc.hs (30)
M block/src/Pos/Block/Network/Logic.hs (240)
M block/src/Pos/Block/Network/Retrieval.hs (69)
M block/src/Pos/Block/Slog/Context.hs (16)
M block/src/Pos/Block/Slog/Logic.hs (34)
M block/src/Pos/Block/Slog/Types.hs (20)
M block/src/Pos/Block/Types.hs (24)
M block/src/Pos/Block/Worker.hs (219)
M block/src/Pos/GState/BlockExtra.hs (28)
M block/test/Test/Pos/Block/Arbitrary.hs (84)
M block/test/Test/Pos/Block/Arbitrary/Generate.hs (15)
M block/test/Test/Pos/Block/Arbitrary/Message.hs (13)
M client/cardano-sl-client.cabal (1)
M client/src/Pos/Client/Txp/Addresses.hs (6)
M client/src/Pos/Client/Txp/History.hs (27)
M client/src/Pos/Client/Txp/Network.hs (18)
M client/src/Pos/Client/Txp/Util.hs (100)
M client/test/Test/Pos/Client/Txp/Mode.hs (8)
M client/test/Test/Pos/Client/Txp/UtilSpec.hs (47)
M core/cardano-sl-core.cabal (2)
M core/src/Pos/Core/Block/Constructors.hs (7)
M core/src/Pos/Core/Configuration.hs (15)
D core/src/Pos/Core/Configuration/Protocol.hs (69)
M core/src/Pos/Core/Genesis/Generate.hs (19)
M core/src/Pos/Core/ProtocolConstants.hs (51)
M core/src/Pos/Core/Slotting/EpochOrSlot.hs (119)
M core/src/Pos/Core/Slotting/LocalSlotIndex.hs (79)
M core/src/Pos/Core/Slotting/SlotId.hs (71)
M core/test/Test/Pos/Core/Arbitrary.hs (38)
M core/test/Test/Pos/Core/Arbitrary/Unsafe.hs (5)
M core/test/Test/Pos/Core/CborSpec.hs (5)
A core/test/Test/Pos/Core/Dummy.hs (25)
M core/test/Test/Pos/Core/SlottingSpec.hs (95)
M core/test/cardano-sl-core-test.cabal (1)
M explorer/bench/Bench/Pos/Explorer/ServerBench.hs (10)
M explorer/cardano-sl-explorer.cabal (2)
M explorer/src/Pos/Explorer/BListener.hs (6)
M explorer/src/Pos/Explorer/DB.hs (17)
M explorer/src/Pos/Explorer/ExplorerMode.hs (21)
M explorer/src/Pos/Explorer/Socket/App.hs (33)
M explorer/src/Pos/Explorer/Socket/Methods.hs (22)
M explorer/src/Pos/Explorer/TestUtil.hs (44)
M explorer/src/Pos/Explorer/Txp/Global.hs (12)
M explorer/src/Pos/Explorer/Txp/Local.hs (63)
M explorer/src/Pos/Explorer/Web/ClientTypes.hs (29)
M explorer/src/Pos/Explorer/Web/Server.hs (76)
M explorer/src/Pos/Explorer/Web/Transform.hs (23)
M explorer/src/explorer/Main.hs (75)
M explorer/test/Test/Pos/Explorer/Web/ServerSpec.hs (11)
M generator/cardano-sl-generator.cabal (2)
M generator/src/Pos/Generator/Block/Logic.hs (114)
M generator/src/Pos/Generator/Block/Mode.hs (44)
M generator/src/Pos/Generator/Block/Payload.hs (14)
M generator/src/Pos/Generator/BlockEvent.hs (21)
M generator/src/Pos/Generator/BlockEvent/DSL.hs (12)
M generator/src/Test/Pos/Block/Logic/Event.hs (23)
M generator/src/Test/Pos/Block/Logic/Mode.hs (63)
M generator/src/Test/Pos/Block/Logic/Util.hs (44)
M generator/test/Test/Pos/Binary/CommunicationSpec.hs (11)
M generator/test/Test/Pos/Block/Logic/CreationSpec.hs (171)
M generator/test/Test/Pos/Block/Logic/VarSpec.hs (153)
M generator/test/Test/Pos/Generator/Block/LrcSpec.hs (69)
M infra/Pos/Infra/DHT/Workers.hs (53)
M infra/Pos/Infra/Recovery/Info.hs (31)
M infra/Pos/Infra/Slotting/Class.hs (14)
M infra/Pos/Infra/Slotting/Impl/Simple.hs (70)
M infra/Pos/Infra/Slotting/Impl/Util.hs (40)
M infra/Pos/Infra/Slotting/Util.hs (81)
M infra/Pos/Infra/Util/JsonLog/Events.hs (32)
M lib/bench/Bench/Pos/Diffusion/BlockDownload.hs (17)
M lib/src/Pos/DB/DB.hs (22)
M lib/src/Pos/GState/GState.hs (9)
M lib/src/Pos/Launcher/Configuration.hs (13)
M lib/src/Pos/Launcher/Launcher.hs (23)
M lib/src/Pos/Launcher/Mode.hs (20)
M lib/src/Pos/Launcher/Resource.hs (54)
M lib/src/Pos/Launcher/Runner.hs (26)
M lib/src/Pos/Launcher/Scenario.hs (17)
M lib/src/Pos/Logic/Full.hs (137)
M lib/src/Pos/Recovery/Instance.hs (14)
M lib/src/Pos/WorkMode.hs (23)
M lib/src/Pos/Worker.hs (12)
M lib/src/Test/Pos/Configuration.hs (11)
M lib/test/Test/Pos/Block/Identity/SafeCopySpec.hs (3)
M lib/test/Test/Pos/Cbor/CborSpec.hs (2)
M lib/test/Test/Pos/Diffusion/BlockSpec.hs (13)
M lib/test/Test/Pos/Genesis/CanonicalSpec.hs (3)
M lib/test/Test/Pos/Ssc/ComputeSharesSpec.hs (2)
M lib/test/Test/Pos/Ssc/Toss/BaseSpec.hs (29)
M lib/test/Test/Pos/Ssc/Toss/PureSpec.hs (4)
M lib/test/Test/Pos/Ssc/VssCertDataSpec.hs (17)
M lib/test/Test/Pos/Types/BlockSpec.hs (29)
M lib/test/Test/Pos/Types/Identity/SafeCopySpec.hs (3)
M lib/test/Test/Pos/Update/PollSpec.hs (22)
M lrc/src/Pos/Lrc/DB/Leaders.hs (32)
M lrc/src/Pos/Lrc/Fts.hs (9)
M lrc/src/Pos/Lrc/Genesis.hs (17)
M lrc/test/Test/Pos/Lrc/FtsSpec.hs (33)
M node/Main.hs (11)
M node/cardano-sl-node.cabal (1)
M ssc/Pos/Arbitrary/Ssc.hs (23)
M ssc/Pos/Ssc/Base.hs (96)
M ssc/Pos/Ssc/Functions.hs (39)
M ssc/Pos/Ssc/Logic/Local.hs (98)
M ssc/Pos/Ssc/Logic/VAR.hs (61)
M ssc/Pos/Ssc/State.hs (15)
M ssc/Pos/Ssc/State/Global.hs (13)
M ssc/Pos/Ssc/State/Local.hs (31)
M ssc/Pos/Ssc/Toss/Base.hs (59)
M ssc/Pos/Ssc/Toss/Class.hs (10)
M ssc/Pos/Ssc/Toss/Logic.hs (85)
M ssc/Pos/Ssc/Toss/Pure.hs (16)
M ssc/Pos/Ssc/Toss/Trans.hs (2)
M ssc/Pos/Ssc/Toss/Types.hs (24)
M ssc/Pos/Ssc/Worker.hs (181)
M tools/src/blockchain-analyser/Main.hs (2)
M tools/src/dbgen/Main.hs (16)
M tools/src/keygen/Main.hs (23)
M tools/src/launcher/Main.hs (2)
M txp/src/Pos/Txp/Logic/Local.hs (74)
M txp/src/Pos/Txp/MemState/Class.hs (6)
M txp/src/Pos/Txp/Network/Listeners.hs (25)
M txp/test/Test/Pos/Txp/Toil/UtxoSpec.hs (8)
M update/src/Pos/Update/Context.hs (14)
M update/src/Pos/Update/DB.hs (15)
M update/src/Pos/Update/Logic/Global.hs (38)
M update/src/Pos/Update/Logic/Local.hs (32)
M update/src/Pos/Update/MemState/Types.hs (12)
M update/src/Pos/Update/Network/Listeners.hs (17)
M update/src/Pos/Update/Poll/Logic/Apply.hs (47)
M update/src/Pos/Update/Poll/Logic/Base.hs (22)
M update/src/Pos/Update/Poll/Logic/Softfork.hs (28)
M update/src/Pos/Update/Worker.hs (28)
M update/test/Test/Pos/Update/Arbitrary/Poll.hs (13)
M wallet-new/cardano-sl-wallet-new.cabal (3)
M wallet-new/server/Main.hs (38)
M wallet-new/src/Cardano/Wallet/API/V0/Handlers.hs (6)
M wallet-new/src/Cardano/Wallet/API/V1/LegacyHandlers.hs (8)
M wallet-new/src/Cardano/Wallet/API/V1/LegacyHandlers/Transactions.hs (19)
M wallet-new/src/Cardano/Wallet/API/V1/LegacyHandlers/Wallets.hs (17)
M wallet-new/src/Cardano/Wallet/Kernel/Mode.hs (13)
M wallet-new/src/Cardano/Wallet/LegacyServer.hs (13)
M wallet-new/src/Cardano/Wallet/Server/Plugins.hs (22)
M wallet-new/test/DevelopmentSpec.hs (2)
M wallet-new/test/WalletHandlersSpec.hs (39)
M wallet-new/test/unit/Test/Spec/Submission.hs (63)
M wallet-new/test/unit/UTxO/Context.hs (4)
M wallet-new/test/unit/UTxO/Interpreter.hs (5)
M wallet-new/test/unit/UTxO/Translate.hs (15)
M wallet-new/test/unit/UTxO/Verify.hs (14)
M wallet/cardano-sl-wallet.cabal (1)
M wallet/src/Pos/Wallet/Redirect.hs (25)
M wallet/src/Pos/Wallet/Web/Methods/Misc.hs (15)
M wallet/src/Pos/Wallet/Web/Methods/Payment.hs (50)
M wallet/src/Pos/Wallet/Web/Methods/Redeem.hs (25)
M wallet/src/Pos/Wallet/Web/Methods/Txp.hs (6)
M wallet/src/Pos/Wallet/Web/Mode.hs (24)
M wallet/src/Pos/Wallet/Web/Pending/Functions.hs (29)
M wallet/src/Pos/Wallet/Web/Pending/Submission.hs (9)
M wallet/src/Pos/Wallet/Web/Pending/Util.hs (20)
M wallet/src/Pos/Wallet/Web/Pending/Worker.hs (71)
M wallet/src/Pos/Wallet/Web/Server/Handlers.hs (31)
M wallet/src/Pos/Wallet/Web/Server/Launcher.hs (12)
M wallet/src/Pos/Wallet/Web/Server/Runner.hs (17)
M wallet/src/Pos/Wallet/Web/State/State.hs (38)
M wallet/src/Pos/Wallet/Web/Tracking/BListener.hs (27)
M wallet/src/Pos/Wallet/Web/Tracking/Sync.hs (43)
M wallet/test/Test/Pos/Wallet/Web/AddressSpec.hs (8)
M wallet/test/Test/Pos/Wallet/Web/Methods/BackupDefaultAddressesSpec.hs (2)
M wallet/test/Test/Pos/Wallet/Web/Methods/LogicSpec.hs (2)
M wallet/test/Test/Pos/Wallet/Web/Methods/PaymentSpec.hs (8)
M wallet/test/Test/Pos/Wallet/Web/Mode.hs (16)
M wallet/test/Test/Pos/Wallet/Web/Tracking/SyncSpec.hs (13)
M wallet/test/Test/Pos/Wallet/Web/Util.hs (5)

— Patch Links —

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

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