Skip to content

Commit

Permalink
#393: commit: use getters
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey-kuprianov committed Jul 20, 2020
1 parent 56a11d8 commit 54651f2
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions mbt-utils/src/commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,8 @@ impl Generator<block::Commit> for Commit {
}

fn generate(&self) -> Result<block::Commit, SimpleError> {
let header = match &self.header{
None => bail!("failed to generate commit: header is missing"),
Some(h) => h
};
let votes = match &self.votes{
None => bail!("failed to generate commit: votes are missing"),
Some(vs) => vs
};
let header = self.header()?;
let votes = self.votes()?;
let block_header = header.generate()?;
let block_id = block::Id::new(lite::Header::hash(&block_header), None);

Expand Down

0 comments on commit 54651f2

Please sign in to comment.