Skip to content

Commit 17c4543

Browse files
authored
typo: fix comments and docs into more sensible (bluealloy#1920)
* made base comment & doc typo fixes * Updated one third of doc comments * Revert "made base comment & doc typo fixes" This reverts commit 65dad46. * fixed outer doc comments, verbs and periods (passed 1 review) * reverted few fixes * fixed doctest failures
1 parent 3124e5e commit 17c4543

File tree

175 files changed

+1528
-1344
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

175 files changed

+1528
-1344
lines changed

bins/revme/src/cmd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use clap::Parser;
1212
pub enum MainCmd {
1313
/// Execute Ethereum state tests.
1414
Statetest(statetest::Cmd),
15-
/// Execute eof validation tests.
15+
/// Execute EOF validation tests.
1616
EofValidation(eofvalidation::Cmd),
1717
/// Run arbitrary EVM bytecode.
1818
Evm(evmrunner::Cmd),

bins/revme/src/cmd/bench.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ pub enum BenchName {
1313
Transfer,
1414
}
1515

16-
/// `bytecode` subcommand.
16+
/// `bytecode` subcommand
1717
#[derive(Parser, Debug)]
1818
pub struct Cmd {
1919
#[arg(value_enum)]
2020
name: BenchName,
2121
}
2222

2323
impl Cmd {
24-
/// Run bench command.
24+
/// Runs bench command.
2525
pub fn run(&self) {
2626
match self.name {
2727
BenchName::Analysis => analysis::run(),

bins/revme/src/cmd/bench/analysis.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub fn run() {
1616
let context = Context::builder()
1717
.with_db(BenchmarkDB::new_bytecode(bytecode))
1818
.modify_tx_chained(|tx| {
19-
// execution globals block hash/gas_limit/coinbase/timestamp..
19+
// Execution globals block hash/gas_limit/coinbase/timestamp..
2020
tx.caller = address!("1000000000000000000000000000000000000000");
2121
tx.transact_to = TxKind::Call(address!("0000000000000000000000000000000000000000"));
2222
//evm.env.tx.data = Bytes::from(hex::decode("30627b7c").unwrap());

bins/revme/src/cmd/bench/burntpix.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ pub fn run() {
6060
_ => unreachable!("Execution failed: {:?}", tx_result),
6161
};
6262

63-
// remove returndata offset and length from output
63+
// Remove returndata offset and length from output
6464
let returndata_offset = 64;
6565
let data = &return_data[returndata_offset..];
6666

67-
// remove trailing zeros
67+
// Remove trailing zeros
6868
let trimmed_data = data
6969
.split_at(data.len() - data.iter().rev().filter(|&x| *x == 0).count())
7070
.0;

bins/revme/src/cmd/bench/snailtracer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub fn simple_example(bytecode: Bytecode) {
1010
let context = Context::builder()
1111
.with_db(BenchmarkDB::new_bytecode(bytecode.clone()))
1212
.modify_tx_chained(|tx| {
13-
// execution globals block hash/gas_limit/coinbase/timestamp..
13+
// Execution globals block hash/gas_limit/coinbase/timestamp..
1414
tx.caller = address!("1000000000000000000000000000000000000000");
1515
tx.transact_to = TxKind::Call(address!("0000000000000000000000000000000000000000"));
1616
tx.data = bytes!("30627b7c");

bins/revme/src/cmd/bench/transfer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub fn run() {
1111
let context = Context::builder()
1212
.with_db(BenchmarkDB::new_bytecode(Bytecode::new()))
1313
.modify_tx_chained(|tx| {
14-
// execution globals block hash/gas_limit/coinbase/timestamp..
14+
// Execution globals block hash/gas_limit/coinbase/timestamp..
1515
tx.caller = "0x0000000000000000000000000000000000000001"
1616
.parse()
1717
.unwrap();

bins/revme/src/cmd/bytecode.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ pub struct Cmd {
1515
/// Is EOF code in RUNTIME mode.
1616
#[arg(long)]
1717
eof_runtime: bool,
18-
/// Bytecode in hex format. If bytes start with 0xFE it will be interpreted as a EOF.
19-
/// Otherwise, it will be interpreted as a EOF bytecode.
20-
/// If not provided, it will operate in interactive EOF validation mode.
18+
/// Bytecode in hex format string.
19+
///
20+
/// - If bytes start with 0xFE it will be interpreted as a EOF.
21+
/// - Otherwise, it will be interpreted as a EOF bytecode.
22+
/// - If not provided, it will operate in interactive EOF validation mode.
2123
#[arg()]
2224
bytes: Option<String>,
2325
}
@@ -34,7 +36,7 @@ fn trim_decode(input: &str) -> Option<Bytes> {
3436
}
3537

3638
impl Cmd {
37-
/// Run statetest command.
39+
/// Runs statetest command.
3840
pub fn run(&self) {
3941
let container_kind = if self.eof_initcode {
4042
Some(CodeType::ReturnContract)
@@ -64,12 +66,12 @@ impl Cmd {
6466
return;
6567
}
6668

67-
// else run command in loop.
69+
// Else run command in loop.
6870
loop {
6971
let mut input = String::new();
7072
io::stdin().read_line(&mut input).expect("Input Error");
7173
if input.len() == 1 {
72-
// just a newline, so exit
74+
// Just a newline, so exit
7375
return;
7476
}
7577
let Some(bytes) = trim_decode(&input) else {

bins/revme/src/cmd/eofvalidation.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ use revm::bytecode::eof::{validate_raw_eof_inner, CodeType, EofError};
88
use std::collections::BTreeMap;
99
use std::path::{Path, PathBuf};
1010

11-
/// `eof-validation` subcommand.
11+
/// `eof-validation` subcommand
1212
#[derive(Parser, Debug)]
1313
pub struct Cmd {
14-
/// Input paths to EOF validation tests.
14+
/// Input paths to EOF validation tests
1515
#[arg(required = true, num_args = 1..)]
1616
paths: Vec<PathBuf>,
1717
}
1818

1919
impl Cmd {
20-
/// Run statetest command.
20+
/// Runs statetest command.
2121
pub fn run(&self) -> Result<(), Error> {
22-
// check if path exists.
22+
// Check if path exists.
2323
for path in &self.paths {
2424
if !path.exists() {
2525
return Err(Error::Custom("The specified path does not exist"));
@@ -31,15 +31,15 @@ impl Cmd {
3131
}
3232

3333
fn skip_test(name: &str) -> bool {
34-
// embedded containers rules changed
34+
// Embedded containers rules changed
3535
if name.starts_with("EOF1_embedded_container") {
3636
return true;
3737
}
3838
matches!(
3939
name,
4040
"EOF1_undefined_opcodes_186"
4141
| ""
42-
// truncated data is only allowed in embedded containers
42+
// Truncated data is only allowed in embedded containers
4343
| "validInvalid_48"
4444
| "validInvalid_1"
4545
| "EOF1_truncated_section_3"

bins/revme/src/cmd/evmrunner.rs

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,38 +28,40 @@ pub enum Errors {
2828
BytecodeDecodeError(#[from] BytecodeDecodeError),
2929
}
3030

31-
/// Evm runner command allows running arbitrary evm bytecode.
32-
/// Bytecode can be provided from cli or from file with --path option.
31+
/// Evm runner command allows running arbitrary evm bytecode
32+
///
33+
/// Bytecode can be provided from cli or from file with `--path` option.
3334
#[derive(Parser, Debug)]
3435
pub struct Cmd {
35-
/// Hex-encoded EVM bytecode to be executed.
36+
/// Hex-encoded EVM bytecode to be executed
3637
#[arg(required_unless_present = "path")]
3738
bytecode: Option<String>,
38-
/// Path to a file containing the hex-encoded EVM bytecode to be executed.
39+
/// Path to a file containing the hex-encoded EVM bytecode to be executed
40+
///
3941
/// Overrides the positional `bytecode` argument.
4042
#[arg(long)]
4143
path: Option<PathBuf>,
42-
/// Run in benchmarking mode.
44+
/// Whether to run in benchmarking mode
4345
#[arg(long)]
4446
bench: bool,
45-
/// Hex-encoded input/calldata bytes.
47+
/// Hex-encoded input/calldata bytes
4648
#[arg(long, default_value = "")]
4749
input: String,
48-
/// Print the state.
50+
/// Whether to print the state
4951
#[arg(long)]
5052
state: bool,
51-
/// Print the trace.
53+
/// Whether to print the trace
5254
#[arg(long)]
5355
trace: bool,
5456
}
5557

5658
impl Cmd {
57-
/// Run evm runner command.
59+
/// Runs evm runner command.
5860
pub fn run(&self) -> Result<(), Errors> {
5961
const CALLER: Address = address!("0000000000000000000000000000000000000001");
6062

6163
let bytecode_str: Cow<'_, str> = if let Some(path) = &self.path {
62-
// check if path exists.
64+
// Check if path exists.
6365
if !path.exists() {
6466
return Err(Errors::PathNotExists);
6567
}
@@ -80,7 +82,7 @@ impl Cmd {
8082
let nonce = db.basic(CALLER).unwrap().map_or(0, |account| account.nonce);
8183

8284
// BenchmarkDB is dummy state that implements Database trait.
83-
// the bytecode is deployed at zero address.
85+
// The bytecode is deployed at zero address.
8486
let mut evm = MainEvm::new(
8587
Context::builder().with_db(db).modify_tx_chained(|tx| {
8688
tx.caller = CALLER;

bins/revme/src/cmd/statetest.rs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,38 @@ use clap::Parser;
88
use runner::{find_all_json_tests, run, TestError};
99
use std::path::PathBuf;
1010

11-
/// `statetest` subcommand.
11+
/// `statetest` subcommand
1212
#[derive(Parser, Debug)]
1313
pub struct Cmd {
14-
/// Path to folder or file containing the tests. If multiple paths are specified
15-
/// they will be run in sequence.
14+
/// Path to folder or file containing the tests
15+
///
16+
/// If multiple paths are specified they will be run in sequence.
1617
///
1718
/// Folders will be searched recursively for files with the extension `.json`.
1819
#[clap(required = true, num_args = 1..)]
1920
paths: Vec<PathBuf>,
20-
/// Run tests in a single thread.
21+
/// Run tests in a single thread
2122
#[clap(short = 's', long)]
2223
single_thread: bool,
23-
/// Output results in JSON format.
24+
/// Output results in JSON format
25+
///
2426
/// It will stop second run of evm on failure.
2527
#[clap(long)]
2628
json: bool,
27-
/// Output outcome in JSON format. If `--json` is true, this is implied.
29+
/// Output outcome in JSON format
30+
///
31+
/// If `--json` is true, this is implied.
32+
///
2833
/// It will stop second run of EVM on failure.
2934
#[clap(short = 'o', long)]
3035
json_outcome: bool,
31-
/// Keep going after a test failure.
36+
/// Keep going after a test failure
3237
#[clap(long, alias = "no-fail-fast")]
3338
keep_going: bool,
3439
}
3540

3641
impl Cmd {
37-
/// Run statetest command.
42+
/// Runs `statetest` command.
3843
pub fn run(&self) -> Result<(), TestError> {
3944
for path in &self.paths {
4045
println!("\nRunning tests in {}...", path.display());

0 commit comments

Comments
 (0)