Crypto primitives removed from ethkey (#11174)
* Crypto utils removed from ethkey * Fix ethkey lib * Switch ethsore to new crypto * Accounts crate fixed * Secret store crate switched to new crypto * Ethcore builtin fixed * Accounts crate fixed * Ethcore crate fixed * Util network fixed * Util network-devp2p fixed * Private tx fixed * Ethcore sync fixed * Secret store fixed * Rpc fixed * Parity fixed * Ethkey cli fixed * Local store fixed * Ethcore blockchain fixed * Cargo.lock pushed; doc comment added for reversed nonce * Ethstore tests fixed * Ethstore cli fixed * Miner fixed * Snapshot tests are fixed * Single brackets removed * Machine fixed * Verification fixed * Executive state fixed * More single brackets removed * Update version of parity-crypto * Use published version 0.4.2 of parity-crypto * New test in tx_filter fixed
This commit is contained in:
@@ -166,7 +166,7 @@ mod accounts {
|
||||
|
||||
mod private_tx {
|
||||
use super::*;
|
||||
use ethkey::{Signature, Message};
|
||||
use parity_crypto::publickey::{Signature, Message};
|
||||
use ethcore_private_tx::{Error};
|
||||
|
||||
pub struct AccountSigner {
|
||||
@@ -211,8 +211,8 @@ mod accounts {
|
||||
}
|
||||
|
||||
fn insert_dev_account(account_provider: &AccountProvider) {
|
||||
let secret: ethkey::Secret = "4d5db4107d237df6a3d58ee5f70ae63d73d7658d4026f2eefd2f204c81682cb7".into();
|
||||
let dev_account = ethkey::KeyPair::from_secret(secret.clone()).expect("Valid secret produces valid key;qed");
|
||||
let secret = parity_crypto::publickey::Secret::from_str("4d5db4107d237df6a3d58ee5f70ae63d73d7658d4026f2eefd2f204c81682cb7".into()).expect("Valid account;qed");
|
||||
let dev_account = parity_crypto::publickey::KeyPair::from_secret(secret.clone()).expect("Valid secret produces valid key;qed");
|
||||
if !account_provider.has_account(dev_account.address()) {
|
||||
match account_provider.insert_account(secret, &Password::from(String::new())) {
|
||||
Err(e) => warn!("Unable to add development account: {}", e),
|
||||
|
||||
@@ -28,7 +28,7 @@ use parity_version::{version_data, version};
|
||||
use bytes::Bytes;
|
||||
use ansi_term::Colour;
|
||||
use sync::{NetworkConfiguration, validate_node_url, self};
|
||||
use ethkey::{Secret, Public};
|
||||
use parity_crypto::publickey::{Secret, Public};
|
||||
use ethcore::client::VMType;
|
||||
use ethcore::miner::{stratum, MinerOptions};
|
||||
use snapshot::SnapshotConfiguration;
|
||||
@@ -749,7 +749,7 @@ impl Configuration {
|
||||
ret.listen_address = Some(format!("{}", listen));
|
||||
ret.public_address = public.map(|p| format!("{}", p));
|
||||
ret.use_secret = match self.args.arg_node_key.as_ref()
|
||||
.map(|s| s.parse::<Secret>().or_else(|_| Secret::from_unsafe_slice(keccak(s).as_bytes())).map_err(|e| format!("Invalid key: {:?}", e))
|
||||
.map(|s| s.parse::<Secret>().or_else(|_| Secret::import_key(keccak(s).as_bytes())).map_err(|e| format!("Invalid key: {:?}", e))
|
||||
) {
|
||||
None => None,
|
||||
Some(Ok(key)) => Some(key),
|
||||
|
||||
@@ -63,6 +63,7 @@ extern crate keccak_hash as hash;
|
||||
extern crate kvdb;
|
||||
extern crate node_filter;
|
||||
extern crate parity_bytes as bytes;
|
||||
extern crate parity_crypto;
|
||||
extern crate parity_hash_fetch as hash_fetch;
|
||||
extern crate parity_ipfs_api;
|
||||
extern crate parity_local_store as local_store;
|
||||
|
||||
@@ -43,7 +43,7 @@ pub fn execute(cmd: ImportWallet) -> Result<String, String> {
|
||||
}
|
||||
|
||||
#[cfg(feature = "accounts")]
|
||||
pub fn import_account(cmd: &ImportWallet, kp: ethkey::KeyPair, password: Password) {
|
||||
pub fn import_account(cmd: &ImportWallet, kp: parity_crypto::publickey::KeyPair, password: Password) {
|
||||
use accounts::{AccountProvider, AccountProviderSettings};
|
||||
use ethstore::EthStore;
|
||||
use ethstore::accounts_dir::RootDiskDirectory;
|
||||
@@ -55,4 +55,4 @@ pub fn import_account(cmd: &ImportWallet, kp: ethkey::KeyPair, password: Passwor
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "accounts"))]
|
||||
pub fn import_account(_cmd: &ImportWallet, _kp: ethkey::KeyPair, _password: Password) {}
|
||||
pub fn import_account(_cmd: &ImportWallet, _kp: parity_crypto::publickey::KeyPair, _password: Password) {}
|
||||
|
||||
@@ -21,7 +21,8 @@ use dir::default_data_path;
|
||||
use dir::helpers::replace_home;
|
||||
use ethcore::client::Client;
|
||||
use ethcore::miner::Miner;
|
||||
use ethkey::{Secret, Public, Password};
|
||||
use ethkey::Password;
|
||||
use parity_crypto::publickey::{Secret, Public};
|
||||
use sync::SyncProvider;
|
||||
use ethereum_types::Address;
|
||||
use parity_runtime::Executor;
|
||||
@@ -121,7 +122,7 @@ mod server {
|
||||
mod server {
|
||||
use std::sync::Arc;
|
||||
use ethcore_secretstore;
|
||||
use ethkey::KeyPair;
|
||||
use parity_crypto::publickey::KeyPair;
|
||||
use ansi_term::Colour::{Red, White};
|
||||
use db;
|
||||
use super::{Configuration, Dependencies, NodeSecretKey, ContractAddress, Executor};
|
||||
|
||||
Reference in New Issue
Block a user