Skip to content

Commit

Permalink
[refactor]: use Partial/Full terminology
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Balashov <[email protected]>
  • Loading branch information
0x009922 committed Dec 22, 2023
1 parent f111822 commit 85e1216
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ pub fn read_config(
"));
}

let genesis = if let ParsedGenesisConfiguration::Submit {
let genesis = if let ParsedGenesisConfiguration::Full {
key_pair,
raw_block,
} = config
Expand Down
8 changes: 4 additions & 4 deletions config/src/genesis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ impl Default for ConfigurationProxy {
// https://github.com/hyperledger/iroha/issues/3500
pub enum ParsedConfiguration {
/// The peer can only observe the genesis block
Default {
Partial {
/// Genesis account public key
public_key: PublicKey,
},
/// The peer is responsible for submitting the genesis block
Submit {
Full {
/// Genesis account key pair
key_pair: KeyPair,
/// Raw genesis block
Expand All @@ -61,14 +61,14 @@ impl Configuration {
/// See [`ParseError`]
pub fn parse(self, submit: bool) -> Result<ParsedConfiguration, ParseError> {
match (self.private_key, self.file, submit) {
(None, None, false) => Ok(ParsedConfiguration::Default {
(None, None, false) => Ok(ParsedConfiguration::Partial {
public_key: self.public_key,
}),
(Some(private_key), Some(path), true) => {
let raw_block = RawGenesisBlock::from_path(&path)
.map_err(|report| ParseError::File { path, report })?;

Ok(ParsedConfiguration::Submit {
Ok(ParsedConfiguration::Full {
key_pair: KeyPair::new(self.public_key, private_key)?,
raw_block,
})
Expand Down

0 comments on commit 85e1216

Please sign in to comment.