Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' into dp/chore/add-bench-for-to_fat_rlps
Browse files Browse the repository at this point in the history
* master: (21 commits)
  ropsten #6631425 foundation #8798209 (#11201)
  Update list of bootnodes for xDai chain (#11236)
  ethcore/res: add mordor testnet configuration (#11200)
  [chain specs]: activate `Istanbul` on mainnet (#11228)
  [builtin]: support `multiple prices and activations` in chain spec (#11039)
  Insert explicit warning into the panic hook (#11225)
  Snapshot restoration overhaul (#11219)
  Fix docker centos build (#11226)
  retry on gitlab system failures (#11222)
  Update bootnodes. (#11203)
  Use provided usd-per-eth value if an endpoint is specified (#11209)
  Use a lock instead of atomics for snapshot Progress (#11197)
  [informant]: `MillisecondDuration` -> `as_millis()` (#11211)
  Step duration map configuration parameter ported from the POA Network fork (#10902)
  Upgrade jsonrpc to latest (#11206)
  [export hardcoded sync]: use debug for `H256` (#11204)
  Pause pruning while snapshotting (#11178)
  Type annotation for next_key() matching of json filter options (#11192)
  Crypto primitives removed from ethkey (#11174)
  Made ecrecover implementation trait public (#11188)
  ...
  • Loading branch information
dvdplm committed Nov 6, 2019
2 parents 1dad95c + 8adde60 commit 89cdb3b
Show file tree
Hide file tree
Showing 268 changed files with 4,550 additions and 4,073 deletions.
6 changes: 6 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ variables:
before_script:
- rustup show
- cargo --version
retry:
max: 2
when:
- runner_system_failure
- unknown_failure
- api_failure
tags:
- linux-docker

Expand Down
485 changes: 266 additions & 219 deletions Cargo.lock

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ethstore = { path = "accounts/ethstore" }
fdlimit = "0.1"
futures = "0.1"
journaldb = { path = "util/journaldb" }
jsonrpc-core = "14.0.1"
jsonrpc-core = "14.0.3"
keccak-hash = "0.4.0"
kvdb = "0.1"
kvdb-rocksdb = "0.1.5"
Expand All @@ -48,6 +48,7 @@ num_cpus = "1.2"
number_prefix = "0.2"
panic_hook = { path = "util/panic-hook" }
parity-bytes = "0.1"
parity-crypto = { version = "0.4.2", features = ["publickey"] }
parity-daemonize = "0.3"
parity-hash-fetch = { path = "updater/hash-fetch" }
parity-ipfs-api = { path = "ipfs" }
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ To start Parity Ethereum as a regular user using `systemd` init:

## 4. Testing <a id="chapter-004"></a>

You can run tests with the following commands:
Download the required test files: `git submodule update --init --recursive`. You can run tests with the following commands:

* **All** packages
```
Expand Down
1 change: 1 addition & 0 deletions accounts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ edition = "2018"
ethkey = { path = "ethkey" }
ethstore = { path = "ethstore" }
log = "0.4"
parity-crypto = { version = "0.4.2", features = ["publickey"] }
parking_lot = "0.9"
serde = "1.0"
serde_derive = "1.0"
Expand Down
14 changes: 3 additions & 11 deletions accounts/ethkey/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
[package]
description = "Parity Ethereum Keys Generator"
name = "ethkey"
version = "0.3.0"
version = "0.4.0"
authors = ["Parity Technologies <[email protected]>"]

[dependencies]
edit-distance = "2.0"
parity-crypto = "0.4.0"
eth-secp256k1 = { git = "https://github.com/paritytech/rust-secp256k1" }
ethereum-types = "0.8.0"
lazy_static = "1.0"
log = "0.4"
parity-wordlist = "1.3"
quick-error = "1.2.2"
rand = "0.7"
rustc-hex = "1.0"
serde = "1.0"
serde_derive = "1.0"
tiny-keccak = "1.4"
zeroize = "0.9.1"
parity-crypto = { version = "0.4.2", features = ["publickey"] }
parity-wordlist = "1.3"
1 change: 1 addition & 0 deletions accounts/ethkey/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ docopt = "1.0"
env_logger = "0.5"
ethkey = { path = "../" }
panic_hook = { path = "../../../util/panic-hook" }
parity-crypto = { version = "0.4.2", features = ["publickey"] }
parity-wordlist="1.2"
rustc-hex = "1.0"
serde = "1.0"
Expand Down
10 changes: 6 additions & 4 deletions accounts/ethkey/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ extern crate env_logger;
extern crate ethkey;
extern crate panic_hook;
extern crate parity_wordlist;
extern crate parity_crypto;
extern crate rustc_hex;
extern crate serde;
extern crate threadpool;
Expand All @@ -30,7 +31,8 @@ use std::num::ParseIntError;
use std::{env, fmt, process, io, sync};

use docopt::Docopt;
use ethkey::{KeyPair, Random, Brain, BrainPrefix, Prefix, Error as EthkeyError, Generator, sign, verify_public, verify_address, brain_recover};
use ethkey::{Brain, BrainPrefix, Prefix, brain_recover};
use parity_crypto::publickey::{KeyPair, Random, Error as EthkeyError, Generator, sign, verify_public, verify_address};
use rustc_hex::{FromHex, FromHexError};

const USAGE: &'static str = r#"
Expand Down Expand Up @@ -200,7 +202,7 @@ fn execute<S, I>(command: I) -> Result<String, Error> where I: IntoIterator<Item
let keypair = Brain::new(phrase).generate().expect("Brain wallet generator is infallible; qed");
(keypair, Some(phrase_info))
} else {
let secret = args.arg_secret_or_phrase.parse().map_err(|_| EthkeyError::InvalidSecret)?;
let secret = args.arg_secret_or_phrase.parse().map_err(|_| EthkeyError::InvalidSecretKey)?;
(KeyPair::from_secret(secret)?, None)
};
Ok(display(result, display_mode))
Expand Down Expand Up @@ -241,15 +243,15 @@ fn execute<S, I>(command: I) -> Result<String, Error> where I: IntoIterator<Item
};
Ok(display(result, display_mode))
} else if args.cmd_sign {
let secret = args.arg_secret.parse().map_err(|_| EthkeyError::InvalidSecret)?;
let secret = args.arg_secret.parse().map_err(|_| EthkeyError::InvalidSecretKey)?;
let message = args.arg_message.parse().map_err(|_| EthkeyError::InvalidMessage)?;
let signature = sign(&secret, &message)?;
Ok(format!("{}", signature))
} else if args.cmd_verify {
let signature = args.arg_signature.parse().map_err(|_| EthkeyError::InvalidSignature)?;
let message = args.arg_message.parse().map_err(|_| EthkeyError::InvalidMessage)?;
let ok = if args.cmd_public {
let public = args.arg_public.parse().map_err(|_| EthkeyError::InvalidPublic)?;
let public = args.arg_public.parse().map_err(|_| EthkeyError::InvalidPublicKey)?;
verify_public(&public, &signature, &message)?
} else if args.cmd_address {
let address = args.arg_address.parse().map_err(|_| EthkeyError::InvalidAddress)?;
Expand Down
12 changes: 7 additions & 5 deletions accounts/ethkey/src/brain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
// You should have received a copy of the GNU General Public License
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.

use keccak::Keccak256;
use super::{KeyPair, Generator, Secret};
use std::convert::Infallible;
use parity_crypto::publickey::{KeyPair, Generator, Secret};
use parity_crypto::Keccak256;
use parity_wordlist;

/// Simple brainwallet.
Expand All @@ -32,7 +33,7 @@ impl Brain {
}

impl Generator for Brain {
type Error = ::Void;
type Error = Infallible;

fn generate(&mut self) -> Result<KeyPair, Self::Error> {
let seed = self.0.clone();
Expand All @@ -45,7 +46,7 @@ impl Generator for Brain {
match i > 16384 {
false => i += 1,
true => {
if let Ok(pair) = Secret::from_unsafe_slice(&secret)
if let Ok(pair) = Secret::import_key(&secret)
.and_then(KeyPair::from_secret)
{
if pair.address()[0] == 0 {
Expand All @@ -61,7 +62,8 @@ impl Generator for Brain {

#[cfg(test)]
mod tests {
use {Brain, Generator};
use Brain;
use parity_crypto::publickey::Generator;

#[test]
fn test_brain() {
Expand Down
6 changes: 4 additions & 2 deletions accounts/ethkey/src/brain_prefix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
// You should have received a copy of the GNU General Public License
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.

use super::{Generator, KeyPair, Error, Brain};
use super::Brain;
use parity_crypto::publickey::{Generator, KeyPair, Error};
use parity_wordlist as wordlist;

/// Tries to find brain-seed keypair with address starting with given prefix.
Expand Down Expand Up @@ -59,7 +60,8 @@ impl Generator for BrainPrefix {

#[cfg(test)]
mod tests {
use {Generator, BrainPrefix};
use BrainPrefix;
use parity_crypto::publickey::Generator;

#[test]
fn prefix_generator() {
Expand Down
3 changes: 2 additions & 1 deletion accounts/ethkey/src/brain_recover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ use std::collections::HashSet;
use edit_distance::edit_distance;
use parity_wordlist;

use super::{Address, Brain, Generator};
use super::Brain;
use parity_crypto::publickey::{Address, Generator};

/// Tries to find a phrase for address, given the number
/// of expected words and a partial phrase.
Expand Down
189 changes: 0 additions & 189 deletions accounts/ethkey/src/crypto.rs

This file was deleted.

Loading

0 comments on commit 89cdb3b

Please sign in to comment.