Skip to content
This repository was archived by the owner on Nov 6, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
4512701
Refactor updater to use ethabi-derive
axelchalon Oct 25, 2017
6f583c5
Grumble: do_call type alias
axelchalon Nov 2, 2017
a970c45
Empty commit to trigger test re-run
axelchalon Nov 3, 2017
9bf5943
migration to ethabi-5.0
debris Jan 22, 2018
109dc3f
Merge branch 'master' into ethabi-5
debris Jan 24, 2018
4e6bbf3
migration to ethabi-5.0 in progress
debris Jan 25, 2018
6f6800e
ethabi 5.1
debris Jan 25, 2018
6d5b9aa
use ethabi_deriven to generate TransactAcl contract
debris Jan 27, 2018
e51acbe
use ethabi_deriven to generate Registry contract
debris Jan 27, 2018
7b0c5ec
hash-fetch uses ethabi_derive, removed retain cycle from updater, fix…
debris Jan 29, 2018
867016b
node-filter crate uses ethabi_derive to generate peer_set contract in…
debris Jan 29, 2018
66a0076
use LruCache in node-filter instead of HashMap
debris Jan 29, 2018
8fb80d1
Merge branch 'master' into ethabi-5
debris Jan 31, 2018
f435922
validator_set engine uses ethabi_derive
debris Jan 31, 2018
816eb13
ethcore does not depend on native_contracts
debris Feb 1, 2018
2f26dd9
miner does no depend on native_contracts
debris Feb 1, 2018
0dc5d57
secret_store does not use native_contracts (in progress)
debris Feb 2, 2018
dc84c4e
removed native-contracts
debris Feb 2, 2018
6a9e653
ethcore and updater does not depend on futures
debris Feb 2, 2018
7e3b077
updated ethereum-types
debris Feb 4, 2018
fbd0c7e
Merge branch 'master' into ethabi-5
debris Feb 5, 2018
bf6cbb0
fixed all warnings caused by using new version of ethereum-types
debris Feb 6, 2018
8f55177
Merge branch 'master' into ethabi-5
debris Feb 6, 2018
86437e8
updated ethabi_derive && ethabi_contract to get rid of warnings
debris Feb 6, 2018
1b44389
removed another retain cycle in updater, fixed following minor versio…
debris Feb 6, 2018
f207aa0
moved contracts out of native_contracts res
debris Feb 6, 2018
251bc23
updated ethabi_contract
debris Feb 6, 2018
dde4083
fixed failing test
debris Feb 6, 2018
0704701
fixed failing test
debris Feb 6, 2018
406b03f
Merge branch 'master' into ethabi-5
debris Feb 7, 2018
29321d5
there is no need to create two contracts of the same kind any more
debris Feb 7, 2018
2ac0a88
simplify updater::ReleaseTrack conversion into u8 and add several tes…
debris Feb 7, 2018
74ee624
Merge branch 'master' into ethabi-5
debris Feb 7, 2018
59e13a3
applied review suggestions
debris Feb 8, 2018
ac15ce2
applied review suggestions
debris Feb 8, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
495 changes: 258 additions & 237 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ ethcore-miner = { path = "miner" }
ethcore-network = { path = "util/network" }
ethcore-stratum = { path = "stratum" }
ethcore-transaction = { path = "ethcore/transaction" }
ethereum-types = "0.1"
ethereum-types = "0.2"
node-filter = { path = "ethcore/node_filter" }
ethkey = { path = "ethkey" }
node-health = { path = "dapps/node-health" }
Expand Down
4 changes: 2 additions & 2 deletions dapps/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ log = "0.3"
parity-dapps-glue = "1.9"
parking_lot = "0.5"
mime_guess = "2.0.0-alpha.2"
rand = "0.3"
rand = "0.4"
rustc-hex = "1.0"
serde = "1.0"
serde_derive = "1.0"
Expand All @@ -29,7 +29,7 @@ jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc.git", branch = "pa
jsonrpc-http-server = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.10" }

