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

Conversation

@intricate
Copy link
Contributor

Description

An error, GeneratedSecrets missing from Genesis.Config, is thrown when trying to make use of the cardano-keygen tool.

It was found that we attempt to extract a Maybe GeneratedSecrets from the config (and throw if it is Nothing) before we even know which command was specified by the user. Because the configGeneratedSecrets field is always set to Nothing in the GCSrc case, the error will always be thrown whenever trying to make use of cardano-keygen with a config which makes use of a GCSrc.

Therefore, the solution would be that, since GeneratedSecrets is only required for the generate-keys-by-spec command, we should only attempt to extract GeneratedSecrets in the GenerateKeysBySpec case. This also means that the generate-keys-by-spec command can only be used with a config which makes use of a GCSpec.

Linked issue

https://iohk.myjetbrains.com/youtrack/issue/RCD-38

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.

Testing checklist

  • I have added tests to cover my changes.
  • All new and existing tests passed.

QA Steps

Screenshots (if available)

@intricate intricate self-assigned this Nov 1, 2018
Copy link
Contributor

@ruhatch ruhatch left a comment

Choose a reason for hiding this comment

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

Beautiful PR!

Copy link
Contributor

@CodiePP CodiePP left a comment

Choose a reason for hiding this comment

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

Great! this solves the problem with cardano-keygen
compiled and tested on this branch.

@CodiePP
Copy link
Contributor

CodiePP commented Nov 1, 2018

another PR against develop with this exact changes (cherry-picked commit) should also be opened.

@intricate intricate merged commit 9690c4f into release/2.0.0 Nov 1, 2018
@intricate intricate deleted the intricate/RCD-38/missing-GeneratedSecrets branch November 1, 2018 19:56
@KtorZ KtorZ mentioned this pull request Jan 4, 2019
12 tasks
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.

4 participants