Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add typo check in CI and fix typos #721

Merged
merged 1 commit into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
12 changes: 12 additions & 0 deletions .github/workflows/typo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Typo Checker
on: [pull_request]

jobs:
run:
name: Spell Check with Typos
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v2
- name: Check spelling of the entire repository
uses: crate-ci/typos@v1.11.1
6 changes: 6 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[files]
extend-exclude = [
"src/api/parity_accounts.rs",
"src/contract/ens/registry.rs"
]

4 changes: 2 additions & 2 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ ignore = []
[licenses]
# The lint level for crates which do not have a detectable license
unlicensed = "warn"
# List of explictly allowed licenses
# List of explicitly allowed licenses
# See https://spdx.org/licenses/ for list of possible licenses
# [possible values: any SPDX 3.7 short identifier (+ optional exception)].
allow = []
# List of explictly disallowed licenses
# List of explicitly disallowed licenses
# See https://spdx.org/licenses/ for list of possible licenses
# [possible values: any SPDX 3.7 short identifier (+ optional exception)].
deny = ["GPL-3.0"]
Expand Down
2 changes: 1 addition & 1 deletion src/api/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ impl<T: Transport> Eth<T> {

/// Get uncle header by block ID and uncle index.
///
/// This method is meant for TurboGeth compatiblity,
/// This method is meant for TurboGeth compatibility,
/// which is missing transaction hashes in the response.
pub fn uncle_header(&self, block: BlockId, index: Index) -> CallFuture<Option<BlockHeader>, T::Out> {
self.fetch_uncle(block, index)
Expand Down
4 changes: 2 additions & 2 deletions src/api/parity_accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ impl<T: Transport> ParityAccounts<T> {
CallFuture::new(self.transport.execute("parity_killAccount", vec![address, pwd]))
}
/// Imports an account from a given seed/phrase
/// Retunrs the address of the corresponding seed vinculated account
/// Returns the address of the corresponding seed vinculated account
pub fn parity_new_account_from_phrase(&self, seed: &str, pwd: &str) -> CallFuture<Address, T::Out> {
let seed = helpers::serialize(&seed);
let pwd = helpers::serialize(&pwd);
Expand All @@ -53,7 +53,7 @@ impl<T: Transport> ParityAccounts<T> {
CallFuture::new(self.transport.execute("parity_newAccountFromWallet", vec![wallet, pwd]))
}
/// Removes the address of the Parity node addressbook.
/// Returns true if the operation suceeded.
/// Returns true if the operation succeeded.
pub fn parity_remove_address(&self, address: &Address) -> CallFuture<bool, T::Out> {
let address = helpers::serialize(&address);
CallFuture::new(self.transport.execute("parity_removeAddress", vec![address]))
Expand Down
4 changes: 2 additions & 2 deletions src/contract/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl<T: Transport> Builder<T> {
self
}

/// Execute deployment passing code and contructor parameters.
/// Execute deployment passing code and constructor parameters.
pub async fn execute<P, V>(self, code: V, params: P, from: Address) -> Result<Contract<T>, Error>
where
P: Tokenize,
Expand Down Expand Up @@ -217,7 +217,7 @@ impl<T: Transport> Builder<T> {
match receipt.status {
Some(status) if status == 0.into() => Err(Error::ContractDeploymentFailure(receipt.transaction_hash)),
// If the `status` field is not present we use the presence of `contract_address` to
// determine if deployment was successfull.
// determine if deployment was successful.
_ => match receipt.contract_address {
Some(address) => Ok(Contract::new(eth, address, abi)),
None => Err(Error::ContractDeploymentFailure(receipt.transaction_hash)),
Expand Down
2 changes: 1 addition & 1 deletion src/contract/ens/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Ethereum Name Service Interface
//!
//! This interface provides most functions implemented in ENS.
//! With it you can resolve ethereum addresses to domain names, domain name to blockchain adresses and more!
//! With it you can resolve ethereum addresses to domain names, domain name to blockchain addresses and more!
//!
//! # Example
//! ```no_run
Expand Down
2 changes: 1 addition & 1 deletion src/signing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ pub fn keccak256(bytes: &[u8]) -> [u8; 32] {
output
}

/// Result of the name hash algotithm.
/// Result of the name hash algorithm.
pub type NameHash = [u8; 32];

/// Compute the hash of a domain name using the namehash algorithm.
Expand Down
2 changes: 1 addition & 1 deletion src/transports/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ impl<T> Batch<T>
where
T: BatchTransport,
{
/// Creates new Batch transport given existing transport supporing batch requests.
/// Creates new Batch transport given existing transport supporting batch requests.
pub fn new(transport: T) -> Self {
Batch {
transport,
Expand Down
2 changes: 1 addition & 1 deletion src/transports/ws.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ enum ResponseState {
Waiting(oneshot::Receiver<BatchResult>),
}

/// A WS resonse wrapper.
/// A WS response wrapper.
pub struct Response<R, T> {
extract: T,
state: ResponseState,
Expand Down
2 changes: 1 addition & 1 deletion src/types/recovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl Recovery {
/// Retrieve the Recovery Id ("Standard V")
///
/// Returns `None` if `v` value is invalid
/// (equivalent of returning `4` in some implementaions).
/// (equivalent of returning `4` in some implementations).
pub fn recovery_id(&self) -> Option<i32> {
match self.v {
27 => Some(0),
Expand Down
2 changes: 1 addition & 1 deletion src/types/trace_filtering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ pub struct Call {
pub from: Address,
/// Recipient
pub to: Address,
/// Transfered Value
/// Transferred Value
pub value: U256,
/// Gas
pub gas: U256,
Expand Down
2 changes: 1 addition & 1 deletion src/types/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub struct Transaction {
pub from: Option<Address>,
/// Recipient (None when contract creation)
pub to: Option<Address>,
/// Transfered value
/// Transferred value
pub value: U256,
/// Gas Price
#[serde(rename = "gasPrice")]
Expand Down
18 changes: 9 additions & 9 deletions src/types/transaction_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub struct CallRequest {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "gasPrice")]
pub gas_price: Option<U256>,
/// Transfered value (None for no transfer)
/// Transferred value (None for no transfer)
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<U256>,
/// Data (None for empty data)
Expand All @@ -42,7 +42,7 @@ pub struct CallRequest {
}

impl CallRequest {
/// Funtion to return a builder for a Call Request
/// Function to return a builder for a Call Request
pub fn builder() -> CallRequestBuilder {
CallRequestBuilder::new()
}
Expand All @@ -55,7 +55,7 @@ pub struct CallRequestBuilder {
}

impl CallRequestBuilder {
/// Retuns a Builder with the Call Request set to default
/// Returns a Builder with the Call Request set to default
pub fn new() -> CallRequestBuilder {
CallRequestBuilder {
call_request: CallRequest::default(),
Expand All @@ -80,13 +80,13 @@ impl CallRequestBuilder {
self
}

/// Set transfered value (None for no transfer)
/// Set transferred value (None for no transfer)
pub fn gas_price(mut self, gas_price: U256) -> Self {
self.call_request.gas_price = Some(gas_price);
self
}

/// Set transfered value (None for no transfer)
/// Set transferred value (None for no transfer)
pub fn value(mut self, value: U256) -> Self {
self.call_request.value = Some(value);
self
Expand Down Expand Up @@ -131,7 +131,7 @@ pub struct TransactionRequest {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "gasPrice")]
pub gas_price: Option<U256>,
/// Transfered value (None for no transfer)
/// Transferred value (None for no transfer)
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<U256>,
/// Transaction data (None for empty bytes)
Expand All @@ -158,7 +158,7 @@ pub struct TransactionRequest {
}

impl TransactionRequest {
/// Funtion to return a builder for a Transaction Request
/// Function to return a builder for a Transaction Request
pub fn builder() -> TransactionRequestBuilder {
TransactionRequestBuilder::new()
}
Expand All @@ -171,7 +171,7 @@ pub struct TransactionRequestBuilder {
}

impl TransactionRequestBuilder {
/// Retuns a Builder with the Transaction Request set to default
/// Returns a Builder with the Transaction Request set to default
pub fn new() -> TransactionRequestBuilder {
TransactionRequestBuilder {
transaction_request: TransactionRequest::default(),
Expand All @@ -196,7 +196,7 @@ impl TransactionRequestBuilder {
self
}

/// Set transfered value (None for no transfer)
/// Set transferred value (None for no transfer)
pub fn value(mut self, value: U256) -> Self {
self.transaction_request.value = Some(value);
self
Expand Down
2 changes: 1 addition & 1 deletion src/types/uint.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub use ethereum_types::{BigEndianHash, Bloom as H2048, H128, H160, H256, H512, H520, H64, U128, U256, U64};

Check warning on line 1 in src/types/uint.rs

View workflow job for this annotation

GitHub Actions / Check, test and build

unused import: `BigEndianHash`

Check warning on line 1 in src/types/uint.rs

View workflow job for this annotation

GitHub Actions / Check, test and build

unused import: `BigEndianHash`

Check warning on line 1 in src/types/uint.rs

View workflow job for this annotation

GitHub Actions / Check, test and build

unused import: `BigEndianHash`

Check warning on line 1 in src/types/uint.rs

View workflow job for this annotation

GitHub Actions / Check Transports

unused import: `BigEndianHash`

Check warning on line 1 in src/types/uint.rs

View workflow job for this annotation

GitHub Actions / Check Transports

unused import: `BigEndianHash`

Check warning on line 1 in src/types/uint.rs

View workflow job for this annotation

GitHub Actions / Check Transports

unused import: `BigEndianHash`

Check warning on line 1 in src/types/uint.rs

View workflow job for this annotation

GitHub Actions / Check Transports

unused import: `BigEndianHash`

Check warning on line 1 in src/types/uint.rs

View workflow job for this annotation

GitHub Actions / Check Transports

unused import: `BigEndianHash`

Check warning on line 1 in src/types/uint.rs

View workflow job for this annotation

GitHub Actions / Check Transports

unused import: `BigEndianHash`

Check warning on line 1 in src/types/uint.rs

View workflow job for this annotation

GitHub Actions / Check Transports

unused import: `BigEndianHash`

Check warning on line 1 in src/types/uint.rs

View workflow job for this annotation

GitHub Actions / Check Transports

unused import: `BigEndianHash`

Check warning on line 1 in src/types/uint.rs

View workflow job for this annotation

GitHub Actions / Check Transports

unused import: `BigEndianHash`

Check warning on line 1 in src/types/uint.rs

View workflow job for this annotation

GitHub Actions / Check Transports

unused import: `BigEndianHash`

Check warning on line 1 in src/types/uint.rs

View workflow job for this annotation

GitHub Actions / Check Transports

unused import: `BigEndianHash`

Check warning on line 1 in src/types/uint.rs

View workflow job for this annotation

GitHub Actions / Check WASM

unused import: `BigEndianHash`

Check warning on line 1 in src/types/uint.rs

View workflow job for this annotation

GitHub Actions / Check WASM

unused import: `BigEndianHash`

#[cfg(test)]
mod tests {
Expand Down Expand Up @@ -120,7 +120,7 @@
}

#[test]
fn should_succesfully_deserialize_decimals() {
fn should_successfully_deserialize_decimals() {
let deserialized1: Res = serde_json::from_str(r#""""#);
let deserialized2: Res = serde_json::from_str(r#""0""#);
let deserialized3: Res = serde_json::from_str(r#""10""#);
Expand Down
Loading