Upgrade ethereum types (#10670)
* cargo upgrade "ethereum-types" --all --allow-prerelease * [ethash] fix compilation errors * [ethkey] fix compilation errors * [journaldb] fix compilation errors * [dir] fix compilation errors * [ethabi] update to 0.7 * wip * [eip-712] fix compilation errors * [ethjson] fix compilation errors * [Cargo.toml] add TODO to remove patches * [ethstore] fix compilation errors * use patched keccak-hash with new primitive-types * wip * [ethcore-network-devp2p] fix compilation errors * [vm] fix compilation errors * [common-types, evm, wasm] fix compilation errors * [ethcore-db] Require AsRef instead of Deref for keys * [ethcore-blockchain] fix some compilation errors * [blooms-db] fix compilation errors Thanks a lot @dvdplm :) * we don't need no rlp ethereum feature * [ethcore] fix some compilation errors * [parity-ipfs-api] fix compilation error * [ethcore-light] fix compilation errors * [Cargo.lock] update parity-common * [ethcore-private-tx] fix some compilation errors * wip * [ethcore-private-tx] fix compilation errors * [parity-updater] fix compilation errors * [parity-rpc] fix compilation errors * [parity-bin] fix other compilation errors * update to new ethereum-types * update keccak-hash * [fastmap] fix compilation in tests * [blooms-db] fix compilation in tests * [common-types] fix compilation in tests * [triehash-ethereum] fix compilation in tests * [ethkey] fix compilation in tests * [pwasm-run-test] fix compilation errors * [wasm] fix compilation errors * [ethjson] fix compilation in tests * [eip-712] fix compilation in tests * [ethcore-blockchain] fix compilation in tests * [ethstore] fix compilation in tests * [ethstore-accounts] fix compilation in tests * [parity-hash-fetch] fix compilation in tests * [parity-whisper] fix compilation in tests * [ethcore-miner] fix compilation in tests * [ethcore-network-devp2p] fix compilation in tests * [*] upgrade rand to 0.6 * [evm] get rid of num-bigint conversions * [ethcore] downgrade trie-standardmap and criterion * [ethcore] fix some warnings * [ethcore] fix compilation in tests * [evmbin] fix compilation in tests * [updater] fix compilation in tests * [ethash] fix compilation in tests * [ethcore-secretstore] fix compilation in tests * [ethcore-sync] fix compilation in tests * [parity-rpc] fix compilation in tests * [ethcore] finally fix compilation in tests FUCK YEAH!!! * [ethstore] lazy_static is unused * [ethcore] fix test * fix up bad merge * [Cargo.toml] remove unused patches * [*] replace some git dependencies with crates.io * [Cargo.toml] remove unused lazy_static * [*] clean up * [ethcore] fix transaction_filter_deprecated test * [private-tx] fix serialization tests * fix more serialization tests * [ethkey] fix smoky test * [rpc] fix tests, please? * [ethcore] remove commented out code * Apply suggestions from code review Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com> * [ethstore] remove unused dev-dependency * [ethcore] remove resolved TODO * [*] resolve keccak-hash TODO * [*] s/Address::default()/Address::zero() * [rpc] remove Subscribers::new_test * [rpc] remove EthPubSubClient::new_test * [ethcore] use trie-standardmap from crates.io * [dir] fix db_root_path * [ethcore] simplify snapshot::tests::helpers::fill_storage * Apply suggestions from code review Co-Authored-By: David <dvdplm@gmail.com> * [ethcore-secretstore] resolve TODO in serialization * [ethcore-network-devp2p] resolve TODO in save_key * [Cargo.lock] update triehash * [*] use ethabi from crates.io * [ethkey] use secp256k1 from master branch * [Cargo.lock] update eth-secp256k1
This commit is contained in:
@@ -251,7 +251,7 @@ fn can_mine() {
|
||||
let dummy_blocks = get_good_dummy_block_seq(2);
|
||||
let client = get_test_client_with_blocks(vec![dummy_blocks[0].clone()]);
|
||||
|
||||
let b = client.prepare_open_block(Address::default(), (3141562.into(), 31415620.into()), vec![]).unwrap().close().unwrap();
|
||||
let b = client.prepare_open_block(Address::zero(), (3141562.into(), 31415620.into()), vec![]).unwrap().close().unwrap();
|
||||
|
||||
assert_eq!(*b.header.parent_hash(), view!(BlockView, &dummy_blocks[0]).header_view().hash());
|
||||
}
|
||||
@@ -274,7 +274,7 @@ fn change_history_size() {
|
||||
).unwrap();
|
||||
|
||||
for _ in 0..20 {
|
||||
let mut b = client.prepare_open_block(Address::default(), (3141562.into(), 31415620.into()), vec![]).unwrap();
|
||||
let mut b = client.prepare_open_block(Address::zero(), (3141562.into(), 31415620.into()), vec![]).unwrap();
|
||||
b.block_mut().state_mut().add_balance(&address, &5.into(), CleanupMode::NoEmpty).unwrap();
|
||||
b.block_mut().state_mut().commit().unwrap();
|
||||
let b = b.close_and_lock().unwrap().seal(&*test_spec.engine, vec![]).unwrap();
|
||||
@@ -301,7 +301,7 @@ fn does_not_propagate_delayed_transactions() {
|
||||
nonce: 0.into(),
|
||||
gas_price: 0.into(),
|
||||
gas: 21000.into(),
|
||||
action: Action::Call(Address::default()),
|
||||
action: Action::Call(Address::zero()),
|
||||
value: 0.into(),
|
||||
data: Vec::new(),
|
||||
}.sign(secret, None), Some(Condition::Number(2)));
|
||||
@@ -309,7 +309,7 @@ fn does_not_propagate_delayed_transactions() {
|
||||
nonce: 1.into(),
|
||||
gas_price: 0.into(),
|
||||
gas: 21000.into(),
|
||||
action: Action::Call(Address::default()),
|
||||
action: Action::Call(Address::zero()),
|
||||
value: 0.into(),
|
||||
data: Vec::new(),
|
||||
}.sign(secret, None), None);
|
||||
@@ -333,7 +333,7 @@ fn transaction_proof() {
|
||||
let address = Address::random();
|
||||
let test_spec = Spec::new_test();
|
||||
for _ in 0..20 {
|
||||
let mut b = client.prepare_open_block(Address::default(), (3141562.into(), 31415620.into()), vec![]).unwrap();
|
||||
let mut b = client.prepare_open_block(Address::zero(), (3141562.into(), 31415620.into()), vec![]).unwrap();
|
||||
b.block_mut().state_mut().add_balance(&address, &5.into(), CleanupMode::NoEmpty).unwrap();
|
||||
b.block_mut().state_mut().commit().unwrap();
|
||||
let b = b.close_and_lock().unwrap().seal(&*test_spec.engine, vec![]).unwrap();
|
||||
@@ -344,7 +344,7 @@ fn transaction_proof() {
|
||||
nonce: 0.into(),
|
||||
gas_price: 0.into(),
|
||||
gas: 21000.into(),
|
||||
action: Action::Call(Address::default()),
|
||||
action: Action::Call(Address::zero()),
|
||||
value: 5.into(),
|
||||
data: Vec::new(),
|
||||
}.fake_sign(address);
|
||||
@@ -363,7 +363,7 @@ fn transaction_proof() {
|
||||
Executive::new(&mut state, &env_info, &machine, &schedule)
|
||||
.transact(&transaction, TransactOptions::with_no_tracing().dont_check_nonce()).unwrap();
|
||||
|
||||
assert_eq!(state.balance(&Address::default()).unwrap(), 5.into());
|
||||
assert_eq!(state.balance(&Address::zero()).unwrap(), 5.into());
|
||||
assert_eq!(state.balance(&address).unwrap(), 95.into());
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ fn test_blockhash_eip210(factory: Factory) {
|
||||
|
||||
// populate state with 256 last hashes
|
||||
let mut state = get_temp_state_with_factory(factory);
|
||||
let contract_address: Address = 0xf0.into();
|
||||
let contract_address = Address::from_low_u64_be(0xf0);
|
||||
state.init_code(&contract_address, (*blockhash_contract_code).clone()).unwrap();
|
||||
for i in 1 .. 257 {
|
||||
env_info.number = i.into();
|
||||
@@ -57,7 +57,7 @@ fn test_blockhash_eip210(factory: Factory) {
|
||||
value: ActionValue::Transfer(0.into()),
|
||||
code: Some(blockhash_contract_code.clone()),
|
||||
code_hash: Some(blockhash_contract_code_hash),
|
||||
data: Some(H256::from(i - 1).to_vec()),
|
||||
data: Some(H256::from_low_u64_be(i - 1).as_bytes().to_vec()),
|
||||
call_type: CallType::Call,
|
||||
params_type: ParamsType::Separate,
|
||||
};
|
||||
@@ -71,10 +71,10 @@ fn test_blockhash_eip210(factory: Factory) {
|
||||
|
||||
env_info.number = 256;
|
||||
let params = ActionParams {
|
||||
code_address: Address::new(),
|
||||
address: Address::new(),
|
||||
sender: Address::new(),
|
||||
origin: Address::new(),
|
||||
code_address: Address::zero(),
|
||||
address: Address::zero(),
|
||||
sender: Address::zero(),
|
||||
origin: Address::zero(),
|
||||
gas: 100000.into(),
|
||||
gas_price: 0.into(),
|
||||
value: ActionValue::Transfer(0.into()),
|
||||
@@ -89,10 +89,10 @@ fn test_blockhash_eip210(factory: Factory) {
|
||||
let mut substate = Substate::new();
|
||||
let res = ex.call(params, &mut substate, &mut NoopTracer, &mut NoopVMTracer);
|
||||
let output = match res {
|
||||
Ok(res) => H256::from(&res.return_data[..32]),
|
||||
Ok(res) => H256::from_slice(&res.return_data[..32]),
|
||||
Err(e) => {
|
||||
panic!("Encountered error on getting last hash: {}", e);
|
||||
},
|
||||
};
|
||||
assert_eq!(output, 255.into());
|
||||
assert_eq!(output, H256::from_low_u64_be(255));
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ use client::*;
|
||||
use test_helpers::get_temp_state_db;
|
||||
use client::{BlockChainClient, Client, ClientConfig};
|
||||
use std::sync::Arc;
|
||||
use std::str::FromStr;
|
||||
use miner::Miner;
|
||||
use types::transaction::{Action, Transaction};
|
||||
use trace::{RewardType, LocalizedTrace};
|
||||
@@ -71,7 +72,7 @@ fn can_trace_block_and_uncle_reward() {
|
||||
let mut last_header = genesis_header.clone();
|
||||
last_hashes.push(last_header.hash());
|
||||
|
||||
let kp = KeyPair::from_secret_slice(&keccak("")).unwrap();
|
||||
let kp = KeyPair::from_secret_slice(keccak("").as_bytes()).unwrap();
|
||||
let author = kp.address();
|
||||
|
||||
// Add root block first
|
||||
@@ -162,7 +163,7 @@ fn can_trace_block_and_uncle_reward() {
|
||||
}
|
||||
|
||||
let mut uncle = Header::new();
|
||||
let uncle_author: Address = "ef2d6d194084c2de36e0dabfce45d046b37d1106".into();
|
||||
let uncle_author = Address::from_str("ef2d6d194084c2de36e0dabfce45d046b37d1106").unwrap();
|
||||
uncle.set_author(uncle_author);
|
||||
uncle.set_parent_hash(root_header.hash());
|
||||
uncle.set_gas_limit(genesis_gas);
|
||||
|
||||
Reference in New Issue
Block a user