diff --git a/.github/workflows/typo.yml b/.github/workflows/typo.yml new file mode 100644 index 00000000..e3a7b39d --- /dev/null +++ b/.github/workflows/typo.yml @@ -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 diff --git a/.typos.toml b/.typos.toml new file mode 100644 index 00000000..a6c65d10 --- /dev/null +++ b/.typos.toml @@ -0,0 +1,6 @@ +[files] +extend-exclude = [ + "src/api/parity_accounts.rs", + "src/contract/ens/registry.rs" +] + diff --git a/deny.toml b/deny.toml index 0e9c33ab..b7443636 100644 --- a/deny.toml +++ b/deny.toml @@ -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"] diff --git a/src/api/eth.rs b/src/api/eth.rs index 7ff0f988..bdaa7c3d 100644 --- a/src/api/eth.rs +++ b/src/api/eth.rs @@ -249,7 +249,7 @@ impl Eth { /// 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, T::Out> { self.fetch_uncle(block, index) diff --git a/src/api/parity_accounts.rs b/src/api/parity_accounts.rs index dc04556c..bf89cc5e 100644 --- a/src/api/parity_accounts.rs +++ b/src/api/parity_accounts.rs @@ -32,7 +32,7 @@ impl ParityAccounts { 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 { let seed = helpers::serialize(&seed); let pwd = helpers::serialize(&pwd); @@ -53,7 +53,7 @@ impl ParityAccounts { 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 { let address = helpers::serialize(&address); CallFuture::new(self.transport.execute("parity_removeAddress", vec![address])) diff --git a/src/contract/deploy.rs b/src/contract/deploy.rs index 6e4dbd9d..9a2f9258 100644 --- a/src/contract/deploy.rs +++ b/src/contract/deploy.rs @@ -45,7 +45,7 @@ impl Builder { self } - /// Execute deployment passing code and contructor parameters. + /// Execute deployment passing code and constructor parameters. pub async fn execute(self, code: V, params: P, from: Address) -> Result, Error> where P: Tokenize, @@ -217,7 +217,7 @@ impl Builder { 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)), diff --git a/src/contract/ens/mod.rs b/src/contract/ens/mod.rs index 5a7c4d7a..f6985f21 100644 --- a/src/contract/ens/mod.rs +++ b/src/contract/ens/mod.rs @@ -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 diff --git a/src/signing.rs b/src/signing.rs index a3f2fce2..b72e0ea6 100644 --- a/src/signing.rs +++ b/src/signing.rs @@ -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. diff --git a/src/transports/batch.rs b/src/transports/batch.rs index c24a544f..6463e381 100644 --- a/src/transports/batch.rs +++ b/src/transports/batch.rs @@ -30,7 +30,7 @@ impl Batch 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, diff --git a/src/transports/ws.rs b/src/transports/ws.rs index a9455d68..1e6cd19e 100644 --- a/src/transports/ws.rs +++ b/src/transports/ws.rs @@ -424,7 +424,7 @@ enum ResponseState { Waiting(oneshot::Receiver), } -/// A WS resonse wrapper. +/// A WS response wrapper. pub struct Response { extract: T, state: ResponseState, diff --git a/src/types/recovery.rs b/src/types/recovery.rs index bfa2ec0e..dbde7b3d 100644 --- a/src/types/recovery.rs +++ b/src/types/recovery.rs @@ -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 { match self.v { 27 => Some(0), diff --git a/src/types/trace_filtering.rs b/src/types/trace_filtering.rs index 83005157..6095937d 100644 --- a/src/types/trace_filtering.rs +++ b/src/types/trace_filtering.rs @@ -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, diff --git a/src/types/transaction.rs b/src/types/transaction.rs index 017fd23a..5a0e149b 100644 --- a/src/types/transaction.rs +++ b/src/types/transaction.rs @@ -22,7 +22,7 @@ pub struct Transaction { pub from: Option
, /// Recipient (None when contract creation) pub to: Option
, - /// Transfered value + /// Transferred value pub value: U256, /// Gas Price #[serde(rename = "gasPrice")] diff --git a/src/types/transaction_request.rs b/src/types/transaction_request.rs index 1fb4a544..9eec17f7 100644 --- a/src/types/transaction_request.rs +++ b/src/types/transaction_request.rs @@ -21,7 +21,7 @@ pub struct CallRequest { #[serde(skip_serializing_if = "Option::is_none")] #[serde(rename = "gasPrice")] pub gas_price: Option, - /// Transfered value (None for no transfer) + /// Transferred value (None for no transfer) #[serde(skip_serializing_if = "Option::is_none")] pub value: Option, /// Data (None for empty data) @@ -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() } @@ -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(), @@ -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 @@ -131,7 +131,7 @@ pub struct TransactionRequest { #[serde(skip_serializing_if = "Option::is_none")] #[serde(rename = "gasPrice")] pub gas_price: Option, - /// Transfered value (None for no transfer) + /// Transferred value (None for no transfer) #[serde(skip_serializing_if = "Option::is_none")] pub value: Option, /// Transaction data (None for empty bytes) @@ -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() } @@ -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(), @@ -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 diff --git a/src/types/uint.rs b/src/types/uint.rs index dc62b2d1..08fd661a 100644 --- a/src/types/uint.rs +++ b/src/types/uint.rs @@ -120,7 +120,7 @@ mod tests { } #[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""#);