Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

[CDEC-505] Move Pos.Core.Update to Pos.Chain.Update #3611

Merged
merged 1 commit into from
Sep 17, 2018

Conversation

ruhatch
Copy link
Contributor

@ruhatch ruhatch commented Sep 17, 2018

Description

Last step of CDEC-505, moving Pos.Core.Update module set to the chain package

Linked issue

CDEC-505

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)
  • 🏭 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 document, and my code follows the code style of this project.
  • If my code deals with exceptions, it follows the guidelines.
  • I have updated any documentation accordingly, if needed. Documentation changes can be reflected in opening a PR on cardanodocs.com, amending the inline Haddock comments, any relevant README file or one of the document listed in the 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.
  • All new and existing tests passed.

QA Steps

Screenshots (if available)


instance Arbitrary SystemTag where
arbitrary =
oneof . map (pure . SystemTag) $
Copy link
Contributor

Choose a reason for hiding this comment

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

oneof . map pure === elements ::: [a] -> Gen a

instance Arbitrary SystemTag where
arbitrary =
oneof . map (pure . SystemTag) $
[os <> arch | os <- ["win", "linux", "mac"], arch <- ["32", "64"]]
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it is prejudice, but I'd rather see liftA2 mappend ["win", "linux", "mac"] ["32", "64] than a list comprehension

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, or (<>) <$> ["win", "linux", "mac"] <*> ["32", "64"]

genSystemTag = SystemTag <$> Gen.text (Range.constant 0 10) Gen.alphaNum

genUpAttributes :: Gen UpAttributes
genUpAttributes = pure $ mkAttributes ()
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems wrong. This is only going to test "empty" attributes. Are those the only attributes we ever have in the system with this type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So far yes - the Attributes type is for extending records that are stored in the blockchain

Copy link
Contributor

Choose a reason for hiding this comment

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

Neat

-- <*> genUpId
-- <*> Gen.bool
-- <*> genSignature ((,) <$> genUpId <*> Gen.bool)
-- genUpdateVote pm = mkUpdateVote pm <$> arbitrary <*> arbitrary <*> arbitrary
Copy link
Contributor

Choose a reason for hiding this comment

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

Dead code?

@ruhatch ruhatch merged commit a791f11 into develop Sep 17, 2018
@ruhatch ruhatch deleted the ruhatch/CDEC-505 branch September 17, 2018 19:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants