diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 7eae67bb..c7233be7 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -56,3 +56,6 @@ jobs: run: | cargo clippy --package starknet-crypto --no-default-features -- -D warnings cargo clippy --package starknet-crypto --no-default-features --features alloc -- -D warnings + # https://github.com/crate-ci/typos/blob/master/docs/github-action.md + - name: Check spelling + uses: crate-ci/typos@master \ No newline at end of file diff --git a/starknet-core/src/types/contract/legacy.rs b/starknet-core/src/types/contract/legacy.rs index e9aa3532..9aecc6c9 100644 --- a/starknet-core/src/types/contract/legacy.rs +++ b/starknet-core/src/types/contract/legacy.rs @@ -51,7 +51,7 @@ pub struct LegacyProgram { pub attributes: Option>, pub builtins: Vec, // This field was introduced in Cairo 0.10.0. By making it optional we're keeping compatibility - // with older artifacts. This decision should be reviewd in the future. + // with older artifacts. This decision should be reviewed in the future. #[serde(skip_serializing_if = "Option::is_none")] pub compiler_version: Option, #[serde_as(as = "Vec")] diff --git a/starknet-crypto/src/rfc6979.rs b/starknet-crypto/src/rfc6979.rs index 5b2f5f60..b655d61a 100644 --- a/starknet-crypto/src/rfc6979.rs +++ b/starknet-crypto/src/rfc6979.rs @@ -54,7 +54,7 @@ pub fn generate_k( // Modified from upstream `rfc6979::generate_k` with a hard-coded right bit shift. The more // idiomatic way of doing this seems to be to implement `U252` which handles bit truncation -// interally. +// internally. // TODO: change to use upstream `generate_k` directly. #[inline] fn generate_k_shifted(x: &I, n: &I, h: &ByteArray, data: &[u8]) -> Zeroizing @@ -87,7 +87,7 @@ mod tests { use serde::Deserialize; #[derive(Deserialize)] - struct Rfc6979TestVecotr<'a> { + struct Rfc6979TestVector<'a> { msg_hash: &'a str, priv_key: &'a str, seed: &'a str, @@ -109,7 +109,7 @@ mod tests { } fn test_generate_k_from_json_str(json_str: &'static str) { - let test_vectors: Vec = serde_json::from_str(json_str).unwrap(); + let test_vectors: Vec = serde_json::from_str(json_str).unwrap(); for test_vector in test_vectors.iter() { let msg_hash = field_element_from_be_hex(test_vector.msg_hash); diff --git a/starknet-providers/src/any.rs b/starknet-providers/src/any.rs index 0369dbab..3a516b1b 100644 --- a/starknet-providers/src/any.rs +++ b/starknet-providers/src/any.rs @@ -16,7 +16,7 @@ use crate::{ }; /// A convenient Box-able type that implements the [Provider] trait. This can be useful when you -/// want to accept any built-in provider implementation from the library in your appliation, since +/// want to accept any built-in provider implementation from the library in your application, since /// the [Provider] trait itself cannot be Box-ed due to the use of associated type. /// /// A recommended pattern is to make your business logic code (e.g. functions) generic over the diff --git a/starknet-providers/src/provider.rs b/starknet-providers/src/provider.rs index 256b5429..b58074c2 100644 --- a/starknet-providers/src/provider.rs +++ b/starknet-providers/src/provider.rs @@ -256,7 +256,7 @@ pub trait Provider { .await?; if result.len() == 1 { - // Unwrapping here is safe becuase we already checked length + // Unwrapping here is safe because we already checked length Ok(result.pop().unwrap()) } else { Err(ProviderError::ArrayLengthMismatch) @@ -284,7 +284,7 @@ pub trait Provider { .await?; if result.len() == 1 { - // Unwrapping here is safe becuase we already checked length + // Unwrapping here is safe because we already checked length Ok(result.pop().unwrap()) } else { Err(ProviderError::ArrayLengthMismatch) diff --git a/starknet-providers/src/sequencer/models/transaction_receipt.rs b/starknet-providers/src/sequencer/models/transaction_receipt.rs index 78fb6565..ad4bc90d 100644 --- a/starknet-providers/src/sequencer/models/transaction_receipt.rs +++ b/starknet-providers/src/sequencer/models/transaction_receipt.rs @@ -37,13 +37,13 @@ pub enum TransactionStatus { NotReceived, /// Transaction was received by the sequenced Received, - /// Transaction passed teh validation and entered the pending block + /// Transaction passed the validation and entered the pending block Pending, /// The transaction failed validation and was skipped (applies both to a /// pending and actual created block) Rejected, Reverted, - /// Transaction passed teh validation and entered a created block + /// Transaction passed the validation and entered a created block AcceptedOnL2, /// Transaction was accepted on-chain AcceptedOnL1, diff --git a/typos.toml b/typos.toml new file mode 100644 index 00000000..21b82721 --- /dev/null +++ b/typos.toml @@ -0,0 +1,8 @@ +[files] +extend-exclude = ["*.tsv", "*.json", "*.txt"] + +[default.extend-words] +# Ignore false-positives + +[default.extend-identifiers] +# *sigh* this just isn't worth the cost of fixing