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

Some small fixes to DB.StateMachine module. #349

Merged
merged 9 commits into from
Jun 4, 2019

Conversation

jonathanknowles
Copy link
Member

@jonathanknowles jonathanknowles commented Jun 4, 2019

Issue Number

Issue #154
PR #259

Overview

This PR makes a number of small fixes to the Cardano.Wallet.DB.StateMachine module:

  • Fixes bug where the incorrect tag was returned from createThreeWallets.
  • Uses consistent naming for maps within Mock.
  • Fixes some small typos in Haddock comments.
  • Extracts out some repetitive function applications.
  • Inlines arguments to readAfterDelete (since it was always called with the same arguments).

The `Mock` data type has the convention that each map has a plural name
based on the type of value held within the map. For consistency with
this convention, the map of wallet ids to private keys should also have
a plural name.

Similarly, we can use `pks` to represent a map, but `pk` to represent a
value within a map.
It previously returned `CreateWalletTwice`, but it should return
`CreateThreeWallets`.
This function is always called with the same arguments, so we can safely
inline these arguments.
@jonathanknowles jonathanknowles self-assigned this Jun 4, 2019
@jonathanknowles jonathanknowles merged commit 350b9a8 into master Jun 4, 2019
@iohk-bors iohk-bors bot deleted the jonathanknowles/db-qsm-fixes branch June 4, 2019 09:21
@@ -453,7 +453,6 @@ lockstep m@(Model _ ws) c (At resp) = Event
Generator
-------------------------------------------------------------------------------}

-- NOTE 'concat' reads better.
Copy link
Member

Choose a reason for hiding this comment

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

Note that this comment wasn't obsolete. It gives a justification for disabling hlint below. Hlint suggests to replace use of concat with ++, but concat reads better :)

Copy link
Member

Choose a reason for hiding this comment

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

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.

3 participants