This repository was archived by the owner on Aug 18, 2020. It is now read-only.
some cleanups in preparation for adding new functionalities #3743
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Most of this PR consists of refactorings that don't change functionality.
The motivations for this PR are to clean up parts of the code and to make it easier to add new features.
Changes:
Main.hs
: has been reduced to a minimum to make it easy to read and modifiy.Functions that are related to the RandomStateWalk have been moved to that module.
Functions for setting up the
WalletClient
have been moved toSetupTestEnv.hs
.SetupTestEnv.hs
exports exports
setupClient :: CLIOptions -> IO (WalletClient IO, Manager)
which has been inlined in
main :: IO ()
before.setupClient
is needed to run tests and single queries from the REPL.Functions.hs
/RandomStateWalk.hs
The module
Functions.hs
has been renamed toRandomStateWalk.hs
.some weeks ago some 5 lines have been added to
Functions.hs
that do not deal with the random state walk. these have been moved toUtils.hs
With this change the module
RandomStateWalk.hs
contains all random-state-walk code and nothing else.The random-state-walk has been disabled some weeks ago is dead code (is compiled but does not run)
There is also one breaking change in the way arguments are forwarded to HSpec.
The wallet integration tests now uses
--hspec-options
to pass options to HSpec.For example:
Motivation :
The old version defined local options
--seed
and--match
which are then repacked and passed to HSpec.Problems with the old approach:
--seed
and--match
are indeed HSpec options. (its not clear where to lookup the documentation etc)useful options of HSpec
2 lines for one option, 4 lines for two option, 8 lines for three options...
it makes it difficult to add new options.
Linked issue
CO-424
Type of change
Developer checklist
Testing checklist
QA Steps
Screenshots (if available)