fixing issues and moving

This commit is contained in:
Nikolay Volf
2016-02-15 18:01:52 +03:00
parent 31762095b7
commit 017a1adb24
9 changed files with 105 additions and 60 deletions

View File

@@ -20,59 +20,39 @@ use util::*;
use header::BlockNumber;
use basic_types::LogBloom;
#[derive(Debug, PartialEq, Eq)]
/// Error indicating an expected value was not found.
pub struct Mismatch<T: fmt::Debug> {
/// Value expected.
pub expected: T,
/// Value found.
pub found: T,
}
#[derive(Debug, PartialEq, Eq)]
/// Error indicating value found is outside of a valid range.
pub struct OutOfBounds<T: fmt::Debug> {
/// Minimum allowed value.
pub min: Option<T>,
/// Maximum allowed value.
pub max: Option<T>,
/// Value found.
pub found: T,
}
/// Result of executing the transaction.
#[derive(PartialEq, Debug)]
pub enum ExecutionError {
/// Returned when there gas paid for transaction execution is
/// lower than base gas required.
NotEnoughBaseGas {
NotEnoughBaseGas {
/// Absolute minimum gas required.
required: U256,
required: U256,
/// Gas provided.
got: U256
},
/// Returned when block (gas_used + gas) > gas_limit.
///
///
/// If gas =< gas_limit, upstream may try to execute the transaction
/// in next block.
BlockGasLimitReached {
BlockGasLimitReached {
/// Gas limit of block for transaction.
gas_limit: U256,
/// Gas used in block prior to transaction.
gas_used: U256,
/// Amount of gas in block.
gas: U256
gas: U256
},
/// Returned when transaction nonce does not match state nonce.
InvalidNonce {
InvalidNonce {
/// Nonce expected.
expected: U256,
/// Nonce found.
got: U256
},
/// Returned when cost of transaction (value + gas_price * gas) exceeds
/// Returned when cost of transaction (value + gas_price * gas) exceeds
/// current sender balance.
NotEnoughCash {
NotEnoughCash {
/// Minimum required balance.
required: U512,
/// Actual balance.

File diff suppressed because it is too large Load Diff

View File

@@ -108,7 +108,6 @@ pub mod spec;
pub mod transaction;
pub mod views;
pub mod receipt;
pub mod keys_directory;
mod common;
mod basic_types;

View File

@@ -46,15 +46,6 @@ impl RandomTempPath {
}
}
pub fn create_dir() -> RandomTempPath {
let mut dir = env::temp_dir();
dir.push(H32::random().hex());
fs::create_dir_all(dir.as_path()).unwrap();
RandomTempPath {
path: dir.clone()
}
}
pub fn as_path(&self) -> &PathBuf {
&self.path
}