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 ng-fix-fork-choice
Browse files Browse the repository at this point in the history
* master:
  refactor: whisper: Add type aliases and update rustdocs in message.rs (#10812)
  Break circular dependency between Client and Engine (part 1) (#10833)
  tests: Relates to #10655: Test instructions for Readme (#10835)
  refactor: Related #9459 - evmbin: replace untyped json! macro with fully typed serde serialization using Rust structs (#10657)
  idiomatic changes to PodState (#10834)
  Allow --nat extip:your.host.here.org (#10830)
  When updating the client or when called from RPC, sleep should mean sleep (#10814)
  Remove excessive warning (#10831)
  Fix typo in README.md (#10828)
  ethcore does not use byteorder (#10829)
  Better logging when backfilling ancient blocks fail (#10796)
  depends: Update wordlist to v1.3 (#10823)
  cargo update -p smallvec (#10822)
  replace memzero with zeroize crate (#10816)
  Don't repeat the logic from Default impl (#10813)
  removed additional_params method (#10818)
  Add Constantinople eips to the dev (instant_seal) config (#10809)
  • Loading branch information
dvdplm committed Jul 4, 2019
2 parents da8c213 + bacc0f0 commit 26f80c2
Show file tree
Hide file tree
Showing 60 changed files with 722 additions and 505 deletions.
61 changes: 39 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 36 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
3.2 [Building from Source Code](#chapter-0032)<br>
3.3 [Simple One-Line Installer for Mac and Linux](#chapter-0033)<br>
3.4 [Starting Parity Ethereum](#chapter-0034)
4. [Documentation](#chapter-004)
5. [Toolchain](#chapter-005)
6. [Community](#chapter-006)
7. [Contributing](#chapter-007)
8. [License](#chapter-008)
4. [Testing](#chapter-004)
5. [Documentation](#chapter-005)
6. [Toolchain](#chapter-006)
7. [Community](#chapter-007)
8. [Contributing](#chapter-008)
9. [License](#chapter-009)


## 1. Description <a id="chapter-001"></a>
Expand Down Expand Up @@ -65,7 +66,7 @@ We recommend installing Rust through [rustup](https://www.rustup.rs/). If you do

`clang` is required. It comes with Xcode command line tools or can be installed with homebrew.

- Windows
- Windows:
Make sure you have Visual Studio 2015 with C++ support installed. Next, download and run the `rustup` installer from
https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe, start "VS2015 x64 Native Tools Command Prompt", and use the following command to install and set up the `msvc` toolchain:
```bash
Expand Down Expand Up @@ -148,7 +149,25 @@ To start Parity Ethereum as a regular user using `systemd` init:
2. Copy release to bin folder, write `sudo install ./target/release/parity /usr/bin/parity`
3. To configure Parity Ethereum, write a `/etc/parity/config.toml` config file, see [Configuring Parity Ethereum](https://paritytech.github.io/wiki/Configuring-Parity) for details.
## 4. Documentation <a id="chapter-004"></a>
## 4. Testing <a id="chapter-004"></a>
You can run tests with the following commands:
* **All** packages
```
cargo test --all
```
* Specific package
```
cargo test --package <spec>
```
Replace `<spec>` with one of the packages from the [package list](#package-list) (e.g. `cargo test --package evmbin`).
You can show your logs in the test output by passing `--nocapture` (i.e. `cargo test --package evmbin -- --nocapture`)
## 5. Documentation <a id="chapter-005"></a>
Official website: https://parity.io
Expand All @@ -160,16 +179,20 @@ You can generate documentation for Parity Ethereum Rust packages that automatica
* **All** packages
```
cargo doc --open
cargo doc --document-private-items --open
```
* Specific package
```
cargo doc --package <spec> --open
cargo doc --package <spec> -- --document-private-items --open
```
Use`--document-private-items` to also view private documentation and `--no-deps` to exclude building documentation for dependencies.
Replacing `<spec>` with one of the following from the details section below (i.e. `cargo doc --package parity-ethereum --open`):
<a id="package-list"></a>
**Package List**
<details><p>
* Parity Ethereum (EthCore) Client Application
Expand Down Expand Up @@ -330,7 +353,7 @@ Example (generic documentation comment):
///
```
## 5. Toolchain <a id="chapter-005"></a>
## 6. Toolchain <a id="chapter-006"></a>
In addition to the Parity Ethereum client, there are additional tools in this repository available:
Expand All @@ -342,7 +365,7 @@ In addition to the Parity Ethereum client, there are additional tools in this re
The following tool is available in a separate repository:
- [ethabi](https://github.com/paritytech/ethabi) - Parity Ethereum Encoding of Function Calls. [Docs here](https://crates.io/crates/ethabi)
## 6. Community <a id="chapter-006"></a>
## 7. Community <a id="chapter-007"></a>
### Join the chat!
Expand All @@ -355,14 +378,14 @@ Questions? Get in touch with us on Gitter:
Alternatively, join our community on Matrix:
[![Riot: +Parity](https://img.shields.io/badge/riot-%2Bparity%3Amatrix.parity.io-orange.svg)](https://riot.im/app/#/group/+parity:matrix.parity.io)
## 7. Contributing <a id="chapter-007"></a>
## 8. Contributing <a id="chapter-008"></a>
An introduction has been provided in the ["So You Want to be a Core Developer" presentation slides by Hernando Castano](http://tiny.cc/contrib-to-parity-eth). Additional guidelines are provided in [CONTRIBUTING](./.github/CONTRIBUTING.md).
### Contributor Code of Conduct
[CODE_OF_CONDUCT](./.github/CODE_OF_CONDUCT.md)
## 8. License <a id="chapter-008"></a>
## 9. License <a id="chapter-009"></a>
[LICENSE](./LICENSE)
4 changes: 2 additions & 2 deletions accounts/ethkey/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ eth-secp256k1 = { git = "https://github.com/paritytech/rust-secp256k1" }
ethereum-types = "0.6.0"
lazy_static = "1.0"
log = "0.4"
parity-util-mem = "0.1"
parity-wordlist = "1.2"
parity-wordlist = "1.3"
quick-error = "1.2.2"
rand = "0.6"
rustc-hex = "1.0"
serde = "1.0"
serde_derive = "1.0"
tiny-keccak = "1.4"
zeroize = "0.9.1"
2 changes: 1 addition & 1 deletion accounts/ethkey/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
extern crate edit_distance;
extern crate parity_crypto;
extern crate ethereum_types;
extern crate parity_util_mem;
extern crate parity_wordlist;
#[macro_use]
extern crate quick_error;
Expand All @@ -28,6 +27,7 @@ extern crate rustc_hex;
extern crate secp256k1;
extern crate serde;
extern crate tiny_keccak;
extern crate zeroize;

#[macro_use]
extern crate lazy_static;
Expand Down
18 changes: 12 additions & 6 deletions accounts/ethkey/src/secret.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,23 @@ use rustc_hex::ToHex;
use secp256k1::constants::{SECRET_KEY_SIZE as SECP256K1_SECRET_KEY_SIZE};
use secp256k1::key;
use ethereum_types::H256;
use parity_util_mem::Memzero;
use zeroize::Zeroize;
use {Error, SECP256K1};

#[derive(Clone, PartialEq, Eq)]
pub struct Secret {
inner: Memzero<H256>,
inner: H256,
}

impl Drop for Secret {
fn drop(&mut self) {
self.inner.0.zeroize()
}
}

impl ToHex for Secret {
fn to_hex(&self) -> String {
format!("{:x}", *self.inner)
format!("{:x}", self.inner)
}
}

Expand Down Expand Up @@ -61,12 +67,12 @@ impl Secret {
}
let mut h = H256::zero();
h.as_bytes_mut().copy_from_slice(&key[0..32]);
Some(Secret { inner: Memzero::from(h) })
Some(Secret { inner: h })
}

/// Creates zero key, which is invalid for crypto operations, but valid for math operation.
pub fn zero() -> Self {
Secret { inner: Memzero::from(H256::zero()) }
Secret { inner: H256::zero() }
}

/// Imports and validates the key.
Expand Down Expand Up @@ -214,7 +220,7 @@ impl FromStr for Secret {

impl From<[u8; 32]> for Secret {
fn from(k: [u8; 32]) -> Self {
Secret { inner: Memzero::from(H256(k)) }
Secret { inner: H256(k) }
}
}

Expand Down
2 changes: 1 addition & 1 deletion accounts/ethstore/src/json/crypto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl str::FromStr for Crypto {

impl From<Crypto> for String {
fn from(c: Crypto) -> Self {
serde_json::to_string(&c).expect("serialization cannot fail, cause all crypto keys are strings")
serde_json::to_string(&c).expect("Serialization cannot fail, because all crypto keys are strings")
}
}

Expand Down
Loading

0 comments on commit 26f80c2

Please sign in to comment.