Fetch parity-common crates from crates.io (#9410)

* Fetch `parity-common` crates from crates.io

* Add doc tests from `patricia-trie` to `patricia-trie-ethereum`
Fix/update a few deps

* [ethkey] upgrade ethereum-types

* [whisper] update deps

* [network] deps

* [network-devp2p] deps

* [journaldb] deps

* [fastmap] deps

* [miner] deps and test fixes

* [machine] deps

* [json] deps

* [hw] deps

* [ethash] deps

* [registrar] deps

* Update a few more dependencies with new ethabi-*

* [updater] Update deps

* deps

* [ethcore] Update deps

* Use new parity-snappy and parity-rocksdb crates

* Updated submodules

* Use parity-snappy 0.1

* Use kvdb-rocksdb 0.1.2

* Don't use latest ethereum/tests

* Fix merge conflicts errors

* Remove superseeded comment

* Address grumbles: add newlines, add/remove spaces
This commit is contained in:
David
2018-09-04 20:13:51 +02:00
committed by GitHub
parent 51eac1926f
commit 72fd1fa58d
91 changed files with 1547 additions and 3719 deletions

View File

@@ -1508,7 +1508,7 @@ impl Call for Client {
where F: FnMut(U256) -> Result<bool, E>
{
while upper - lower > 1.into() {
let mid = (lower + upper) / 2.into();
let mid = (lower + upper) / 2;
trace!(target: "estimate_gas", "{} .. {} .. {}", lower, mid, upper);
let c = cond(mid)?;
match c {
@@ -2510,7 +2510,7 @@ mod tests {
block_hash: block_hash,
block_number: block_number,
cumulative_gas_used: gas_used,
gas_used: gas_used - 5.into(),
gas_used: gas_used - 5,
contract_address: None,
logs: vec![LocalizedLogEntry {
entry: logs[0].clone(),

View File

@@ -1919,7 +1919,7 @@ mod tests {
let b2 = b2.close_and_lock().unwrap();
// the spec sets the block reward to 10
assert_eq!(b2.block().state().balance(&addr1).unwrap(), addr1_balance + (10 * 2).into())
assert_eq!(b2.block().state().balance(&addr1).unwrap(), addr1_balance + (10 * 2))
}
#[test]
@@ -2067,7 +2067,7 @@ mod tests {
// the contract rewards (1000 + kind) for each benefactor/reward kind
assert_eq!(
b2.block().state().balance(&addr1).unwrap(),
addr1_balance + (1000 + 0).into() + (1000 + 2).into(),
addr1_balance + (1000 + 0) + (1000 + 2),
)
}
}

View File

@@ -454,8 +454,8 @@ impl Engine<EthereumMachine> for Tendermint {
fn populate_from_parent(&self, header: &mut Header, parent: &Header) {
// Chain scoring: total weight is sqrt(U256::max_value())*height - view
let new_difficulty = U256::from(U128::max_value())
+ consensus_view(parent).expect("Header has been verified; qed").into()
- self.view.load(AtomicOrdering::SeqCst).into();
+ consensus_view(parent).expect("Header has been verified; qed")
- self.view.load(AtomicOrdering::SeqCst);
header.set_difficulty(new_difficulty);
}

View File

@@ -233,8 +233,8 @@ impl EthereumMachine {
if let Some(ref ethash_params) = self.ethash_extensions {
let gas_limit = {
let bound_divisor = self.params().gas_limit_bound_divisor;
let lower_limit = gas_limit - gas_limit / bound_divisor + 1.into();
let upper_limit = gas_limit + gas_limit / bound_divisor - 1.into();
let lower_limit = gas_limit - gas_limit / bound_divisor + 1;
let upper_limit = gas_limit + gas_limit / bound_divisor - 1;
let gas_limit = if gas_limit < gas_floor_target {
let gas_limit = cmp::min(gas_floor_target, upper_limit);
round_block_gas_limit(gas_limit, lower_limit, upper_limit)
@@ -245,7 +245,7 @@ impl EthereumMachine {
let total_lower_limit = cmp::max(lower_limit, gas_floor_target);
let total_upper_limit = cmp::min(upper_limit, gas_ceil_target);
let gas_limit = cmp::max(gas_floor_target, cmp::min(total_upper_limit,
lower_limit + (header.gas_used().clone() * 6u32 / 5.into()) / bound_divisor));
lower_limit + (header.gas_used().clone() * 6u32 / 5) / bound_divisor));
round_block_gas_limit(gas_limit, total_lower_limit, total_upper_limit)
};
// ensure that we are not violating protocol limits
@@ -265,9 +265,9 @@ impl EthereumMachine {
header.set_gas_limit({
let bound_divisor = self.params().gas_limit_bound_divisor;
if gas_limit < gas_floor_target {
cmp::min(gas_floor_target, gas_limit + gas_limit / bound_divisor - 1.into())
cmp::min(gas_floor_target, gas_limit + gas_limit / bound_divisor - 1)
} else {
cmp::max(gas_floor_target, gas_limit - gas_limit / bound_divisor + 1.into())
cmp::max(gas_floor_target, gas_limit - gas_limit / bound_divisor + 1)
}
});
}

View File

@@ -852,11 +852,11 @@ impl miner::MinerService for Miner {
fn sensible_gas_price(&self) -> U256 {
// 10% above our minimum.
self.transaction_queue.current_worst_gas_price() * 110u32 / 100.into()
self.transaction_queue.current_worst_gas_price() * 110u32 / 100
}
fn sensible_gas_limit(&self) -> U256 {
self.params.read().gas_range_target.0 / 5.into()
self.params.read().gas_range_target.0 / 5
}
fn import_external_transactions<C: miner::BlockChainClient>(

View File

@@ -131,7 +131,7 @@ fn make_chain(accounts: Arc<AccountProvider>, blocks_beyond: usize, transitions:
data: Vec::new(),
}.sign(&*RICH_SECRET, client.signing_chain_id());
*nonce = *nonce + 1.into();
*nonce = *nonce + 1;
vec![transaction]
};
@@ -174,7 +174,7 @@ fn make_chain(accounts: Arc<AccountProvider>, blocks_beyond: usize, transitions:
data,
}.sign(&*RICH_SECRET, client.signing_chain_id());
*nonce = *nonce + 1.into();
*nonce = *nonce + 1;
vec![transaction]
} else {
make_useless_transactions()

View File

@@ -672,7 +672,7 @@ mod tests {
header.set_uncles_hash(good_uncles_hash.clone());
check_ok(basic_test(&create_test_block_with_data(&header, &good_transactions, &good_uncles), engine));
header.set_gas_limit(min_gas_limit - From::from(1));
header.set_gas_limit(min_gas_limit - 1);
check_fail(basic_test(&create_test_block(&header), engine),
InvalidGasLimit(OutOfBounds { min: Some(min_gas_limit), max: None, found: header.gas_limit().clone() }));
@@ -682,7 +682,7 @@ mod tests {
RidiculousNumber(OutOfBounds { max: Some(BlockNumber::max_value()), min: None, found: header.number() }));
header = good.clone();
let gas_used = header.gas_limit().clone() + 1.into();
let gas_used = header.gas_limit().clone() + 1;
header.set_gas_used(gas_used);
check_fail(basic_test(&create_test_block(&header), engine),
TooMuchGasUsed(OutOfBounds { max: Some(header.gas_limit().clone()), min: None, found: header.gas_used().clone() }));