Skip to content

Commit

Permalink
Merge pull request #197 from vuittont60/ci-typo
Browse files Browse the repository at this point in the history
feat: add codespell lint job into workflows & fix typos
  • Loading branch information
dr-orlovsky authored Dec 26, 2023
2 parents 6c0a818 + 57d91c7 commit cb114e6
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 39 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,8 @@ jobs:
with:
command: doc
args: --workspace --all-features
typos:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: crate-ci/typos@master
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ v0.2.0-beta.3
- Multiple BIP-32 improvements on top of rust-bitcoin functionality
- Better CI
- Android/iOS/Windows/MacOs build fixes
- AchorId strict encoding
- AnchorId strict encoding
- Fixed issue with broken `serde_with` macro (pinned older version in Cargo.toml)
- More collection types supporting `AutoConceal`

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ aluvm = { version = "~0.11.0-beta.2", features = ["std"] }
commit_verify = { version = "~0.11.0-beta.2", features = ["rand", "derive"] }
single_use_seals = "~0.11.0-beta.2"
bp-core = { version = "~0.11.0-beta.2" }
secp256k1-zkp = { version = "0.9.2", features = ["rand", "rand-std", "global-context"] } # TODO: Update version before the relese
secp256k1-zkp = { version = "0.9.2", features = ["rand", "rand-std", "global-context"] } # TODO: Update version before the release
baid58 = "~0.4.4"
mime = "~0.3.17"
serde_crate = { package = "serde", version = "1", features = ["derive"], optional = true }
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ The current list of the projects based on the library include:
Minimum supported rust compiler version (MSRV): 1.66, rust 2021 edition.

The library can be integrated into other rust projects via `Cargo.toml`
`[dependecies]` section:
`[dependencies]` section:

```toml
[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Instead, please report them to the repository maintainers by sending a **GPG
encrypted e-mail** to _all maintainers of a specific repo_ using their GPG keys.

A list of repository maintainers and their keys and e-mail addresses are
provided inside MAINTANERS.md file and MANIFEST.yml, with the latter also
provided inside MAINTAINERS.md file and MANIFEST.yml, with the latter also
included in the README.md as a manifest block, which looks in the following way:

```yaml
Expand Down
9 changes: 9 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[files]
# exclude the directory "stl/"
extend-exclude = ["stl/"]

