From 89987745f6abd42531a2ea937e3b077f72c6a565 Mon Sep 17 00:00:00 2001 From: Luke Schoen Date: Tue, 21 May 2019 19:42:18 +0200 Subject: [PATCH] docs: evmbin - Update Rust docs (#10658) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: Update evmbin to use rustup instead of multirust * docs: Update evmbin with Rustdocs overview, usage, comments * review-fix: Simplify evmbin usage commands * docs: Update evmbin Overview typo Co-Authored-By: David * docs: Update evmbin Overview grammer Co-Authored-By: David * docs: Update evmbin Rust comments to be lowercase Co-Authored-By: David * docs: Update evmbin Rust comments to be lowercase for gas price Co-Authored-By: David * docs: Update evmbin build command Rust docs Co-Authored-By: Tomasz Drwięga * review-fix: Update evmbin Overview to create release per dvdplm comment * review-fix: Fix explanation in usage section * review-fix: Update evmbin usage suggesting user to copy the executable to PATH or create symlink * review-fix: Update evmbin executable in path sentence * review-fix: Remove explaining to users how to use binaries since out of scope of docs --- evmbin/benches/mod.rs | 2 +- evmbin/src/main.rs | 22 +++++++++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/evmbin/benches/mod.rs b/evmbin/benches/mod.rs index 7807464dd..e1f0714d3 100644 --- a/evmbin/benches/mod.rs +++ b/evmbin/benches/mod.rs @@ -17,7 +17,7 @@ //! benchmarking for EVM //! should be started with: //! ```bash -//! multirust run nightly cargo bench +//! rustup run nightly cargo bench //! ``` #![feature(test)] diff --git a/evmbin/src/main.rs b/evmbin/src/main.rs index 6e1260189..d69884867 100644 --- a/evmbin/src/main.rs +++ b/evmbin/src/main.rs @@ -14,7 +14,23 @@ // You should have received a copy of the GNU General Public License // along with Parity Ethereum. If not, see . -//! Parity EVM interpreter binary. +//! Parity EVM Interpreter Binary. +//! +//! ## Overview +//! +//! The Parity EVM interpreter binary is a tool in the Parity +//! Ethereum toolchain. It is an EVM implementation for Parity Ethereum that +//! is used to run a standalone version of the EVM interpreter. +//! +//! ## Usage +//! +//! The evmbin tool is not distributed with regular Parity Ethereum releases +//! so you need to build it from source and run it like so: +//! +//! ```bash +//! cargo build -p evmbin --release +//! ./target/release/parity-evm --help +//! ``` #![warn(missing_docs)] @@ -268,6 +284,7 @@ struct Args { } impl Args { + /// Set the gas limit. Defaults to max value to allow code to run for whatever time is required. pub fn gas(&self) -> Result { match self.flag_gas { Some(ref gas) => gas.parse().map_err(to_string), @@ -275,6 +292,9 @@ impl Args { } } + /// Set the gas price. Defaults to zero to allow the code to run even if an account with no balance + /// is used, otherwise such accounts would not have sufficient funds to pay the transaction fee. + /// Defaulting to zero also makes testing easier since it is not necessary to specify a special configuration file. pub fn gas_price(&self) -> Result { match self.flag_gas_price { Some(ref gas_price) => gas_price.parse().map_err(to_string),