Skip to content

Commit

Permalink
chore: fix typos (#6399)
Browse files Browse the repository at this point in the history
* chore: fix typos

* more
  • Loading branch information
DaniPopes authored Nov 22, 2023
1 parent 441c853 commit 56ad18d
Show file tree
Hide file tree
Showing 38 changed files with 70 additions and 70 deletions.
2 changes: 1 addition & 1 deletion crates/anvil/src/eth/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1640,7 +1640,7 @@ impl EthApi {
Ok(())
}

/// Create a bufer that represents all state on the chain, which can be loaded to separate
/// Create a buffer that represents all state on the chain, which can be loaded to separate
/// process by calling `anvil_loadState`
///
/// Handler for RPC call: `anvil_dumpState`
Expand Down
2 changes: 1 addition & 1 deletion crates/anvil/src/eth/miner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ impl Default for FixedBlockTimeMiner {
pub struct ReadyTransactionMiner {
/// how many transactions to mine per block
max_transactions: usize,
/// stores whether there are pending transacions (if known)
/// stores whether there are pending transactions (if known)
has_pending_txs: Option<bool>,
/// Receives hashes of transactions that are ready
rx: Fuse<Receiver<TxHash>>,
Expand Down
16 changes: 8 additions & 8 deletions crates/anvil/tests/it/fork.rs
Original file line number Diff line number Diff line change
Expand Up @@ -503,26 +503,26 @@ async fn test_fork_nft_set_approve_all() {

let nouns = Erc721::new(nouns_addr, Arc::clone(&provider));

let real_onwer = nouns.owner_of(token_id).call().await.unwrap();
assert_eq!(real_onwer, owner);
let real_owner = nouns.owner_of(token_id).call().await.unwrap();
assert_eq!(real_owner, owner);
let approval = nouns.set_approval_for_all(nouns_addr, true);
let tx = approval.send().await.unwrap().await.unwrap().unwrap();
assert_eq!(tx.status, Some(1u64.into()));

// transfer: impersonate real owner and transfer nft
api.anvil_impersonate_account(real_onwer).await.unwrap();
api.anvil_impersonate_account(real_owner).await.unwrap();

api.anvil_set_balance(real_onwer, U256::from(10000e18 as u64)).await.unwrap();
api.anvil_set_balance(real_owner, U256::from(10000e18 as u64)).await.unwrap();

let call = nouns.transfer_from(real_onwer, wallet.address(), token_id);
let call = nouns.transfer_from(real_owner, wallet.address(), token_id);
let mut tx: TypedTransaction = call.tx;
tx.set_from(real_onwer);
tx.set_from(real_owner);
provider.fill_transaction(&mut tx, None).await.unwrap();
let tx = provider.send_transaction(tx, None).await.unwrap().await.unwrap().unwrap();
assert_eq!(tx.status, Some(1u64.into()));

let real_onwer = nouns.owner_of(token_id).call().await.unwrap();
assert_eq!(real_onwer, wallet.address());
let real_owner = nouns.owner_of(token_id).call().await.unwrap();
assert_eq!(real_owner, wallet.address());
}

// <https://github.com/foundry-rs/foundry/issues/2261>
Expand Down
2 changes: 1 addition & 1 deletion crates/anvil/tests/it/otterscan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ async fn can_call_ots_get_internal_operations_contract_deploy() {
}

#[tokio::test(flavor = "multi_thread")]
async fn can_call_ots_get_internal_operations_contract_trasfer() {
async fn can_call_ots_get_internal_operations_contract_transfer() {
let (api, handle) = spawn(NodeConfig::test()).await;
let provider = handle.http_provider();

Expand Down
2 changes: 1 addition & 1 deletion crates/binder/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ where
//
// If ssh-agent authentication fails, libgit2 will keep calling this
// callback asking for other authentication methods to try. Check
// cred_helper_bad to make sure we only try the git credentail helper
// cred_helper_bad to make sure we only try the git credential helper
// once, to avoid looping forever.
if allowed.contains(git2::CredentialType::USER_PASS_PLAINTEXT) && cred_helper_bad.is_none()
{
Expand Down
2 changes: 1 addition & 1 deletion crates/cheatcodes/src/inspector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ pub struct Cheatcodes {
/// Address labels
pub labels: HashMap<Address, String>,

/// Rememebered private keys
/// Remembered private keys
pub script_wallets: Vec<LocalWallet>,

/// Whether the skip cheatcode was activated
Expand Down
2 changes: 1 addition & 1 deletion crates/cheatcodes/src/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ pub(super) fn value_to_token(value: &Value) -> Result<DynSolValue> {
// to f64.
let s = number.to_string();

// Coerced to scientific notation, so short-ciruit to using fallback.
// Coerced to scientific notation, so short-circuit to using fallback.
// This will not have a problem with hex numbers, as for parsing these
// We'd need to prefix this with 0x.
// See also <https://docs.soliditylang.org/en/latest/types.html#rational-and-integer-literals>
Expand Down
2 changes: 1 addition & 1 deletion crates/cheatcodes/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ impl Cheatcode for computeCreate2Address_1Call {
}

/// Using a given private key, return its public ETH address, its public key affine x and y
/// coodinates, and its private key (see the 'Wallet' struct)
/// coordinates, and its private key (see the 'Wallet' struct)
///
/// If 'label' is set to 'Some()', assign that label to the associated ETH address in state
fn create_wallet(private_key: &U256, label: Option<&str>, state: &mut Cheatcodes) -> Result {
Expand Down
2 changes: 1 addition & 1 deletion crates/common/src/runtime_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ fn build_auth(jwt: String) -> eyre::Result<Authorization> {
let auth = JwtAuth::new(secret, None, None);
let token = auth.generate_token()?;

// Essentially unrolled ethers-rs new_with_auth to accomodate the custom timeout
// Essentially unrolled ethers-rs new_with_auth to accommodate the custom timeout
let auth = Authorization::Bearer(token);

Ok(auth)
Expand Down
8 changes: 4 additions & 4 deletions crates/config/src/inline/natspec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,18 +192,18 @@ mod tests {
#[test]
fn can_handle_unavailable_src_line_with_fallback() {
let mut fn_data: BTreeMap<String, Value> = BTreeMap::new();
let doc_withouth_src_field = json!({ "text": "forge-config:default.fuzz.runs=600" });
fn_data.insert("documentation".into(), doc_withouth_src_field);
let doc_without_src_field = json!({ "text": "forge-config:default.fuzz.runs=600" });
fn_data.insert("documentation".into(), doc_without_src_field);
let (_, src_line) = get_fn_docs(&fn_data).expect("Some docs");
assert_eq!(src_line, "<no-src-line-available>".to_string());
}

#[test]
fn can_handle_available_src_line() {
let mut fn_data: BTreeMap<String, Value> = BTreeMap::new();
let doc_withouth_src_field =
let doc_without_src_field =
json!({ "text": "forge-config:default.fuzz.runs=600", "src": "73:21:12" });
fn_data.insert("documentation".into(), doc_withouth_src_field);
fn_data.insert("documentation".into(), doc_without_src_field);
let (_, src_line) = get_fn_docs(&fn_data).expect("Some docs");
assert_eq!(src_line, "73:21:12".to_string());
}
Expand Down
2 changes: 1 addition & 1 deletion crates/config/src/providers/remappings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl Remappings {
remappings
}

/// Push an element ot the remappings vector, but only if it's not already present.
/// Push an element to the remappings vector, but only if it's not already present.
pub fn push(&mut self, remapping: Remapping) {
if !self.remappings.iter().any(|existing| {
// What we're doing here is filtering for ambiguous paths. For example, if we have
Expand Down
2 changes: 1 addition & 1 deletion crates/doc/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl DocBuilder {
}
}

/// Set `shoul_build` flag on the builder
/// Set `should_build` flag on the builder
pub fn with_should_build(mut self, should_build: bool) -> Self {
self.should_build = should_build;
self
Expand Down
2 changes: 1 addition & 1 deletion crates/doc/src/preprocessor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub use deployments::{Deployment, Deployments, DEPLOYMENTS_ID};
pub struct PreprocessorId(&'static str);

/// Preprocessor output.
/// Wraps all exisiting preprocessor outputs
/// Wraps all existing preprocessor outputs
/// in a single abstraction.
#[derive(Debug, Clone)]
pub enum PreprocessorOutput {
Expand Down
4 changes: 2 additions & 2 deletions crates/doc/src/writer/buf_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl BufWriter {
writeln!(self.buf, "{}", Markdown::Italic(text))
}

/// Writes bold text to the bufffer formatted as [Markdown::Bold].
/// Writes bold text to the buffer formatted as [Markdown::Bold].
pub fn write_bold(&mut self, text: &str) -> fmt::Result {
writeln!(self.buf, "{}", Markdown::Bold(text))
}
Expand All @@ -90,7 +90,7 @@ impl BufWriter {
writeln!(self.buf, "{}", Markdown::Link(name, path))
}

/// Writes a list item to the bufffer indented by specified depth.
/// Writes a list item to the buffer indented by specified depth.
pub fn write_list_item(&mut self, item: &str, depth: usize) -> fmt::Result {
let indent = " ".repeat(depth * 2);
writeln!(self.buf, "{indent}- {item}")
Expand Down
4 changes: 2 additions & 2 deletions crates/evm/core/src/backend/fuzz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ pub struct FuzzBackendWrapper<'a> {
///
/// No calls on the `FuzzBackendWrapper` will ever persistently modify the `backend`'s state.
pub backend: Cow<'a, Backend>,
/// Keeps track of whether the backed is already intialized
/// Keeps track of whether the backed is already initialized
is_initialized: bool,
/// Keeps track of wheter there was a snapshot failure.
/// Keeps track of whether there was a snapshot failure.
///
/// Necessary as the backend is dropped after usage, but we'll need to persist
/// the snapshot failure anyhow.
Expand Down
4 changes: 2 additions & 2 deletions crates/evm/core/src/backend/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -779,8 +779,8 @@ impl Backend {
self.inner.precompiles().contains(addr)
}

/// Ths will clean up already loaded accounts that would be initialized without the correct data
/// from the fork
/// Cleans up already loaded accounts that would be initialized without the correct data from
/// the fork.
///
/// It can happen that an account is loaded before the first fork is selected, like
/// `getNonce(addr)`, which will load an empty account by default.
Expand Down
2 changes: 1 addition & 1 deletion crates/evm/coverage/src/analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ impl SourceAnalyzer {
//
// The missing contracts are:
// 1. libraries used in ancestors of this contracts
// 2. libraries used in libaries (i.e libs indirectly used by this contract)
// 2. libraries used in libraries (i.e libs indirectly used by this contract)
//
// We want to find out all the above contracts and libraries related to this contract.

Expand Down
2 changes: 1 addition & 1 deletion crates/evm/evm/src/executors/invariant/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ fn can_continue(
} else {
// Increase the amount of reverts.
failures.reverts += 1;
// If fail on revert is set, we must return inmediately.
// If fail on revert is set, we must return immediately.
if fail_on_revert {
let error = InvariantFuzzError::new(
invariant_contract,
Expand Down
2 changes: 1 addition & 1 deletion crates/fmt/src/comments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ impl Comments {
Self { prefixes, postfixes }
}

/// Heloer for removing comments before a byte offset
/// Helper for removing comments before a byte offset
fn remove_comments_before(
comments: &mut VecDeque<CommentWithMetadata>,
byte: usize,
Expand Down
2 changes: 1 addition & 1 deletion crates/fmt/src/formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,7 @@ impl<'a, W: Write> Formatter<'a, W> {

/// Visit the right side of an assignment. The function will try to write the assignment on a
/// single line or indented on the next line. If it can't do this it resorts to letting the
/// expression decide how to split iself on multiple lines
/// expression decide how to split itself on multiple lines
fn visit_assignment(&mut self, expr: &mut Expression) -> Result<()> {
if self.try_on_single_line(|fmt| expr.visit(fmt))? {
return Ok(())
Expand Down
2 changes: 1 addition & 1 deletion crates/fmt/src/solang_ext/ast_eq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ impl AstEq for Statement {
While(loc, expr, stmt1),
DoWhile(loc, stmt1, expr),
For(loc, stmt1, expr, stmt2, stmt3),
Try(loc, expr, params, claus),
Try(loc, expr, params, clause),
Error(loc)
_
Block {
Expand Down
4 changes: 2 additions & 2 deletions crates/fmt/testdata/DocComments/fmt.sol
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ contract HelloWorld {
/// A long doc line comment that will be wrapped
function docLineOverflow() external {}

function docLinePostfixOveflow() external {}
function docLinePostfixOverflow() external {}

/// A long doc line comment that will be wrapped

Expand Down Expand Up @@ -87,7 +87,7 @@ contract HelloWorld {
* }
* }
*/
function malformedIndentOveflow() external {}
function malformedIndentOverflow() external {}
}

/**
Expand Down
4 changes: 2 additions & 2 deletions crates/fmt/testdata/DocComments/original.sol
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ contract HelloWorld {
/// A long doc line comment that will be wrapped
function docLineOverflow() external {}

function docLinePostfixOveflow() external {} /// A long doc line comment that will be wrapped
function docLinePostfixOverflow() external {} /// A long doc line comment that will be wrapped

/**
* @notice Here is my comment
Expand Down Expand Up @@ -82,7 +82,7 @@ function withALongNameThatWillCauseCommentWrap() public {
}
}
*/
function malformedIndentOveflow() external {}
function malformedIndentOverflow() external {}
}

/**
Expand Down
4 changes: 2 additions & 2 deletions crates/fmt/testdata/DocComments/wrap-comments.fmt.sol
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ contract HelloWorld {
external
{}

function docLinePostfixOveflow()
function docLinePostfixOverflow()
external
{}

Expand Down Expand Up @@ -113,7 +113,7 @@ contract HelloWorld {
* }
* }
*/
function malformedIndentOveflow()
function malformedIndentOverflow()
external
{}
}
Expand Down
4 changes: 2 additions & 2 deletions crates/fmt/testdata/InlineDisable/fmt.sol
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,9 @@ function testUnit() {
value = 1 gwei;
value = 1 ether;

uint256 someVeryVeryVeryLongVaribleNameForTheMultiplierForEtherValue;
uint256 someVeryVeryVeryLongVariableNameForTheMultiplierForEtherValue;

value = someVeryVeryVeryLongVaribleNameForTheMultiplierForEtherValue * 1 /* comment1 */ ether; // comment2
value = someVeryVeryVeryLongVariableNameForTheMultiplierForEtherValue * 1 /* comment1 */ ether; // comment2

value = 1 // comment3
// comment4
Expand Down
4 changes: 2 additions & 2 deletions crates/fmt/testdata/InlineDisable/original.sol
Original file line number Diff line number Diff line change
Expand Up @@ -387,9 +387,9 @@ function testUnit() {
value = 1 gwei;
value = 1 ether;

uint256 someVeryVeryVeryLongVaribleNameForTheMultiplierForEtherValue;
uint256 someVeryVeryVeryLongVariableNameForTheMultiplierForEtherValue;

value = someVeryVeryVeryLongVaribleNameForTheMultiplierForEtherValue * 1 /* comment1 */ ether; // comment2
value = someVeryVeryVeryLongVariableNameForTheMultiplierForEtherValue * 1 /* comment1 */ ether; // comment2

value = 1 // comment3
// comment4
Expand Down
4 changes: 2 additions & 2 deletions crates/fmt/testdata/UnitExpression/fmt.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ contract UnitExpression {
value = 1 gwei;
value = 1 ether;

uint256 someVeryVeryVeryLongVaribleNameForTheMultiplierForEtherValue;
uint256 someVeryVeryVeryLongVariableNameForTheMultiplierForEtherValue;

value = someVeryVeryVeryLongVaribleNameForTheMultiplierForEtherValue
value = someVeryVeryVeryLongVariableNameForTheMultiplierForEtherValue
* 1 /* comment1 */ ether; // comment2

value = 1 // comment3
Expand Down
4 changes: 2 additions & 2 deletions crates/fmt/testdata/UnitExpression/original.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ contract UnitExpression {
value = 1 gwei;
value = 1 ether;

uint256 someVeryVeryVeryLongVaribleNameForTheMultiplierForEtherValue;
uint256 someVeryVeryVeryLongVariableNameForTheMultiplierForEtherValue;

value = someVeryVeryVeryLongVaribleNameForTheMultiplierForEtherValue * 1 /* comment1 */ ether; // comment2
value = someVeryVeryVeryLongVariableNameForTheMultiplierForEtherValue * 1 /* comment1 */ ether; // comment2

value = 1 // comment3
// comment4
Expand Down
4 changes: 2 additions & 2 deletions crates/forge/bin/cmd/script/receipts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub async fn wait_for_pending(
}

/// Traverses a set of pendings and either finds receipts, or clears them from
/// the deployment sequnce.
/// the deployment sequence.
///
/// If no `tx_hashes` are provided, then `deployment_sequence.pending` will be
/// used. For each `tx_hash`, we check if it has confirmed. If it has
Expand Down Expand Up @@ -111,7 +111,7 @@ pub async fn clear_pendings(
deployment_sequence.add_receipt(receipt);
}

// print any erros
// print any errors
if !errors.is_empty() {
let mut error_msg = errors.join("\n");
if !deployment_sequence.pending.is_empty() {
Expand Down
Loading

0 comments on commit 56ad18d

Please sign in to comment.