[default.extend-words]
# Don't correct the name "Jon Atack".
Atack = "Atack"
# Don't correct the Seh in "pkXwpsb-aemTWhtSg-VDGF25hEi-jtTAnPjzh-B63ZwSehE-WvfhF9".
Seh = "Seh"
68 changes: 34 additions & 34 deletions src/schema/occurrences.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,97 +167,97 @@ mod test {

#[test]
fn test_once_check_count() {
let occurence: Occurrences = Occurrences::Once;
occurence.check(1).unwrap();
let occurrence: Occurrences = Occurrences::Once;
occurrence.check(1).unwrap();
}
#[test]
#[should_panic(expected = "OccurrencesMismatch { min: 1, max: 1, found: 0 }")]
fn test_once_check_count_fail_zero() {
let occurence: Occurrences = Occurrences::Once;
occurence.check(0).unwrap();
let occurrence: Occurrences = Occurrences::Once;
occurrence.check(0).unwrap();
}
#[test]
#[should_panic(expected = "OccurrencesMismatch { min: 1, max: 1, found: 2 }")]
fn test_once_check_count_fail_two() {
let occurence: Occurrences = Occurrences::Once;
occurence.check(2).unwrap();
let occurrence: Occurrences = Occurrences::Once;
occurrence.check(2).unwrap();
}

#[test]
fn test_none_or_once_check_count() {
let occurence: Occurrences = Occurrences::NoneOrOnce;
occurence.check(1).unwrap();
let occurrence: Occurrences = Occurrences::NoneOrOnce;
occurrence.check(1).unwrap();
}
#[test]
fn test_none_or_once_check_count_zero() {
let occurence: Occurrences = Occurrences::NoneOrOnce;
occurence.check(0).unwrap();
let occurrence: Occurrences = Occurrences::NoneOrOnce;
occurrence.check(0).unwrap();
}
#[test]
#[should_panic(expected = "OccurrencesMismatch { min: 0, max: 1, found: 2 }")]
fn test_none_or_once_check_count_fail_two() {
let occurence: Occurrences = Occurrences::NoneOrOnce;
occurence.check(2).unwrap();
let occurrence: Occurrences = Occurrences::NoneOrOnce;
occurrence.check(2).unwrap();
}

#[test]
fn test_once_or_up_to_none() {
let occurence: Occurrences = Occurrences::OnceOrMore;
occurence.check(1).unwrap();
let occurrence: Occurrences = Occurrences::OnceOrMore;
occurrence.check(1).unwrap();
}
#[test]
fn test_once_or_up_to_none_large() {
let occurence: Occurrences = Occurrences::OnceOrMore;
occurence.check(core::u16::MAX).unwrap();
let occurrence: Occurrences = Occurrences::OnceOrMore;
occurrence.check(core::u16::MAX).unwrap();
}
#[test]
#[should_panic(expected = "OccurrencesMismatch { min: 1, max: 65535, found: 0 }")]
fn test_once_or_up_to_none_fail_zero() {
let occurence: Occurrences = Occurrences::OnceOrMore;
occurence.check(0).unwrap();
let occurrence: Occurrences = Occurrences::OnceOrMore;
occurrence.check(0).unwrap();
}
#[test]
fn test_once_or_up_to_42() {
let occurence: Occurrences = Occurrences::OnceOrUpTo(42);
occurence.check(42).unwrap();
let occurrence: Occurrences = Occurrences::OnceOrUpTo(42);
occurrence.check(42).unwrap();
}
#[test]
#[should_panic(expected = "OccurrencesMismatch { min: 1, max: 42, found: 43 }")]
fn test_once_or_up_to_42_large() {
let occurence: Occurrences = Occurrences::OnceOrUpTo(42);
occurence.check(43).unwrap();
let occurrence: Occurrences = Occurrences::OnceOrUpTo(42);
occurrence.check(43).unwrap();
}
#[test]
#[should_panic(expected = "OccurrencesMismatch { min: 1, max: 42, found: 0 }")]
fn test_once_or_up_to_42_fail_zero() {
let occurence: Occurrences = Occurrences::OnceOrUpTo(42);
occurence.check(0).unwrap();
let occurrence: Occurrences = Occurrences::OnceOrUpTo(42);
occurrence.check(0).unwrap();
}

#[test]
fn test_none_or_up_to_none_zero() {
let occurence: Occurrences = Occurrences::NoneOrMore;
occurence.check(0).unwrap();
let occurrence: Occurrences = Occurrences::NoneOrMore;
occurrence.check(0).unwrap();
}
#[test]
fn test_none_or_up_to_none_large() {
let occurence: Occurrences = Occurrences::NoneOrMore;
occurence.check(core::u16::MAX).unwrap();
let occurrence: Occurrences = Occurrences::NoneOrMore;
occurrence.check(core::u16::MAX).unwrap();
}
#[test]
fn test_none_or_up_to_42_zero() {
let occurence: Occurrences = Occurrences::NoneOrMore;
occurence.check(0).unwrap();
let occurrence: Occurrences = Occurrences::NoneOrMore;
occurrence.check(0).unwrap();
}
#[test]
fn test_none_or_up_to_42() {
let occurence: Occurrences = Occurrences::NoneOrMore;
occurence.check(42).unwrap();
let occurrence: Occurrences = Occurrences::NoneOrMore;
occurrence.check(42).unwrap();
}
#[test]
#[should_panic(expected = "OccurrencesMismatch { min: 0, max: 42, found: 43 }")]
fn test_none_or_up_to_42_large() {
let occurence: Occurrences = Occurrences::NoneOrUpTo(42);
occurence.check(43).unwrap();
let occurrence: Occurrences = Occurrences::NoneOrUpTo(42);
occurrence.check(43).unwrap();
}
}
2 changes: 1 addition & 1 deletion src/validation/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ use crate::{
pub enum TxResolverError {
/// transaction {0} is not mined
Unknown(Txid),
/// unable to retriev transaction {0}, {1}
/// unable to retrieve transaction {0}, {1}
Other(Txid, String),
}

Expand Down

0 comments on commit cb114e6

Please sign in to comment.