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

docs: evmbin - Update Rust docs #10658

Merged
merged 14 commits into from
May 21, 2019
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion evmbin/benches/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
//! benchmarking for EVM
//! should be started with:
//! ```bash
//! multirust run nightly cargo bench
//! rustup run nightly cargo bench
//! ```

#![feature(test)]
Expand Down
26 changes: 25 additions & 1 deletion evmbin/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,27 @@
// You should have received a copy of the GNU General Public License
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.

//! 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
//! ```
//!
//! If you wish to run `parity-evm` from any directory, then either copy the
//! executable file itself to a directory that is in your PATH, or just create
//! a symlink to it.

#![warn(missing_docs)]

Expand Down Expand Up @@ -268,13 +288,17 @@ 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<U256, String> {
match self.flag_gas {
Some(ref gas) => gas.parse().map_err(to_string),
None => Ok(U256::from(u64::max_value())),
}
}

/// 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<U256, String> {
match self.flag_gas_price {
Some(ref gas_price) => gas_price.parse().map_err(to_string),
Expand Down