From 4a0ee3e29b0245c8bf14a8803ae51fc23930f666 Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Fri, 11 Jan 2019 15:33:33 +0100 Subject: [PATCH 01/14] Create call-contract crate --- ethcore/call-contract/Cargo.toml | 11 +++++++++++ ethcore/call-contract/src/call_contract.rs | 9 +++++++++ ethcore/call-contract/src/lib.rs | 5 +++++ 3 files changed, 25 insertions(+) create mode 100644 ethcore/call-contract/Cargo.toml create mode 100644 ethcore/call-contract/src/call_contract.rs create mode 100644 ethcore/call-contract/src/lib.rs diff --git a/ethcore/call-contract/Cargo.toml b/ethcore/call-contract/Cargo.toml new file mode 100644 index 00000000000..6f42883d84b --- /dev/null +++ b/ethcore/call-contract/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "call-contract" +version = "0.1.0" +license = "GPL-3.0" +authors = ["Parity Technologies "] +edition = "2018" + +[dependencies] +common-types = { path = "../types" } +ethereum-types = "0.4" +parity-bytes = "0.1" diff --git a/ethcore/call-contract/src/call_contract.rs b/ethcore/call-contract/src/call_contract.rs new file mode 100644 index 00000000000..4eab6e6a5ed --- /dev/null +++ b/ethcore/call-contract/src/call_contract.rs @@ -0,0 +1,9 @@ +use bytes::Bytes; +use ethereum_types::Address; +use types::ids::BlockId; + +/// Provides `call_contract` method +pub trait CallContract { + /// Like `call`, but with various defaults. Designed to be used for calling contracts. + fn call_contract(&self, id: BlockId, address: Address, data: Bytes) -> Result; +} diff --git a/ethcore/call-contract/src/lib.rs b/ethcore/call-contract/src/lib.rs new file mode 100644 index 00000000000..a4c96c40fe3 --- /dev/null +++ b/ethcore/call-contract/src/lib.rs @@ -0,0 +1,5 @@ +extern crate common_types as types; +extern crate ethereum_types; +extern crate parity_bytes as bytes; + +pub mod call_contract; From 39ffa0b119d318d59e6a7b838fb20953f1a6fe8c Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Fri, 11 Jan 2019 15:37:05 +0100 Subject: [PATCH 02/14] Add license --- ethcore/call-contract/src/call_contract.rs | 16 ++++++++++++++++ ethcore/call-contract/src/lib.rs | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/ethcore/call-contract/src/call_contract.rs b/ethcore/call-contract/src/call_contract.rs index 4eab6e6a5ed..70277bd24db 100644 --- a/ethcore/call-contract/src/call_contract.rs +++ b/ethcore/call-contract/src/call_contract.rs @@ -1,3 +1,19 @@ +// Copyright 2015-2019 Parity Technologies (UK) Ltd. +// This file is part of Parity Ethereum. + +// Parity Ethereum is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Parity Ethereum is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Parity Ethereum. If not, see . + use bytes::Bytes; use ethereum_types::Address; use types::ids::BlockId; diff --git a/ethcore/call-contract/src/lib.rs b/ethcore/call-contract/src/lib.rs index a4c96c40fe3..11d2ed68b81 100644 --- a/ethcore/call-contract/src/lib.rs +++ b/ethcore/call-contract/src/lib.rs @@ -1,3 +1,19 @@ +// Copyright 2015-2019 Parity Technologies (UK) Ltd. +// This file is part of Parity Ethereum. + +// Parity Ethereum is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Parity Ethereum is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Parity Ethereum. If not, see . + extern crate common_types as types; extern crate ethereum_types; extern crate parity_bytes as bytes; From 018b853a4e3f4c819b365db4e016cd29aaa290aa Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Fri, 11 Jan 2019 15:38:28 +0100 Subject: [PATCH 03/14] First attempt at using extracted CallContract trait --- ethcore/Cargo.toml | 1 + ethcore/src/client/client.rs | 4 +++- ethcore/src/client/mod.rs | 3 ++- ethcore/src/client/test_client.rs | 3 ++- ethcore/src/client/traits.rs | 11 ++++++----- ethcore/src/lib.rs | 1 + 6 files changed, 15 insertions(+), 8 deletions(-) diff --git a/ethcore/Cargo.toml b/ethcore/Cargo.toml index 9a286dcb9b6..4014b242135 100644 --- a/ethcore/Cargo.toml +++ b/ethcore/Cargo.toml @@ -11,6 +11,7 @@ ansi_term = "0.10" blooms-db = { path = "../util/blooms-db", optional = true } bn = { git = "https://github.com/paritytech/bn", default-features = false } byteorder = "1.0" +call-contract = { path = "./call-contract" } common-types = { path = "types" } crossbeam = "0.4" env_logger = { version = "0.5", optional = true } diff --git a/ethcore/src/client/client.rs b/ethcore/src/client/client.rs index 995b11520f6..9f38fe23195 100644 --- a/ethcore/src/client/client.rs +++ b/ethcore/src/client/client.rs @@ -43,10 +43,12 @@ use types::receipt::{Receipt, LocalizedReceipt}; use types::{BlockNumber, header::{Header, ExtendedHeader}}; use vm::{EnvInfo, LastHashes}; +use call_contract::call_contract::CallContract; + use block::{IsBlock, LockedBlock, Drain, ClosedBlock, OpenBlock, enact_verified, SealedBlock}; use client::ancient_import::AncientVerifier; use client::{ - Nonce, Balance, ChainInfo, BlockInfo, CallContract, TransactionInfo, + Nonce, Balance, ChainInfo, BlockInfo, /*CallContract,*/ TransactionInfo, RegistryInfo, ReopenBlock, PrepareOpenBlock, ScheduleInfo, ImportSealedBlock, BroadcastProposalBlock, ImportBlock, StateOrBlock, StateInfo, StateClient, Call, AccountData, BlockChain as BlockChainTrait, BlockProducer, SealedBlockImporter, diff --git a/ethcore/src/client/mod.rs b/ethcore/src/client/mod.rs index 9c534d470c6..0498f15efbc 100644 --- a/ethcore/src/client/mod.rs +++ b/ethcore/src/client/mod.rs @@ -36,7 +36,7 @@ pub use self::io_message::ClientIoMessage; pub use self::test_client::{TestBlockChainClient, EachBlockWith}; pub use self::chain_notify::{ChainNotify, NewBlocks, ChainRoute, ChainRouteType, ChainMessageType}; pub use self::traits::{ - Nonce, Balance, ChainInfo, BlockInfo, ReopenBlock, PrepareOpenBlock, CallContract, TransactionInfo, RegistryInfo, ScheduleInfo, ImportSealedBlock, BroadcastProposalBlock, ImportBlock, + Nonce, Balance, ChainInfo, BlockInfo, ReopenBlock, PrepareOpenBlock, /*CallContract,*/ TransactionInfo, RegistryInfo, ScheduleInfo, ImportSealedBlock, BroadcastProposalBlock, ImportBlock, StateOrBlock, StateClient, Call, EngineInfo, AccountData, BlockChain, BlockProducer, SealedBlockImporter, BadBlocks, }; pub use state::StateInfo; @@ -46,6 +46,7 @@ pub use types::ids::*; pub use types::trace_filter::Filter as TraceFilter; pub use types::pruning_info::PruningInfo; pub use types::call_analytics::CallAnalytics; +pub use call_contract::call_contract::CallContract; pub use executive::{Executed, Executive, TransactOptions}; pub use vm::{LastHashes, EnvInfo}; diff --git a/ethcore/src/client/test_client.rs b/ethcore/src/client/test_client.rs index 1ca826097f0..b331cf6872c 100644 --- a/ethcore/src/client/test_client.rs +++ b/ethcore/src/client/test_client.rs @@ -49,8 +49,9 @@ use types::views::BlockView; use vm::Schedule; use block::{OpenBlock, SealedBlock, ClosedBlock}; +use call_contract::call_contract::CallContract; use client::{ - Nonce, Balance, ChainInfo, BlockInfo, ReopenBlock, CallContract, TransactionInfo, RegistryInfo, + Nonce, Balance, ChainInfo, BlockInfo, ReopenBlock, /* CallContract,*/ TransactionInfo, RegistryInfo, PrepareOpenBlock, BlockChainClient, BlockChainInfo, BlockStatus, BlockId, Mode, TransactionId, UncleId, TraceId, TraceFilter, LastHashes, CallAnalytics, ProvingBlockChainClient, ScheduleInfo, ImportSealedBlock, BroadcastProposalBlock, ImportBlock, StateOrBlock, diff --git a/ethcore/src/client/traits.rs b/ethcore/src/client/traits.rs index ff0148beefc..e54382db00d 100644 --- a/ethcore/src/client/traits.rs +++ b/ethcore/src/client/traits.rs @@ -19,6 +19,7 @@ use std::sync::Arc; use blockchain::{BlockReceipts, TreeRoute}; use bytes::Bytes; +use call_contract::call_contract::CallContract; use ethcore_miner::pool::VerifiedTransaction; use ethereum_types::{H256, U256, Address}; use evm::Schedule; @@ -170,11 +171,11 @@ pub trait ImportBlock { fn import_block(&self, block: Unverified) -> EthcoreResult; } -/// Provides `call_contract` method -pub trait CallContract { - /// Like `call`, but with various defaults. Designed to be used for calling contracts. - fn call_contract(&self, id: BlockId, address: Address, data: Bytes) -> Result; -} +// /// Provides `call_contract` method +// pub trait CallContract { +// /// Like `call`, but with various defaults. Designed to be used for calling contracts. +// fn call_contract(&self, id: BlockId, address: Address, data: Bytes) -> Result; +// } /// Provides `call` and `call_many` methods pub trait Call { diff --git a/ethcore/src/lib.rs b/ethcore/src/lib.rs index 73fdb64fde9..f3e500ba8ac 100644 --- a/ethcore/src/lib.rs +++ b/ethcore/src/lib.rs @@ -60,6 +60,7 @@ extern crate ansi_term; extern crate bn; extern crate byteorder; +extern crate call_contract; extern crate common_types as types; extern crate crossbeam; extern crate ethabi; From 2ca01e731c7e065f3844eb4e1412cdd60fb8a906 Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Fri, 11 Jan 2019 16:58:37 +0100 Subject: [PATCH 04/14] Remove unneeded `extern crate` calls --- ethcore/call-contract/Cargo.toml | 4 ++-- ethcore/call-contract/src/lib.rs | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/ethcore/call-contract/Cargo.toml b/ethcore/call-contract/Cargo.toml index 6f42883d84b..649d807e018 100644 --- a/ethcore/call-contract/Cargo.toml +++ b/ethcore/call-contract/Cargo.toml @@ -6,6 +6,6 @@ authors = ["Parity Technologies "] edition = "2018" [dependencies] -common-types = { path = "../types" } +types = { path = "../types", package = "common-types" } ethereum-types = "0.4" -parity-bytes = "0.1" +bytes = { version = "0.1", package = "parity-bytes" } diff --git a/ethcore/call-contract/src/lib.rs b/ethcore/call-contract/src/lib.rs index 11d2ed68b81..8a0d6b86c21 100644 --- a/ethcore/call-contract/src/lib.rs +++ b/ethcore/call-contract/src/lib.rs @@ -14,8 +14,4 @@ // You should have received a copy of the GNU General Public License // along with Parity Ethereum. If not, see . -extern crate common_types as types; -extern crate ethereum_types; -extern crate parity_bytes as bytes; - pub mod call_contract; From 9d8fee60d4099f55f101fee5fd9ea0712d897774 Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Mon, 14 Jan 2019 11:50:16 +0100 Subject: [PATCH 05/14] Move RegistryInfo trait into call-contract crate --- ethcore/call-contract/src/call_contract.rs | 6 ++++++ ethcore/src/client/client.rs | 3 +-- ethcore/src/client/mod.rs | 3 ++- ethcore/src/client/traits.rs | 11 ++++++----- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/ethcore/call-contract/src/call_contract.rs b/ethcore/call-contract/src/call_contract.rs index 70277bd24db..1b43f772f4b 100644 --- a/ethcore/call-contract/src/call_contract.rs +++ b/ethcore/call-contract/src/call_contract.rs @@ -23,3 +23,9 @@ pub trait CallContract { /// Like `call`, but with various defaults. Designed to be used for calling contracts. fn call_contract(&self, id: BlockId, address: Address, data: Bytes) -> Result; } + +/// Provides information on a blockchain service and it's registry +pub trait RegistryInfo { + /// Get the address of a particular blockchain service, if available. + fn registry_address(&self, name: String, block: BlockId) -> Option
; +} \ No newline at end of file diff --git a/ethcore/src/client/client.rs b/ethcore/src/client/client.rs index 9f38fe23195..584c361ad38 100644 --- a/ethcore/src/client/client.rs +++ b/ethcore/src/client/client.rs @@ -23,6 +23,7 @@ use std::time::{Instant, Duration}; use blockchain::{BlockReceipts, BlockChain, BlockChainDB, BlockProvider, TreeRoute, ImportRoute, TransactionAddress, ExtrasInsert}; use bytes::Bytes; +use call_contract::call_contract::CallContract; use ethcore_miner::pool::VerifiedTransaction; use ethereum_types::{H256, Address, U256}; use evm::Schedule; @@ -43,8 +44,6 @@ use types::receipt::{Receipt, LocalizedReceipt}; use types::{BlockNumber, header::{Header, ExtendedHeader}}; use vm::{EnvInfo, LastHashes}; -use call_contract::call_contract::CallContract; - use block::{IsBlock, LockedBlock, Drain, ClosedBlock, OpenBlock, enact_verified, SealedBlock}; use client::ancient_import::AncientVerifier; use client::{ diff --git a/ethcore/src/client/mod.rs b/ethcore/src/client/mod.rs index 0498f15efbc..0e2f20587c8 100644 --- a/ethcore/src/client/mod.rs +++ b/ethcore/src/client/mod.rs @@ -36,7 +36,7 @@ pub use self::io_message::ClientIoMessage; pub use self::test_client::{TestBlockChainClient, EachBlockWith}; pub use self::chain_notify::{ChainNotify, NewBlocks, ChainRoute, ChainRouteType, ChainMessageType}; pub use self::traits::{ - Nonce, Balance, ChainInfo, BlockInfo, ReopenBlock, PrepareOpenBlock, /*CallContract,*/ TransactionInfo, RegistryInfo, ScheduleInfo, ImportSealedBlock, BroadcastProposalBlock, ImportBlock, + Nonce, Balance, ChainInfo, BlockInfo, ReopenBlock, PrepareOpenBlock, /*CallContract,*/ TransactionInfo, /*RegistryInfo,*/ ScheduleInfo, ImportSealedBlock, BroadcastProposalBlock, ImportBlock, StateOrBlock, StateClient, Call, EngineInfo, AccountData, BlockChain, BlockProducer, SealedBlockImporter, BadBlocks, }; pub use state::StateInfo; @@ -47,6 +47,7 @@ pub use types::trace_filter::Filter as TraceFilter; pub use types::pruning_info::PruningInfo; pub use types::call_analytics::CallAnalytics; pub use call_contract::call_contract::CallContract; +pub use call_contract::call_contract::RegistryInfo; pub use executive::{Executed, Executive, TransactOptions}; pub use vm::{LastHashes, EnvInfo}; diff --git a/ethcore/src/client/traits.rs b/ethcore/src/client/traits.rs index e54382db00d..2d6e124ff0d 100644 --- a/ethcore/src/client/traits.rs +++ b/ethcore/src/client/traits.rs @@ -20,6 +20,7 @@ use std::sync::Arc; use blockchain::{BlockReceipts, TreeRoute}; use bytes::Bytes; use call_contract::call_contract::CallContract; +use call_contract::call_contract::RegistryInfo; use ethcore_miner::pool::VerifiedTransaction; use ethereum_types::{H256, U256, Address}; use evm::Schedule; @@ -158,11 +159,11 @@ pub trait StateClient { /// Provides various blockchain information, like block header, chain state etc. pub trait BlockChain: ChainInfo + BlockInfo + TransactionInfo {} -/// Provides information on a blockchain service and it's registry -pub trait RegistryInfo { - /// Get the address of a particular blockchain service, if available. - fn registry_address(&self, name: String, block: BlockId) -> Option
; -} +// /// Provides information on a blockchain service and it's registry +// pub trait RegistryInfo { +// /// Get the address of a particular blockchain service, if available. +// fn registry_address(&self, name: String, block: BlockId) -> Option
; +// } // FIXME Why these methods belong to BlockChainClient and not MiningBlockChainClient? /// Provides methods to import block into blockchain From 3068a7bad20773c94e26e7ef20edabc813ee53ac Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Mon, 14 Jan 2019 12:00:52 +0100 Subject: [PATCH 06/14] Move service-transaction-checker from ethcore to ethcore-miner --- ethcore/src/miner/mod.rs | 1 - ethcore/src/miner/pool_client.rs | 2 +- miner/Cargo.toml | 4 ++++ {ethcore => miner}/res/contracts/service_transaction.json | 0 miner/src/lib.rs | 7 +++++++ .../src/miner => miner/src}/service_transaction_checker.rs | 3 ++- 6 files changed, 14 insertions(+), 3 deletions(-) rename {ethcore => miner}/res/contracts/service_transaction.json (100%) rename {ethcore/src/miner => miner/src}/service_transaction_checker.rs (95%) diff --git a/ethcore/src/miner/mod.rs b/ethcore/src/miner/mod.rs index 2696306e71d..399d66b5459 100644 --- a/ethcore/src/miner/mod.rs +++ b/ethcore/src/miner/mod.rs @@ -20,7 +20,6 @@ //! Keeps track of transactions and currently sealed pending block. mod miner; -mod service_transaction_checker; pub mod pool_client; #[cfg(feature = "stratum")] diff --git a/ethcore/src/miner/pool_client.rs b/ethcore/src/miner/pool_client.rs index e748d9bc201..1bccc04f106 100644 --- a/ethcore/src/miner/pool_client.rs +++ b/ethcore/src/miner/pool_client.rs @@ -25,6 +25,7 @@ use std::{ use ethereum_types::{H256, U256, Address}; use ethcore_miner::pool; use ethcore_miner::pool::client::NonceClient; +use ethcore_miner::service_transaction_checker::ServiceTransactionChecker; use types::transaction::{ self, UnverifiedTransaction, @@ -37,7 +38,6 @@ use account_provider::AccountProvider; use client::{TransactionId, BlockInfo, CallContract, Nonce}; use engines::EthEngine; use miner; -use miner::service_transaction_checker::ServiceTransactionChecker; use transaction_ext::Transaction; /// Cache for state nonces. diff --git a/miner/Cargo.toml b/miner/Cargo.toml index d37ed692c73..1aebb3a2a1a 100644 --- a/miner/Cargo.toml +++ b/miner/Cargo.toml @@ -15,8 +15,12 @@ url = { version = "1", optional = true } # Miner ansi_term = "0.10" +call-contract = { path = "../ethcore/call-contract" } common-types = { path = "../ethcore/types" } error-chain = "0.12" +ethabi = "6.0" +ethabi-derive = "6.0" +ethabi-contract = "6.0" ethereum-types = "0.4" futures = "0.1" heapsize = "0.4" diff --git a/ethcore/res/contracts/service_transaction.json b/miner/res/contracts/service_transaction.json similarity index 100% rename from ethcore/res/contracts/service_transaction.json rename to miner/res/contracts/service_transaction.json diff --git a/miner/src/lib.rs b/miner/src/lib.rs index 3b2513f678e..c96692042fb 100644 --- a/miner/src/lib.rs +++ b/miner/src/lib.rs @@ -20,7 +20,9 @@ //! Keeps track of transactions and mined block. extern crate ansi_term; +extern crate call_contract; extern crate common_types as types; +extern crate ethabi; extern crate ethereum_types; extern crate futures; extern crate heapsize; @@ -33,6 +35,10 @@ extern crate price_info; extern crate rlp; extern crate transaction_pool as txpool; +#[macro_use] +extern crate ethabi_contract; +#[macro_use] +extern crate ethabi_derive; #[macro_use] extern crate error_chain; #[macro_use] @@ -52,5 +58,6 @@ pub mod external; pub mod gas_price_calibrator; pub mod gas_pricer; pub mod pool; +pub mod service_transaction_checker; #[cfg(feature = "work-notify")] pub mod work_notify; diff --git a/ethcore/src/miner/service_transaction_checker.rs b/miner/src/service_transaction_checker.rs similarity index 95% rename from ethcore/src/miner/service_transaction_checker.rs rename to miner/src/service_transaction_checker.rs index 8d4c461cea2..a12f581e560 100644 --- a/ethcore/src/miner/service_transaction_checker.rs +++ b/miner/src/service_transaction_checker.rs @@ -16,7 +16,8 @@ //! A service transactions contract checker. -use client::{RegistryInfo, CallContract, BlockId}; +use call_contract::call_contract::{CallContract, RegistryInfo}; +use types::ids::BlockId; use types::transaction::SignedTransaction; use ethabi::FunctionOutputDecoder; From ea036e1bf9e3cc048abcbf7cfae8a5f27b169158 Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Mon, 14 Jan 2019 12:11:38 +0100 Subject: [PATCH 07/14] Update Cargo.lock file --- Cargo.lock | 77 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 44 insertions(+), 33 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 29e0f174bf5..dfe9797f5ea 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -185,6 +185,15 @@ dependencies = [ "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "call-contract" +version = "0.1.0" +dependencies = [ + "common-types 0.1.0", + "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "cast" version = "0.2.2" @@ -405,7 +414,7 @@ dependencies = [ "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -419,7 +428,7 @@ dependencies = [ "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -432,7 +441,7 @@ dependencies = [ "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -539,7 +548,7 @@ name = "docopt" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", @@ -561,7 +570,7 @@ dependencies = [ "indexmap 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "lunarity-lexer 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -684,6 +693,7 @@ dependencies = [ "blooms-db 0.1.0", "bn 0.4.4 (git+https://github.com/paritytech/bn)", "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "call-contract 0.1.0", "common-types 0.1.0", "criterion 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -715,7 +725,7 @@ dependencies = [ "kvdb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb-memorydb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb-rocksdb 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "len-caching-lock 0.1.1", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "lru-cache 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -864,7 +874,7 @@ dependencies = [ "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -876,9 +886,13 @@ name = "ethcore-miner" version = "1.12.0" dependencies = [ "ansi_term 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", + "call-contract 0.1.0", "common-types 0.1.0", "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)", "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi 6.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi-contract 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi-derive 6.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethash 1.12.0", "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.3.0", @@ -1008,7 +1022,7 @@ dependencies = [ "keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb-rocksdb 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-crypto 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1135,7 +1149,7 @@ dependencies = [ "edit-distance 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "eth-secp256k1 0.5.7 (git+https://github.com/paritytech/rust-secp256k1)", "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "memzero 0.1.0", "parity-crypto 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1214,7 +1228,7 @@ dependencies = [ "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "memory-cache 0.1.0", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1353,7 +1367,7 @@ name = "fs-swap" version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "libloading 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1455,7 +1469,7 @@ name = "handlebars" version = "0.32.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "pest 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "pest_derive 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1809,7 +1823,7 @@ dependencies = [ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "globset 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)", - "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1912,11 +1926,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "lazy_static" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", -] [[package]] name = "lazycell" @@ -2365,7 +2376,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "ring 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ring 0.13.5 (registry+https://github.com/rust-lang/crates.io-index)", "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2666,7 +2677,7 @@ dependencies = [ "ethcore-sync 1.12.0", "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2734,7 +2745,7 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3131,7 +3142,7 @@ version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3218,11 +3229,11 @@ dependencies = [ [[package]] name = "ring" -version = "0.13.2" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3253,7 +3264,7 @@ name = "rlp_compress" version = "0.1.0" dependencies = [ "elastic-array 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3330,7 +3341,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "ring 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ring 0.13.5 (registry+https://github.com/rust-lang/crates.io-index)", "sct 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "webpki 0.18.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3369,7 +3380,7 @@ name = "sct" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "ring 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ring 0.13.5 (registry+https://github.com/rust-lang/crates.io-index)", "untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3652,7 +3663,7 @@ name = "thread_local" version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3794,7 +3805,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4109,7 +4120,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4123,7 +4134,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "if_chain 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4231,7 +4242,7 @@ name = "webpki" version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "ring 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ring 0.13.5 (registry+https://github.com/rust-lang/crates.io-index)", "untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -4486,7 +4497,7 @@ dependencies = [ "checksum kvdb-memorydb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "45bcdf5eb083602cff61a6f8438dce2a7900d714e893fc48781c39fb119d37aa" "checksum kvdb-rocksdb 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "06cf755dc587839ba34d3cbe3f12b6ad55850fbcdfe67336157a021a1a5c43ae" "checksum language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" -"checksum lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca488b89a5657b0a2ecd45b95609b3e848cf1755da332a0da46e2b2b1cb371a7" +"checksum lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a374c89b9db55895453a74c1e38861d9deec0b01b405a82516e9d5de4820dea1" "checksum lazycell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ddba4c30a78328befecec92fc94970e53b3ae385827d28620f0f5bb2493081e0" "checksum libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)" = "76e3a3ef172f1a0b9a9ff0dd1491ae5e6c948b94479a3021819ba7d860c8645d" "checksum libloading 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9c3ad660d7cb8c5822cd83d10897b0f1f1526792737a179e73896152f85b88c2" @@ -4589,7 +4600,7 @@ dependencies = [ "checksum regex-syntax 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "747ba3b235651f6e2f67dfa8bcdcd073ddb7c243cb21c442fc12395dfcac212d" "checksum relay 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1576e382688d7e9deecea24417e350d3062d97e32e45d70b1cde65994ff1489a" "checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5" -"checksum ring 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe642b9dd1ba0038d78c4a3999d1ee56178b4d415c1e1fbaba83b06dce012f0" +"checksum ring 0.13.5 (registry+https://github.com/rust-lang/crates.io-index)" = "2c4db68a2e35f3497146b7e4563df7d4773a2433230c5e4b448328e31740458a" "checksum rlp 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "524c5ad554859785dfc8469df3ed5e0b5784d4d335877ed47c8d90fc0eb238fe" "checksum rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "16d1effe9845d54f90e7be8420ee49e5c94623140b97ee4bc6fb5bfddb745720" "checksum rpassword 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b273c91bd242ca03ad6d71c143b6f17a48790e61f21a6c78568fa2b6774a24a4" From f2a0e25d62426de9b45492b6e81cc2d116d9531e Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Mon, 14 Jan 2019 12:26:17 +0100 Subject: [PATCH 08/14] Re-export call_contract --- ethcore/call-contract/src/lib.rs | 3 +++ ethcore/src/client/client.rs | 2 +- ethcore/src/client/mod.rs | 4 ++-- ethcore/src/client/test_client.rs | 2 +- ethcore/src/client/traits.rs | 4 ++-- miner/src/service_transaction_checker.rs | 2 +- 6 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ethcore/call-contract/src/lib.rs b/ethcore/call-contract/src/lib.rs index 8a0d6b86c21..13aacde3a34 100644 --- a/ethcore/call-contract/src/lib.rs +++ b/ethcore/call-contract/src/lib.rs @@ -15,3 +15,6 @@ // along with Parity Ethereum. If not, see . pub mod call_contract; + +// Re-export +pub use self::call_contract::*; diff --git a/ethcore/src/client/client.rs b/ethcore/src/client/client.rs index 584c361ad38..412e4c1e7ae 100644 --- a/ethcore/src/client/client.rs +++ b/ethcore/src/client/client.rs @@ -23,7 +23,7 @@ use std::time::{Instant, Duration}; use blockchain::{BlockReceipts, BlockChain, BlockChainDB, BlockProvider, TreeRoute, ImportRoute, TransactionAddress, ExtrasInsert}; use bytes::Bytes; -use call_contract::call_contract::CallContract; +use call_contract::CallContract; use ethcore_miner::pool::VerifiedTransaction; use ethereum_types::{H256, Address, U256}; use evm::Schedule; diff --git a/ethcore/src/client/mod.rs b/ethcore/src/client/mod.rs index 0e2f20587c8..c2204f3db65 100644 --- a/ethcore/src/client/mod.rs +++ b/ethcore/src/client/mod.rs @@ -46,8 +46,8 @@ pub use types::ids::*; pub use types::trace_filter::Filter as TraceFilter; pub use types::pruning_info::PruningInfo; pub use types::call_analytics::CallAnalytics; -pub use call_contract::call_contract::CallContract; -pub use call_contract::call_contract::RegistryInfo; +pub use call_contract::CallContract; +pub use call_contract::RegistryInfo; pub use executive::{Executed, Executive, TransactOptions}; pub use vm::{LastHashes, EnvInfo}; diff --git a/ethcore/src/client/test_client.rs b/ethcore/src/client/test_client.rs index b331cf6872c..88b9d0c96c5 100644 --- a/ethcore/src/client/test_client.rs +++ b/ethcore/src/client/test_client.rs @@ -49,7 +49,7 @@ use types::views::BlockView; use vm::Schedule; use block::{OpenBlock, SealedBlock, ClosedBlock}; -use call_contract::call_contract::CallContract; +use call_contract::CallContract; use client::{ Nonce, Balance, ChainInfo, BlockInfo, ReopenBlock, /* CallContract,*/ TransactionInfo, RegistryInfo, PrepareOpenBlock, BlockChainClient, BlockChainInfo, BlockStatus, BlockId, Mode, diff --git a/ethcore/src/client/traits.rs b/ethcore/src/client/traits.rs index 2d6e124ff0d..32b779ba5e6 100644 --- a/ethcore/src/client/traits.rs +++ b/ethcore/src/client/traits.rs @@ -19,8 +19,8 @@ use std::sync::Arc; use blockchain::{BlockReceipts, TreeRoute}; use bytes::Bytes; -use call_contract::call_contract::CallContract; -use call_contract::call_contract::RegistryInfo; +use call_contract::CallContract; +use call_contract::RegistryInfo; use ethcore_miner::pool::VerifiedTransaction; use ethereum_types::{H256, U256, Address}; use evm::Schedule; diff --git a/miner/src/service_transaction_checker.rs b/miner/src/service_transaction_checker.rs index a12f581e560..17776f1569e 100644 --- a/miner/src/service_transaction_checker.rs +++ b/miner/src/service_transaction_checker.rs @@ -16,7 +16,7 @@ //! A service transactions contract checker. -use call_contract::call_contract::{CallContract, RegistryInfo}; +use call_contract::{CallContract, RegistryInfo}; use types::ids::BlockId; use types::transaction::SignedTransaction; use ethabi::FunctionOutputDecoder; From e1a27774801e8848d5432f586e7ca606b5f15959 Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Mon, 14 Jan 2019 14:28:09 +0100 Subject: [PATCH 09/14] Merge CallContract and RegistryInfo imports --- ethcore/src/client/client.rs | 4 ++-- ethcore/src/client/mod.rs | 3 +-- ethcore/src/client/traits.rs | 3 +-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/ethcore/src/client/client.rs b/ethcore/src/client/client.rs index 412e4c1e7ae..d9f7f9dd549 100644 --- a/ethcore/src/client/client.rs +++ b/ethcore/src/client/client.rs @@ -23,7 +23,7 @@ use std::time::{Instant, Duration}; use blockchain::{BlockReceipts, BlockChain, BlockChainDB, BlockProvider, TreeRoute, ImportRoute, TransactionAddress, ExtrasInsert}; use bytes::Bytes; -use call_contract::CallContract; +use call_contract::{CallContract, RegistryInfo}; use ethcore_miner::pool::VerifiedTransaction; use ethereum_types::{H256, Address, U256}; use evm::Schedule; @@ -48,7 +48,7 @@ use block::{IsBlock, LockedBlock, Drain, ClosedBlock, OpenBlock, enact_verified, use client::ancient_import::AncientVerifier; use client::{ Nonce, Balance, ChainInfo, BlockInfo, /*CallContract,*/ TransactionInfo, - RegistryInfo, ReopenBlock, PrepareOpenBlock, ScheduleInfo, ImportSealedBlock, + /*RegistryInfo,*/ ReopenBlock, PrepareOpenBlock, ScheduleInfo, ImportSealedBlock, BroadcastProposalBlock, ImportBlock, StateOrBlock, StateInfo, StateClient, Call, AccountData, BlockChain as BlockChainTrait, BlockProducer, SealedBlockImporter, ClientIoMessage, diff --git a/ethcore/src/client/mod.rs b/ethcore/src/client/mod.rs index c2204f3db65..bd891ab2dca 100644 --- a/ethcore/src/client/mod.rs +++ b/ethcore/src/client/mod.rs @@ -46,8 +46,7 @@ pub use types::ids::*; pub use types::trace_filter::Filter as TraceFilter; pub use types::pruning_info::PruningInfo; pub use types::call_analytics::CallAnalytics; -pub use call_contract::CallContract; -pub use call_contract::RegistryInfo; +pub use call_contract::{CallContract, RegistryInfo}; pub use executive::{Executed, Executive, TransactOptions}; pub use vm::{LastHashes, EnvInfo}; diff --git a/ethcore/src/client/traits.rs b/ethcore/src/client/traits.rs index 32b779ba5e6..9f6d300ecdd 100644 --- a/ethcore/src/client/traits.rs +++ b/ethcore/src/client/traits.rs @@ -19,8 +19,7 @@ use std::sync::Arc; use blockchain::{BlockReceipts, TreeRoute}; use bytes::Bytes; -use call_contract::CallContract; -use call_contract::RegistryInfo; +use call_contract::{CallContract, RegistryInfo}; use ethcore_miner::pool::VerifiedTransaction; use ethereum_types::{H256, U256, Address}; use evm::Schedule; From 8415acb4b4447ed4c0dc5acd24225bfadc15c8b7 Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Mon, 14 Jan 2019 14:38:45 +0100 Subject: [PATCH 10/14] Remove commented code --- ethcore/src/client/client.rs | 4 ++-- ethcore/src/client/mod.rs | 2 +- ethcore/src/client/test_client.rs | 4 ++-- ethcore/src/client/traits.rs | 12 ------------ 4 files changed, 5 insertions(+), 17 deletions(-) diff --git a/ethcore/src/client/client.rs b/ethcore/src/client/client.rs index d9f7f9dd549..68dfe8ca392 100644 --- a/ethcore/src/client/client.rs +++ b/ethcore/src/client/client.rs @@ -47,8 +47,8 @@ use vm::{EnvInfo, LastHashes}; use block::{IsBlock, LockedBlock, Drain, ClosedBlock, OpenBlock, enact_verified, SealedBlock}; use client::ancient_import::AncientVerifier; use client::{ - Nonce, Balance, ChainInfo, BlockInfo, /*CallContract,*/ TransactionInfo, - /*RegistryInfo,*/ ReopenBlock, PrepareOpenBlock, ScheduleInfo, ImportSealedBlock, + Nonce, Balance, ChainInfo, BlockInfo, TransactionInfo, + ReopenBlock, PrepareOpenBlock, ScheduleInfo, ImportSealedBlock, BroadcastProposalBlock, ImportBlock, StateOrBlock, StateInfo, StateClient, Call, AccountData, BlockChain as BlockChainTrait, BlockProducer, SealedBlockImporter, ClientIoMessage, diff --git a/ethcore/src/client/mod.rs b/ethcore/src/client/mod.rs index bd891ab2dca..f97b2cb7535 100644 --- a/ethcore/src/client/mod.rs +++ b/ethcore/src/client/mod.rs @@ -36,7 +36,7 @@ pub use self::io_message::ClientIoMessage; pub use self::test_client::{TestBlockChainClient, EachBlockWith}; pub use self::chain_notify::{ChainNotify, NewBlocks, ChainRoute, ChainRouteType, ChainMessageType}; pub use self::traits::{ - Nonce, Balance, ChainInfo, BlockInfo, ReopenBlock, PrepareOpenBlock, /*CallContract,*/ TransactionInfo, /*RegistryInfo,*/ ScheduleInfo, ImportSealedBlock, BroadcastProposalBlock, ImportBlock, + Nonce, Balance, ChainInfo, BlockInfo, ReopenBlock, PrepareOpenBlock, TransactionInfo, ScheduleInfo, ImportSealedBlock, BroadcastProposalBlock, ImportBlock, StateOrBlock, StateClient, Call, EngineInfo, AccountData, BlockChain, BlockProducer, SealedBlockImporter, BadBlocks, }; pub use state::StateInfo; diff --git a/ethcore/src/client/test_client.rs b/ethcore/src/client/test_client.rs index 88b9d0c96c5..5236f7cd409 100644 --- a/ethcore/src/client/test_client.rs +++ b/ethcore/src/client/test_client.rs @@ -49,9 +49,9 @@ use types::views::BlockView; use vm::Schedule; use block::{OpenBlock, SealedBlock, ClosedBlock}; -use call_contract::CallContract; +use call_contract::{CallContract, RegistryInfo}; use client::{ - Nonce, Balance, ChainInfo, BlockInfo, ReopenBlock, /* CallContract,*/ TransactionInfo, RegistryInfo, + Nonce, Balance, ChainInfo, BlockInfo, ReopenBlock, TransactionInfo, PrepareOpenBlock, BlockChainClient, BlockChainInfo, BlockStatus, BlockId, Mode, TransactionId, UncleId, TraceId, TraceFilter, LastHashes, CallAnalytics, ProvingBlockChainClient, ScheduleInfo, ImportSealedBlock, BroadcastProposalBlock, ImportBlock, StateOrBlock, diff --git a/ethcore/src/client/traits.rs b/ethcore/src/client/traits.rs index 9f6d300ecdd..b273bd3dcb2 100644 --- a/ethcore/src/client/traits.rs +++ b/ethcore/src/client/traits.rs @@ -158,12 +158,6 @@ pub trait StateClient { /// Provides various blockchain information, like block header, chain state etc. pub trait BlockChain: ChainInfo + BlockInfo + TransactionInfo {} -// /// Provides information on a blockchain service and it's registry -// pub trait RegistryInfo { -// /// Get the address of a particular blockchain service, if available. -// fn registry_address(&self, name: String, block: BlockId) -> Option
; -// } - // FIXME Why these methods belong to BlockChainClient and not MiningBlockChainClient? /// Provides methods to import block into blockchain pub trait ImportBlock { @@ -171,12 +165,6 @@ pub trait ImportBlock { fn import_block(&self, block: Unverified) -> EthcoreResult; } -// /// Provides `call_contract` method -// pub trait CallContract { -// /// Like `call`, but with various defaults. Designed to be used for calling contracts. -// fn call_contract(&self, id: BlockId, address: Address, data: Bytes) -> Result; -// } - /// Provides `call` and `call_many` methods pub trait Call { /// Type representing chain state From 89c0a2a35263791c270049063ce6d5b364ccb0ff Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Mon, 14 Jan 2019 14:51:00 +0100 Subject: [PATCH 11/14] Add documentation to call_contract crate --- ethcore/call-contract/src/call_contract.rs | 4 +++- ethcore/call-contract/src/lib.rs | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ethcore/call-contract/src/call_contract.rs b/ethcore/call-contract/src/call_contract.rs index 1b43f772f4b..8b042f0833c 100644 --- a/ethcore/call-contract/src/call_contract.rs +++ b/ethcore/call-contract/src/call_contract.rs @@ -14,6 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Parity Ethereum. If not, see . +//! Provides CallContract and RegistryInfo traits + use bytes::Bytes; use ethereum_types::Address; use types::ids::BlockId; @@ -28,4 +30,4 @@ pub trait CallContract { pub trait RegistryInfo { /// Get the address of a particular blockchain service, if available. fn registry_address(&self, name: String, block: BlockId) -> Option
; -} \ No newline at end of file +} diff --git a/ethcore/call-contract/src/lib.rs b/ethcore/call-contract/src/lib.rs index 13aacde3a34..b509edd7ffa 100644 --- a/ethcore/call-contract/src/lib.rs +++ b/ethcore/call-contract/src/lib.rs @@ -14,6 +14,11 @@ // You should have received a copy of the GNU General Public License // along with Parity Ethereum. If not, see . +#![warn(missing_docs)] + +//! Call Contract module +//! Provides CallContract and RegistryInfo traits + pub mod call_contract; // Re-export From bb1c476cef8e67efbb414b91b500cba7dad291af Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Mon, 14 Jan 2019 16:03:43 +0100 Subject: [PATCH 12/14] Add TODO for removal of re-exports --- ethcore/src/client/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ethcore/src/client/mod.rs b/ethcore/src/client/mod.rs index f97b2cb7535..0bb5a2f10d2 100644 --- a/ethcore/src/client/mod.rs +++ b/ethcore/src/client/mod.rs @@ -46,6 +46,8 @@ pub use types::ids::*; pub use types::trace_filter::Filter as TraceFilter; pub use types::pruning_info::PruningInfo; pub use types::call_analytics::CallAnalytics; + +// TODO: Get rid of re-exports: https://github.com/paritytech/parity-ethereum/issues/10130 pub use call_contract::{CallContract, RegistryInfo}; pub use executive::{Executed, Executive, TransactOptions}; From 5ab599af00f9bc650664b063026af251f84c0e6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Mon, 14 Jan 2019 16:26:09 +0100 Subject: [PATCH 13/14] Update call-contract crate description Co-Authored-By: HCastano --- ethcore/call-contract/src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ethcore/call-contract/src/lib.rs b/ethcore/call-contract/src/lib.rs index b509edd7ffa..1cbfb11378e 100644 --- a/ethcore/call-contract/src/lib.rs +++ b/ethcore/call-contract/src/lib.rs @@ -17,7 +17,9 @@ #![warn(missing_docs)] //! Call Contract module -//! Provides CallContract and RegistryInfo traits +//! +//! This crate exposes traits required to call contracts at particular block. +//! All utilities that depend on on-chain data should use those traits to access it. pub mod call_contract; From 29269f7b8a82a0bdf11810d537e66473ece40ff1 Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Wed, 16 Jan 2019 16:55:53 +0100 Subject: [PATCH 14/14] Rename call-contract crate to ethcore-call-contract --- Cargo.lock | 22 +++++++++++----------- ethcore/Cargo.toml | 2 +- ethcore/call-contract/Cargo.toml | 2 +- ethcore/src/lib.rs | 2 +- miner/Cargo.toml | 2 +- miner/src/lib.rs | 2 +- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8357db3ce21..811e41a1633 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -185,15 +185,6 @@ dependencies = [ "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "call-contract" -version = "0.1.0" -dependencies = [ - "common-types 0.1.0", - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "cast" version = "0.2.2" @@ -693,7 +684,6 @@ dependencies = [ "blooms-db 0.1.0", "bn 0.4.4 (git+https://github.com/paritytech/bn)", "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "call-contract 0.1.0", "common-types 0.1.0", "criterion 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -705,6 +695,7 @@ dependencies = [ "ethash 1.12.0", "ethcore-blockchain 0.1.0", "ethcore-bloom-journal 0.1.0", + "ethcore-call-contract 0.1.0", "ethcore-db 0.1.0", "ethcore-io 1.12.0", "ethcore-miner 1.12.0", @@ -794,6 +785,15 @@ dependencies = [ "siphasher 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "ethcore-call-contract" +version = "0.1.0" +dependencies = [ + "common-types 0.1.0", + "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "ethcore-db" version = "0.1.0" @@ -886,7 +886,6 @@ name = "ethcore-miner" version = "1.12.0" dependencies = [ "ansi_term 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", - "call-contract 0.1.0", "common-types 0.1.0", "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)", "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -894,6 +893,7 @@ dependencies = [ "ethabi-contract 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethabi-derive 6.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethash 1.12.0", + "ethcore-call-contract 0.1.0", "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.3.0", "fetch 0.1.0", diff --git a/ethcore/Cargo.toml b/ethcore/Cargo.toml index 4014b242135..538da894c73 100644 --- a/ethcore/Cargo.toml +++ b/ethcore/Cargo.toml @@ -11,7 +11,6 @@ ansi_term = "0.10" blooms-db = { path = "../util/blooms-db", optional = true } bn = { git = "https://github.com/paritytech/bn", default-features = false } byteorder = "1.0" -call-contract = { path = "./call-contract" } common-types = { path = "types" } crossbeam = "0.4" env_logger = { version = "0.5", optional = true } @@ -22,6 +21,7 @@ ethabi-derive = "6.0" ethash = { path = "../ethash" } ethcore-blockchain = { path = "./blockchain" } ethcore-bloom-journal = { path = "../util/bloom" } +ethcore-call-contract = { path = "./call-contract" } ethcore-db = { path = "./db" } ethcore-io = { path = "../util/io" } ethcore-miner = { path = "../miner" } diff --git a/ethcore/call-contract/Cargo.toml b/ethcore/call-contract/Cargo.toml index 649d807e018..068434a1dec 100644 --- a/ethcore/call-contract/Cargo.toml +++ b/ethcore/call-contract/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "call-contract" +name = "ethcore-call-contract" version = "0.1.0" license = "GPL-3.0" authors = ["Parity Technologies "] diff --git a/ethcore/src/lib.rs b/ethcore/src/lib.rs index f3e500ba8ac..8d7a52e4033 100644 --- a/ethcore/src/lib.rs +++ b/ethcore/src/lib.rs @@ -60,7 +60,7 @@ extern crate ansi_term; extern crate bn; extern crate byteorder; -extern crate call_contract; +extern crate ethcore_call_contract as call_contract; extern crate common_types as types; extern crate crossbeam; extern crate ethabi; diff --git a/miner/Cargo.toml b/miner/Cargo.toml index 1aebb3a2a1a..02e64ad4f8d 100644 --- a/miner/Cargo.toml +++ b/miner/Cargo.toml @@ -15,12 +15,12 @@ url = { version = "1", optional = true } # Miner ansi_term = "0.10" -call-contract = { path = "../ethcore/call-contract" } common-types = { path = "../ethcore/types" } error-chain = "0.12" ethabi = "6.0" ethabi-derive = "6.0" ethabi-contract = "6.0" +ethcore-call-contract = { path = "../ethcore/call-contract" } ethereum-types = "0.4" futures = "0.1" heapsize = "0.4" diff --git a/miner/src/lib.rs b/miner/src/lib.rs index c96692042fb..921e6dbaadc 100644 --- a/miner/src/lib.rs +++ b/miner/src/lib.rs @@ -20,9 +20,9 @@ //! Keeps track of transactions and mined block. extern crate ansi_term; -extern crate call_contract; extern crate common_types as types; extern crate ethabi; +extern crate ethcore_call_contract as call_contract; extern crate ethereum_types; extern crate futures; extern crate heapsize;