Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Remove DB init need to use public key subcommand #1049

Conversation

NicolasMassart
Copy link
Contributor

PR description

Remove the need to initialise the database when running public key subcommands.

A functional interface is introduced for the keypar loader from file to enable testing of the subcommand by injecting a predefined keypair. The injection takes place in the PantheonCommand class as a method that can be overridden in the test extension of the class.
Unit tests are updated.

Fixed Issue(s)

fixes PAN-2259

…tabase

Creation of the database is useless at this stage, so don't create it as it's
usually necessary to remove it if created as we want to use the output of
this subcommand to change the genesis that makes the created database useless.
@NicolasMassart NicolasMassart added the enhancement New feature or request label Mar 5, 2019
@NicolasMassart NicolasMassart self-assigned this Mar 5, 2019
Copy link
Contributor

@mbaxter mbaxter left a comment

Choose a reason for hiding this comment

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

One style nit, but otherwise LGTM!

}

@Override
public void run() {
spec.commandLine().usage(out);
}

@FunctionalInterface
public interface KeyLoader {
Copy link
Contributor

Choose a reason for hiding this comment

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

(style) Usually internal classes / interfaces go at the bottom of the class

@NicolasMassart NicolasMassart merged commit 4d4b89c into PegaSysEng:master Mar 6, 2019
@NicolasMassart NicolasMassart deleted the feature/PAN-2259_no_DB_needed_to_export_keys branch March 12, 2019 16:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants