Add state helpers from #148

This commit is contained in:
Paul Hauner
2019-01-28 19:12:20 +11:00
parent f92b9d618a
commit 6a4252b8c6
10 changed files with 167 additions and 65 deletions

View File

@@ -98,7 +98,7 @@ where
let block_proposer_index = state
.get_beacon_proposer_index(block.slot, &self.spec)
.ok_or(Error::NoBlockProducer)?;
.map_err(|_| Error::NoBlockProducer)?;
let block_proposer = &state.validator_registry[block_proposer_index];
if verify_block_signature {
@@ -294,7 +294,7 @@ where
);
if state.slot % self.spec.epoch_length == 0 {
state.per_epoch_processing(&self.spec);
state.per_epoch_processing(&self.spec).unwrap();
}
Ok(state)