ethcore-bytes = { path = "../util/bytes" }
ethereum-types = "0.1"
ethereum-types = "0.2"
fetch = { path = "../util/fetch" }
node-health = { path = "./node-health" }
parity-hash-fetch = { path = "../hash-fetch" }
Expand Down
16 changes: 8 additions & 8 deletions dapps/src/apps/fetcher/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ mod installers;
use std::{fs, env};
use std::path::PathBuf;
use std::sync::Arc;
use rustc_hex::FromHex;
use futures::{future, Future};
use futures_cpupool::CpuPool;
use fetch::{Client as FetchClient, Fetch};
use hash_fetch::urlhint::{URLHintContract, URLHint, URLHintResult};

use hyper::StatusCode;

use ethereum_types::H256;
use {Embeddable, SyncStatus, random_filename};
use parking_lot::Mutex;
use page::local;
Expand Down Expand Up @@ -132,7 +132,7 @@ impl<R: URLHint + 'static, F: Fetch> ContentFetcher<F, R> {

// resolve contract call synchronously.
// TODO: port to futures-based hyper and make it all async.
fn resolve(&self, content_id: Vec<u8>) -> Option<URLHintResult> {
fn resolve(&self, content_id: H256) -> Option<URLHintResult> {
self.resolver.resolve(content_id)
.wait()
.unwrap_or_else(|e| { warn!("Error resolving content-id: {}", e); None })
Expand All @@ -149,7 +149,7 @@ impl<R: URLHint + 'static, F: Fetch> Fetcher for ContentFetcher<F, R> {
}
}
// fallback to resolver
if let Ok(content_id) = content_id.from_hex() {
if let Ok(content_id) = content_id.parse() {
// if there is content or we are syncing return true
self.sync.is_major_importing() || self.resolve(content_id).is_some()
} else {
Expand Down Expand Up @@ -178,7 +178,7 @@ impl<R: URLHint + 'static, F: Fetch> Endpoint for ContentFetcher<F, R> {
// We need to start fetching the content
_ => {
trace!(target: "dapps", "Content unavailable. Fetching... {:?}", content_id);
let content_hex = content_id.from_hex().expect("to_handler is called only when `contains` returns true.");
let content_hex = content_id.parse().expect("to_handler is called only when `contains` returns true.");
let content = self.resolve(content_hex);

let cache = self.cache.clone();
Expand Down Expand Up @@ -280,10 +280,10 @@ impl<R: URLHint + 'static, F: Fetch> Endpoint for ContentFetcher<F, R> {
mod tests {
use std::env;
use std::sync::Arc;
use bytes::Bytes;
use fetch::{Fetch, Client};
use futures::future;
use hash_fetch::urlhint::{URLHint, URLHintResult, BoxFuture};
use futures::{future, Future};
use hash_fetch::urlhint::{URLHint, URLHintResult};
use ethereum_types::H256;

use apps::cache::ContentStatus;
use endpoint::EndpointInfo;
Expand All @@ -294,7 +294,7 @@ mod tests {
#[derive(Clone)]
struct FakeResolver;
impl URLHint for FakeResolver {
fn resolve(&self, _id: Bytes) -> BoxFuture<Option<URLHintResult>, String> {
fn resolve(&self, _id: H256) -> Box<Future<Item = Option<URLHintResult>, Error = String> + Send> {
Box::new(future::ok(None))
}
}
Expand Down
5 changes: 3 additions & 2 deletions dapps/src/tests/helpers/registrar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ use std::str;
use std::sync::Arc;
use std::collections::HashMap;

use futures::Future;
use ethereum_types::{H256, Address};
use bytes::{Bytes, ToPretty};
use hash_fetch::urlhint::{ContractClient, BoxFuture};
use hash_fetch::urlhint::ContractClient;
use parking_lot::Mutex;
use rustc_hex::FromHex;

Expand Down Expand Up @@ -66,7 +67,7 @@ impl ContractClient for FakeRegistrar {
Ok(REGISTRAR.parse().unwrap())
}

fn call(&self, address: Address, data: Bytes) -> BoxFuture<Bytes, String> {
fn call(&self, address: Address, data: Bytes) -> Box<Future<Item = Bytes, Error = String> + Send> {
let call = (address.to_hex(), data.to_hex());
self.calls.lock().push(call.clone());
let res = self.responses.lock().get(&call).cloned().expect(&format!("No response for call: {:?}", call));
Expand Down
12 changes: 5 additions & 7 deletions ethcore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,28 @@ ethcore-logger = { path = "../logger" }
ethcore-miner = { path = "../miner" }
ethcore-stratum = { path = "../stratum" }
ethcore-transaction = { path = "./transaction" }
ethereum-types = "0.1"
ethereum-types = "0.2"
memory-cache = { path = "../util/memory_cache" }
ethabi = "5.1"
ethabi-derive = "5.0"
ethabi-contract = "5.0"
ethjson = { path = "../json" }
ethkey = { path = "../ethkey" }
ethstore = { path = "../ethstore" }
evm = { path = "evm" }
futures = "0.1"
hardware-wallet = { path = "../hw" }
heapsize = "0.4"
itertools = "0.5"
lazy_static = "1.0"
log = "0.3"
lru-cache = "0.1"
native-contracts = { path = "native_contracts" }
num = "0.1"
num_cpus = "1.2"
parity-machine = { path = "../machine" }
parking_lot = "0.5"
price-info = { path = "../price-info" }
rayon = "0.8"
rand = "0.3"
rand = "0.4"
rlp = { path = "../util/rlp" }
rlp_derive = { path = "../util/rlp_derive" }
kvdb = { path = "../util/kvdb" }
Expand All @@ -70,9 +71,6 @@ unexpected = { path = "../util/unexpected" }
journaldb = { path = "../util/journaldb" }
tempdir = "0.3"

[dev-dependencies]
native-contracts = { path = "native_contracts", features = ["test_contracts"] }

[features]
jit = ["evm/jit"]
evm-debug = ["slow-blocks"]
Expand Down
2 changes: 1 addition & 1 deletion ethcore/evm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Parity Technologies <admin@parity.io>"]

[dependencies]
bit-set = "0.4"
ethereum-types = "0.1"
ethereum-types = "0.2"
evmjit = { path = "../../evmjit", optional = true }
heapsize = "0.4"
lazy_static = "1.0"
Expand Down
4 changes: 2 additions & 2 deletions ethcore/light/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ log = "0.3"
ethcore = { path = ".."}
ethcore-bytes = { path = "../../util/bytes" }
ethcore-transaction = { path = "../transaction" }
ethereum-types = "0.1"
ethereum-types = "0.2"
memorydb = { path = "../../util/memorydb" }
patricia-trie = { path = "../../util/patricia_trie" }
ethcore-network = { path = "../../util/network" }
Expand All @@ -26,7 +26,7 @@ rlp_derive = { path = "../../util/rlp_derive" }
time = "0.1"
smallvec = "0.4"
futures = "0.1"
rand = "0.3"
rand = "0.4"
itertools = "0.5"
bincode = "0.8.0"
serde = "1.0"
Expand Down
19 changes: 10 additions & 9 deletions ethcore/light/src/client/header_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,7 @@ mod tests {
use super::HeaderChain;
use std::sync::Arc;

use ethereum_types::U256;
use ethcore::ids::BlockId;
use ethcore::header::Header;
use ethcore::spec::Spec;
Expand Down Expand Up @@ -755,7 +756,7 @@ mod tests {
header.set_parent_hash(parent_hash);
header.set_number(i);
header.set_timestamp(rolling_timestamp);
header.set_difficulty(*genesis_header.difficulty() * i.into());
header.set_difficulty(*genesis_header.difficulty() * i as u32);
parent_hash = header.hash();

let mut tx = db.transaction();
Expand Down Expand Up @@ -788,7 +789,7 @@ mod tests {
header.set_parent_hash(parent_hash);
header.set_number(i);
header.set_timestamp(rolling_timestamp);
header.set_difficulty(*genesis_header.difficulty() * i.into());
header.set_difficulty(*genesis_header.difficulty() * i as u32);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps change the loop range to be u32 instead?

Copy link
Copy Markdown
Collaborator Author

@debris debris Feb 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is also header.set_number(i) which uses i. So one of them have to be casted

parent_hash = header.hash();

let mut tx = db.transaction();
Expand All @@ -807,7 +808,7 @@ mod tests {
header.set_parent_hash(parent_hash);
header.set_number(i);
header.set_timestamp(rolling_timestamp);
header.set_difficulty(*genesis_header.difficulty() * i.into());
header.set_difficulty(*genesis_header.difficulty() * i as u32);
parent_hash = header.hash();

let mut tx = db.transaction();
Expand All @@ -831,7 +832,7 @@ mod tests {
header.set_parent_hash(parent_hash);
header.set_number(i);
header.set_timestamp(rolling_timestamp);
header.set_difficulty(*genesis_header.difficulty() * (i * i).into());
header.set_difficulty(*genesis_header.difficulty() * U256::from(i * i));
parent_hash = header.hash();

let mut tx = db.transaction();
Expand Down Expand Up @@ -884,7 +885,7 @@ mod tests {
header.set_parent_hash(parent_hash);
header.set_number(i);
header.set_timestamp(rolling_timestamp);
header.set_difficulty(*genesis_header.difficulty() * i.into());
header.set_difficulty(*genesis_header.difficulty() * i as u32);
parent_hash = header.hash();

let mut tx = db.transaction();
Expand Down Expand Up @@ -922,7 +923,7 @@ mod tests {
header.set_parent_hash(parent_hash);
header.set_number(i);
header.set_timestamp(rolling_timestamp);
header.set_difficulty(*genesis_header.difficulty() * i.into());
header.set_difficulty(*genesis_header.difficulty() * i as u32);
parent_hash = header.hash();

let mut tx = db.transaction();
Expand All @@ -939,7 +940,7 @@ mod tests {
header.set_parent_hash(parent_hash);
header.set_number(i);
header.set_timestamp(rolling_timestamp);
header.set_difficulty(*genesis_header.difficulty() * i.into() * 1000.into());
header.set_difficulty(*genesis_header.difficulty() * U256::from(i as u32 * 1000u32));
parent_hash = header.hash();

let mut tx = db.transaction();
Expand Down Expand Up @@ -989,7 +990,7 @@ mod tests {
header.set_parent_hash(parent_hash);
header.set_number(i);
header.set_timestamp(rolling_timestamp);
header.set_difficulty(*genesis_header.difficulty() * i.into());
header.set_difficulty(*genesis_header.difficulty() * i as u32);
parent_hash = header.hash();

let mut tx = db.transaction();
Expand Down Expand Up @@ -1023,7 +1024,7 @@ mod tests {
header.set_parent_hash(parent_hash);
header.set_number(i);
header.set_timestamp(rolling_timestamp);
header.set_difficulty(*genesis_header.difficulty() * i.into());
header.set_difficulty(*genesis_header.difficulty() * i as u32);
parent_hash = header.hash();

let mut tx = db.transaction();
Expand Down
4 changes: 2 additions & 2 deletions ethcore/light/src/net/request_credits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ impl FlowParams {
/// and number of requests made.
pub fn compute_cost(&self, request: &Request) -> Option<U256> {
match *request {
Request::Headers(ref req) => self.costs.headers.map(|c| c * req.max.into()),
Request::Headers(ref req) => self.costs.headers.map(|c| c * U256::from(req.max)),
Request::HeaderProof(_) => self.costs.header_proof,
Request::TransactionIndex(_) => self.costs.transaction_index,
Request::Body(_) => self.costs.body,
Expand Down Expand Up @@ -444,6 +444,6 @@ mod tests {
);

assert_eq!(flow_params2.costs, flow_params3.costs);
assert_eq!(flow_params.costs.headers.unwrap(), flow_params2.costs.headers.unwrap() * 2.into());
assert_eq!(flow_params.costs.headers.unwrap(), flow_params2.costs.headers.unwrap() * 2u32);
}
}
2 changes: 1 addition & 1 deletion ethcore/migrations/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Parity Technologies <admin@parity.io>"]

[dependencies]
ethcore-bytes = { path = "../../util/bytes" }
ethereum-types = "0.1.4"
ethereum-types = "0.2"
keccak-hash = { path = "../../util/hash" }
kvdb = { path = "../../util/kvdb" }
kvdb-rocksdb = { path = "../../util/kvdb-rocksdb" }
Expand Down
19 changes: 0 additions & 19 deletions ethcore/native_contracts/Cargo.toml

This file was deleted.

64 changes: 0 additions & 64 deletions ethcore/native_contracts/build.rs

This file was deleted.

9 changes: 0 additions & 9 deletions ethcore/native_contracts/generator/Cargo.toml

This file was deleted.

Loading