Fixing clippy warnings
This commit is contained in:
parent
6b03a3218c
commit
7fbe3f4721
@ -140,11 +140,9 @@ impl<'a> Executive<'a> {
|
||||
let init_gas = t.gas - base_gas_required;
|
||||
|
||||
// validate transaction nonce
|
||||
if check_nonce {
|
||||
if t.nonce != nonce {
|
||||
if check_nonce && t.nonce != nonce {
|
||||
return Err(From::from(ExecutionError::InvalidNonce { expected: nonce, got: t.nonce }));
|
||||
}
|
||||
}
|
||||
|
||||
// validate if transaction fits into given block
|
||||
if self.info.gas_used + t.gas > self.info.gas_limit {
|
||||
|
@ -67,6 +67,8 @@ pub struct Externalities<'a, T> where T: 'a + Tracer {
|
||||
}
|
||||
|
||||
impl<'a, T> Externalities<'a, T> where T: 'a + Tracer {
|
||||
|
||||
#[cfg_attr(feature="dev", allow(too_many_arguments))]
|
||||
/// Basic `Externalities` constructor.
|
||||
pub fn new(state: &'a mut State,
|
||||
env_info: &'a EnvInfo,
|
||||
|
@ -19,7 +19,7 @@ use common::*;
|
||||
|
||||
/// State changes which should be applied in finalize,
|
||||
/// after transaction is fully executed.
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Default)]
|
||||
pub struct Substate {
|
||||
/// Any accounts that have suicided.
|
||||
pub suicides: HashSet<Address>,
|
||||
|
@ -17,7 +17,7 @@
|
||||
//! Tracing datatypes.
|
||||
use common::*;
|
||||
|
||||
/// TraceCall result.
|
||||
/// `TraceCall` result.
|
||||
#[derive(Debug, Clone, PartialEq, Default)]
|
||||
pub struct TraceCallResult {
|
||||
/// Gas used by call.
|
||||
@ -26,7 +26,7 @@ pub struct TraceCallResult {
|
||||
pub output: Bytes,
|
||||
}
|
||||
|
||||
/// TraceCreate result.
|
||||
/// `TraceCreate` result.
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub struct TraceCreateResult {
|
||||
/// Gas used by create.
|
||||
|
@ -22,6 +22,7 @@ use std::fs::File;
|
||||
use std::env;
|
||||
use std::io::{Read, Write};
|
||||
|
||||
#[cfg_attr(feature="dev", allow(enum_variant_names))]
|
||||
#[derive(Debug)]
|
||||
pub enum Error {
|
||||
CannotLockVersionFile,
|
||||
@ -107,16 +108,12 @@ fn with_locked_version<F>(script: F) -> Result<usize, Error>
|
||||
})
|
||||
.unwrap_or_else(|| Version::parse("0.9.0").unwrap());
|
||||
|
||||
let script_result = {
|
||||
let mut lock = try!(File::create(&path).map_err(|_| Error::CannotLockVersionFile));
|
||||
let result = script(&version);
|
||||
|
||||
let written_version = Version::parse(CURRENT_VERSION).unwrap();
|
||||
try!(lock.write_all(written_version.to_string().as_bytes()).map_err(|_| Error::CannotUpdateVersionFile));
|
||||
result
|
||||
};
|
||||
|
||||
script_result
|
||||
}
|
||||
|
||||
pub fn upgrade() -> Result<usize, Error> {
|
||||
|
Loading…
Reference in New Issue
Block a user