Port try macro to new ? operator. (#3962)

* initial untry sweep

* restore try in ipc codegen, fix inference

* change a few missed try instances
This commit is contained in:
Robert Habermeier
2016-12-27 12:53:56 +01:00
committed by Arkadiy Paronyan
parent b1ef52a6d7
commit 8125b5690c
165 changed files with 1696 additions and 1696 deletions

View File

@@ -143,10 +143,10 @@ impl Engine for BasicAuthority {
use rlp::{UntrustedRlp, View};
// check the signature is legit.
let sig = try!(UntrustedRlp::new(&header.seal()[0]).as_val::<H520>());
let signer = public_to_address(&try!(recover(&sig.into(), &header.bare_hash())));
let sig = UntrustedRlp::new(&header.seal()[0]).as_val::<H520>()?;
let signer = public_to_address(&recover(&sig.into(), &header.bare_hash())?);
if !self.our_params.authorities.contains(&signer) {
return try!(Err(BlockError::InvalidSeal));
return Err(BlockError::InvalidSeal)?;
}
Ok(())
}
@@ -171,7 +171,7 @@ impl Engine for BasicAuthority {
}
fn verify_transaction_basic(&self, t: &SignedTransaction, _header: &Header) -> result::Result<(), Error> {
try!(t.check_low_s());
t.check_low_s()?;
Ok(())
}