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 2 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
20 changes: 19 additions & 1 deletion evmbin/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,21 @@
// 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 an additional tool in the Parity
ltfschoen marked this conversation as resolved.
Show resolved Hide resolved
//! Ethereum toolchain. It is an EVM implementation for Parity Ethereum that
//! may be used to run a standalone version of the EVM interpreter.
ltfschoen marked this conversation as resolved.
Show resolved Hide resolved
//!
//! ## Usage
//!
//! Build Parity Ethereum from source, then start it with:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it is not included in regular releases? That is a bit unusual so perhaps worth expanding on, like "The evmbin tool is not distributed with regular Parity Ethereum releases so you need to build it from source like so: …`?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i've pushed a commit fixing this, thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you happy with the changes @dvdplm?

//! ```bash
//! cd evmbin && cargo build --release && cd ..
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

something like

cargo build -p evmbin

and is much simpler

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i've pushed a commit addressing your comment to simplify it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, i've pushed a commit fixing it now so it's:

//! ```bash
//! cargo build -p evmbin --release
//! ./target/release/parity-evm --help
//! ```

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that ok @soc1c ?

//! ./target/release/parity-evmbin --help
//! ```

#![warn(missing_docs)]

Expand Down Expand Up @@ -268,13 +282,17 @@ struct Args {
}

impl Args {
/// Set the Gas Limit. Defaults to max value to allow code to run for whatever time is required.
ltfschoen marked this conversation as resolved.
Show resolved Hide resolved
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
ltfschoen marked this conversation as resolved.
Show resolved Hide resolved
/// 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