From 85e1216d8265e2fb9f9a26e7524ab53f0c98fe42 Mon Sep 17 00:00:00 2001 From: Dmitry Balashov <43530070+0x009922@users.noreply.github.com> Date: Thu, 21 Dec 2023 10:00:45 +0700 Subject: [PATCH] [refactor]: use `Partial`/`Full` terminology Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com> --- cli/src/lib.rs | 2 +- config/src/genesis.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cli/src/lib.rs b/cli/src/lib.rs index 6be4f80ff92..d4c6290ff17 100644 --- a/cli/src/lib.rs +++ b/cli/src/lib.rs @@ -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 diff --git a/config/src/genesis.rs b/config/src/genesis.rs index 0b0e7ae75b4..b6881ac4d65 100644 --- a/config/src/genesis.rs +++ b/config/src/genesis.rs @@ -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 @@ -61,14 +61,14 @@ impl Configuration { /// See [`ParseError`] pub fn parse(self, submit: bool) -> Result { 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, })