From 9bf29a555af7f8d74f262954e47c21f13b3a51b0 Mon Sep 17 00:00:00 2001 From: Tomusdrw Date: Mon, 19 Sep 2016 01:51:59 +0200 Subject: [PATCH 1/3] Fixing evm-debug --- Cargo.lock | 1 - Cargo.toml | 1 + ethcore/src/evm/evm.rs | 2 +- ethcore/src/evm/interpreter/mod.rs | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 83b7514f6..ffc24e952 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -517,7 +517,6 @@ version = "1.4.0" dependencies = [ "ansi_term 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "arrayvec 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", - "bigint 0.1.0", "clippy 0.0.90 (registry+https://github.com/rust-lang/crates.io-index)", "elastic-array 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index 913b4c5f2..f52f0dc85 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -66,6 +66,7 @@ json-tests = ["ethcore/json-tests"] stratum = ["ipc"] ethkey-cli = ["ethcore/ethkey-cli"] ethstore-cli = ["ethcore/ethstore-cli"] +evm-debug = ["ethcore/evm-debug"] [[bin]] path = "parity/main.rs" diff --git a/ethcore/src/evm/evm.rs b/ethcore/src/evm/evm.rs index 813819250..68056a0b9 100644 --- a/ethcore/src/evm/evm.rs +++ b/ethcore/src/evm/evm.rs @@ -113,7 +113,7 @@ impl<'a> Finalize for Result> { } /// Cost calculation type. For low-gas usage we calculate costs using usize instead of U256 -pub trait CostType: ops::Mul + ops::Div + ops::Add + ops::Sub + ops::Shr + ops::Shl + cmp::Ord + Sized + From + Copy { +pub trait CostType: ops::Mul + ops::Div + ops::Add + ops::Sub + ops::Shr + ops::Shl + cmp::Ord + Sized + From + Copy + fmt::Debug { /// Converts this cost into `U256` fn as_u256(&self) -> U256; /// Tries to fit `U256` into this `Cost` type diff --git a/ethcore/src/evm/interpreter/mod.rs b/ethcore/src/evm/interpreter/mod.rs index d1b9b18bc..e95fb943e 100644 --- a/ethcore/src/evm/interpreter/mod.rs +++ b/ethcore/src/evm/interpreter/mod.rs @@ -126,7 +126,7 @@ impl evm::Evm for Interpreter { gasometer.current_gas = gasometer.current_gas - gas_cost; evm_debug!({ - println!("[0x{:x}][{}(0x{:x}) Gas: {:x}\n Gas Before: {:x}", + println!("[0x{:x}][{}(0x{:x}) Gas: {:?}\n Gas Before: {:?}", reader.position, color(instruction, info.name), instruction, From b6df3759c83eeb13a7d1a4fb7b55f95c561bdb26 Mon Sep 17 00:00:00 2001 From: Tomusdrw Date: Mon, 19 Sep 2016 12:16:22 +0200 Subject: [PATCH 2/3] Breaking the line --- ethcore/src/evm/evm.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ethcore/src/evm/evm.rs b/ethcore/src/evm/evm.rs index 68056a0b9..f399f57bb 100644 --- a/ethcore/src/evm/evm.rs +++ b/ethcore/src/evm/evm.rs @@ -113,7 +113,10 @@ impl<'a> Finalize for Result> { } /// Cost calculation type. For low-gas usage we calculate costs using usize instead of U256 -pub trait CostType: ops::Mul + ops::Div + ops::Add + ops::Sub + ops::Shr + ops::Shl + cmp::Ord + Sized + From + Copy + fmt::Debug { +pub trait CostType: Sized : From + Copy + + ops::Mul + ops::Div + ops::Add +ops::Sub + + ops::Shr + ops::Shl + + cmp::Ord + fmt::Debug { /// Converts this cost into `U256` fn as_u256(&self) -> U256; /// Tries to fit `U256` into this `Cost` type From 0921dffd866d3a675c7566d77cc8e2ffdc4c6f2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Tue, 20 Sep 2016 16:25:22 +0200 Subject: [PATCH 3/3] Fixing trait definition --- ethcore/src/evm/evm.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethcore/src/evm/evm.rs b/ethcore/src/evm/evm.rs index f399f57bb..8d2202480 100644 --- a/ethcore/src/evm/evm.rs +++ b/ethcore/src/evm/evm.rs @@ -113,7 +113,7 @@ impl<'a> Finalize for Result> { } /// Cost calculation type. For low-gas usage we calculate costs using usize instead of U256 -pub trait CostType: Sized : From + Copy +pub trait CostType: Sized + From + Copy + ops::Mul + ops::Div + ops::Add +ops::Sub + ops::Shr + ops::Shl + cmp::Ord + fmt::Debug {