diff --git a/tendermint/src/block/commit_sig.rs b/tendermint/src/block/commit_sig.rs index 35781ab4d..c8b83e9c9 100644 --- a/tendermint/src/block/commit_sig.rs +++ b/tendermint/src/block/commit_sig.rs @@ -41,7 +41,7 @@ impl TryFrom for CommitSig { fn try_from(value: RawCommitSig) -> Result { match value.block_id_flag { - BlockIDFlag::BlockIDFlagAbsent => { + BlockIDFlag::Absent => { if value.timestamp.is_some() && value.timestamp.unwrap() != Time::parse_from_rfc3339("0001-01-01T00:00:00Z").unwrap() @@ -53,7 +53,7 @@ impl TryFrom for CommitSig { } Ok(CommitSig::BlockIDFlagAbsent) } - BlockIDFlag::BlockIDFlagCommit => { + BlockIDFlag::Commit => { if value.timestamp.is_none() { Err("timestamp is missing for BlockIDFlagCommit CommitSig") } else if value.signature.is_none() { @@ -68,7 +68,7 @@ impl TryFrom for CommitSig { }) } } - BlockIDFlag::BlockIDFlagNil => { + BlockIDFlag::Nil => { if value.timestamp.is_none() { Err("timestamp is missing for BlockIDFlagNil CommitSig") } else if value.signature.is_none() { @@ -91,7 +91,7 @@ impl From for RawCommitSig { fn from(commit: CommitSig) -> RawCommitSig { match commit { CommitSig::BlockIDFlagAbsent => RawCommitSig { - block_id_flag: BlockIDFlag::BlockIDFlagAbsent, + block_id_flag: BlockIDFlag::Absent, validator_address: None, timestamp: None, signature: None, @@ -101,7 +101,7 @@ impl From for RawCommitSig { timestamp, signature, } => RawCommitSig { - block_id_flag: BlockIDFlag::BlockIDFlagNil, + block_id_flag: BlockIDFlag::Nil, validator_address: Some(validator_address), timestamp: Some(timestamp), signature: Some(signature), @@ -111,7 +111,7 @@ impl From for RawCommitSig { timestamp, signature, } => RawCommitSig { - block_id_flag: BlockIDFlag::BlockIDFlagCommit, + block_id_flag: BlockIDFlag::Commit, validator_address: Some(validator_address), timestamp: Some(timestamp), signature: Some(signature), diff --git a/tendermint/src/lite_impl/signed_header.rs b/tendermint/src/lite_impl/signed_header.rs index 1ee9575e9..beb82aa68 100644 --- a/tendermint/src/lite_impl/signed_header.rs +++ b/tendermint/src/lite_impl/signed_header.rs @@ -54,7 +54,7 @@ impl lite::Commit for block::signed_header::SignedHeader { if self.commit.signatures.len() != vals.validators().len() { fail!( Kind::ImplementationSpecific, - "pre-commit length: {} doesn't match validator length: {}", + "commit signatures count: {} doesn't match validators count: {}", self.commit.signatures.len(), vals.validators().len() ); diff --git a/tendermint/src/serializers/raw_commit_sig.rs b/tendermint/src/serializers/raw_commit_sig.rs index cd95895c2..52241c8a0 100644 --- a/tendermint/src/serializers/raw_commit_sig.rs +++ b/tendermint/src/serializers/raw_commit_sig.rs @@ -12,11 +12,11 @@ use std::str::FromStr; #[repr(u8)] pub enum BlockIDFlag { /// vote is not included in the Commit.Precommits - BlockIDFlagAbsent = 1, + Absent = 1, /// voted for the Commit.BlockID - BlockIDFlagCommit = 2, + Commit = 2, /// voted for nil - BlockIDFlagNil = 3, + Nil = 3, } /// RawCommitSig struct for interim deserialization of JSON object