Skip to content

Commit

Permalink
simplify seal
Browse files Browse the repository at this point in the history
  • Loading branch information
keorn committed Sep 30, 2016
1 parent d59e9e8 commit 8a51ae0
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions ethcore/src/engines/tendermint/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ impl Engine for Tendermint {
fn name(&self) -> &str { "Tendermint" }
fn version(&self) -> SemanticVersion { SemanticVersion::new(1, 0, 0) }
/// Possibly signatures of all validators.
fn seal_fields(&self) -> usize { self.our_params.validator_n }
fn seal_fields(&self) -> usize { 2 }

fn params(&self) -> &CommonParams { &self.params }
fn builtins(&self) -> &BTreeMap<Address, Builtin> { &self.builtins }
Expand Down Expand Up @@ -260,12 +260,13 @@ impl Engine for Tendermint {
}

fn verify_block_basic(&self, header: &Header, _block: Option<&[u8]>) -> Result<(), Error> {
if header.seal().len() <= self.threshold() {
let seal_length = header.seal().len();
if seal_length == self.seal_fields() {
Ok(())
} else {
Err(From::from(BlockError::InvalidSealArity(
Mismatch { expected: self.threshold(), found: header.seal().len() }
Mismatch { expected: self.seal_fields(), found: seal_length }
)))
} else {
Ok(())
}
}

Expand Down

0 comments on commit 8a51ae0

Please sign in to comment.