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