Skip to content

Commit

Permalink
dev: Integrate typos-action into CI (#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoE11-y authored Sep 23, 2024
1 parent 0c553ba commit b39860b
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 5 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/typos-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Typos Check
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
permissions: read-all

jobs:
run:
name: Spell Check with Typos
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v4

- name: Check spelling
uses: crate-ci/typos@master
8 changes: 8 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[files]
extend-exclude = [
"docs/img/*.svg",
"docs/img/*.excalidraw"
]

[default.extend-words]
Pn = "Pn"
2 changes: 1 addition & 1 deletion packages/client/src/main.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ struct Args {
///
/// Receives current state (chain state + utreexo state) and pending blocks,
/// then validates and applies them one by one.
/// Returns new state in case of succes, otherwise raises an error.
/// Returns new state in case of success, otherwise raises an error.
fn main(mut arguments: Span<felt252>) -> State {
let Args { mut state, blocks, } = Serde::deserialize(ref arguments)
.expect('Failed to deserialize');
Expand Down
2 changes: 1 addition & 1 deletion packages/consensus/src/codec.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ pub impl TransactionCodecImpl of TransactionCodec {
}

/// Variable size codec.
/// Converts lenght value into Compact Size bytes and appends to the buffer.
/// Converts length value into Compact Size bytes and appends to the buffer.
///
/// https://learnmeabitcoin.com/technical/general/compact-size/
pub fn encode_compact_size(len: usize, ref dest: ByteArray) {
Expand Down
2 changes: 1 addition & 1 deletion packages/consensus/src/types/utreexo.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ pub trait UtreexoAccumulator {
self: @UtreexoState, outpoint_hash: felt252, proof: @UtreexoProof
) -> Result<(), UtreexoError>;

/// Removes single output from the accumlator (order is important).
/// Removes single output from the accumulator (order is important).
///
/// Note that once verified, the output itself is not required for deletion,
/// the leaf index plus inclusion proof is enough.
Expand Down
2 changes: 1 addition & 1 deletion packages/consensus/src/validation/locktime.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ pub fn validate_relative_locktime(
let value = sequence & SEQUENCE_LOCKTIME_MASK;

if (sequence & SEQUENCE_LOCKTIME_TYPE_FLAG) != 0 {
// TODO: use the median from prev_timestamps of the inital chain state
// TODO: use the median from prev_timestamps of the initial chain state
// Note that this has to be provided by the script + at the point where
// we update local cache or Utreexo roots.
//
Expand Down
2 changes: 1 addition & 1 deletion scripts/data/generate_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def next_chain_state(head: dict, blocks: list):
prev_timestamps = head["prev_timestamps"] + list(map(lambda x: x["time"], blocks))
next_head["prev_timestamps"] = prev_timestamps[-11:]

# Update epoch start time if neccesary
# Update epoch start time if necessary
if head["height"] // 2016 != block_height // 2016:
next_head["epoch_start_time"] = get_epoch_start_time(block_height)
else:
Expand Down

0 comments on commit b39860b

Please sign in to comment.