[evmbin] fix compilation (#10976)

* Fix compilation error

Include the test-helpers from `machine` (used by json-tests, although I'm not sure why evmbin needs ethcore/json-tests)

* Update to edition
This commit is contained in:
David 2019-08-15 16:06:43 +02:00 committed by Andronik Ordian
parent 5807402a0b
commit ef47426a93
9 changed files with 48 additions and 58 deletions

2
Cargo.lock generated
View File

@ -1481,10 +1481,8 @@ dependencies = [
"panic_hook 0.1.0",
"parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"pod 0.1.0",
"pretty_assertions 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)",
"tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
"trace 0.1.0",

View File

@ -111,7 +111,7 @@ evm-debug-tests = ["evm-debug", "evm/evm-debug-tests"]
# EVM debug traces are printed.
slow-blocks = []
# Run JSON consensus tests.
json-tests = ["env_logger", "test-helpers"]
json-tests = ["env_logger", "test-helpers", "machine/test-helpers"]
# Skip JSON consensus tests with pending issues.
ci-skip-tests = []
# Run memory/cpu heavy tests.

View File

@ -3,6 +3,7 @@ description = "Parity EVM Implementation"
name = "evmbin"
version = "0.1.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
[[bin]]
name = "parity-evm"
@ -21,14 +22,12 @@ panic_hook = { path = "../util/panic-hook" }
parity-bytes = "0.1"
pod = { path = "../ethcore/pod" }
rustc-hex = "1.0"
serde = "1.0"
serde_derive = "1.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
trace = { path = "../ethcore/trace" }
vm = { path = "../ethcore/vm" }
[dev-dependencies]
pretty_assertions = "0.1"
tempdir = "0.3"
[features]

View File

@ -52,4 +52,3 @@ _This project is a part of the Parity Ethereum toolchain._
- [ethabi](https://github.com/paritytech/ethabi) - Parity Ethereum function calls encoding.
- [ethstore](https://github.com/paritytech/parity-ethereum/blob/master/accounts/ethstore) - Parity Ethereum key management.
- [ethkey](https://github.com/paritytech/parity-ethereum/blob/master/accounts/ethkey) - Parity Ethereum keys generator.
- [whisper](https://github.com/paritytech/whisper) - Implementation of Whisper-v2 PoC.

View File

@ -20,11 +20,14 @@ use std::collections::HashMap;
use std::mem;
use ethereum_types::{U256, H256, BigEndianHash};
use bytes::ToPretty;
use parity_bytes::ToPretty;
use serde::Serialize;
use trace;
use display;
use info as vm;
use crate::{
display,
info as vm,
};
/// JSON formatting informant.
#[derive(Default)]
@ -273,10 +276,12 @@ impl trace::VMTracer for Informant {
#[cfg(test)]
mod tests {
use super::*;
use info::tests::run_test;
use serde::{Deserialize, Serialize};
use serde_json;
use super::*;
use crate::info::tests::run_test;
#[derive(Serialize, Deserialize, Debug, PartialEq)]
#[serde(rename_all = "camelCase")]
struct TestTrace {

View File

@ -17,10 +17,12 @@
//! Log EVM instruction output data traces from a simple formatting informant.
use trace;
use bytes::ToPretty;
use parity_bytes::ToPretty;
use display;
use info as vm;
use crate::{
display,
info as vm,
};
/// Simple formatting informant.
#[derive(Default)]

View File

@ -20,11 +20,15 @@ use std::collections::HashMap;
use std::io;
use ethereum_types::{H256, U256, BigEndianHash};
use bytes::ToPretty;
use trace;
use parity_bytes::ToPretty;
use pod::PodState;
use display;
use info as vm;
use serde::Serialize;
use trace;
use crate::{
display,
info as vm,
};
pub trait Writer: io::Write + Send + Sized {
fn clone(&self) -> Self;
@ -312,7 +316,7 @@ impl<Trace: Writer, Out: Writer> trace::VMTracer for Informant<Trace, Out> {
pub mod tests {
use std::sync::{Arc, Mutex};
use super::*;
use info::tests::run_test;
use crate::info::tests::run_test;
#[derive(Debug, Clone, Default)]
pub struct TestWriter(pub Arc<Mutex<Vec<u8>>>);

View File

@ -17,13 +17,17 @@
//! EVM runner.
use std::time::{Instant, Duration};
use ethcore::client::{self, EvmTestClient, EvmTestError, TransactErr, TransactSuccess};
use ethcore::{spec, TrieSpec};
use common_types::transaction;
use ethcore::{
client::{self, EvmTestClient, EvmTestError, TransactErr, TransactSuccess},
spec,
TrieSpec,
};
use ethereum_types::{H256, U256};
use ethjson;
use pod::PodState;
use trace;
use types::transaction;
use vm::ActionParams;
/// EVM execution informant.
@ -37,7 +41,7 @@ pub trait Informant: trace::VMTracer {
/// Clone sink.
fn clone_sink(&self) -> Self::Sink;
/// Display final result.
fn finish(result: RunResult<Self::Output>, &mut Self::Sink);
fn finish(result: RunResult<Self::Output>, _: &mut Self::Sink);
}
/// Execution finished correctly.
@ -272,7 +276,7 @@ pub mod tests {
#[test]
fn should_call_account_from_spec() {
use display::std_json::tests::informant;
use crate::display::std_json::tests::informant;
let (inf, res, _) = informant();
let mut params = ActionParams::default();

View File

@ -34,46 +34,22 @@
#![warn(missing_docs)]
extern crate account_state;
extern crate common_types as types;
extern crate docopt;
extern crate env_logger;
extern crate ethcore;
extern crate ethereum_types;
extern crate ethjson;
extern crate evm;
extern crate panic_hook;
extern crate parity_bytes as bytes;
extern crate pod;
extern crate rustc_hex;
extern crate serde;
#[macro_use]
extern crate serde_derive;
extern crate serde_json;
extern crate trace;
extern crate vm;
#[cfg(test)]
#[macro_use]
extern crate pretty_assertions;
#[cfg(test)]
extern crate tempdir;
use std::sync::Arc;
use std::{fmt, fs};
use std::path::PathBuf;
use parity_bytes::Bytes;
use docopt::Docopt;
use rustc_hex::FromHex;
use ethereum_types::{U256, Address};
use bytes::Bytes;
use ethcore::{spec, json_tests, TrieSpec};
use serde::Deserialize;
use vm::{ActionParams, CallType};
mod info;
mod display;
use info::{Informant, TxInput};
use crate::info::{Informant, TxInput};
const USAGE: &'static str = r#"
EVM implementation for Parity.
@ -289,7 +265,7 @@ fn run_state_test(args: Args) {
}
fn run_stats_jsontests_vm(args: Args) {
use json_tests::HookType;
use crate::json_tests::HookType;
use std::collections::HashMap;
use std::time::{Instant, Duration};
@ -464,14 +440,17 @@ fn die<T: fmt::Display>(msg: T) -> ! {
#[cfg(test)]
mod tests {
use display::std_json::tests::informant;
use common_types::transaction;
use docopt::Docopt;
use ethcore::{TrieSpec};
use ethjson::state::test::{State};
use info::{self, TxInput};
use super::{Args, USAGE, Address, run_call};
use types::transaction;
use serde::Deserialize;
use super::{Args, USAGE, Address, run_call};
use crate::{
display::std_json::tests::informant,
info::{self, TxInput}
};
#[derive(Debug, PartialEq, Deserialize)]
pub struct SampleStateTests {