expect instead of index

This commit is contained in:
keorn 2016-12-13 18:22:56 +01:00
parent 49ae375605
commit c96826beaa

View File

@ -51,7 +51,7 @@ impl ConsensusMessage {
pub fn new_proposal(header: &Header) -> Result<Self, ::rlp::DecoderError> { pub fn new_proposal(header: &Header) -> Result<Self, ::rlp::DecoderError> {
Ok(ConsensusMessage { Ok(ConsensusMessage {
signature: try!(UntrustedRlp::new(header.seal()[1].as_slice()).as_val()), signature: try!(UntrustedRlp::new(header.seal().get(1).expect("seal passed basic verification; seal has 3 fields; qed").as_slice()).as_val()),
height: header.number() as Height, height: header.number() as Height,
round: try!(consensus_round(header)), round: try!(consensus_round(header)),
step: Step::Propose, step: Step::Propose,