diff --git a/hathor/debug_resources.py b/hathor/debug_resources.py index 5d0707b2f..81c22d3cc 100644 --- a/hathor/debug_resources.py +++ b/hathor/debug_resources.py @@ -155,7 +155,7 @@ def render_GET(self, request: Request) -> bytes: assert level in self.valid_log_levels log_func = getattr(log, level) msg = get_arg_default(raw_args, 'msg', self.default_log_msg) - # TODO: maybe add an `extras` param (probably as a json body via POST) to add arbitray structed attributes + # TODO: maybe add an `extras` param (probably as a json body via POST) to add arbitrarily structed attributes log_func(msg) return b'OK: no side-effects\n' diff --git a/hathor/difficulty.py b/hathor/difficulty.py index 4a8467ef8..2f8c58369 100644 --- a/hathor/difficulty.py +++ b/hathor/difficulty.py @@ -37,7 +37,7 @@ - pdiff -> u256 - weight -> u256 -From the above conversions it is possible to make all converions between (hash, target, bdiff, pdiff, weight) using +From the above conversions it is possible to make all conversions between (hash, target, bdiff, pdiff, weight) using u256 as intermediary. # References diff --git a/hathor/ipykernel.py b/hathor/ipykernel.py index 31e942346..6868ee444 100644 --- a/hathor/ipykernel.py +++ b/hathor/ipykernel.py @@ -32,7 +32,7 @@ def __init__(self, runtime_dir: Optional[str] = None): # https://ipykernel.readthedocs.io/en/stable/api/ipykernel.html#ipykernel.kernelapp.IPKernelApp.connection_dir # https://github.com/ipython/ipykernel/blob/main/ipykernel/kernelapp.py#L301-L320 # if not defined now, when init_connection_file is called it will be set to 'kernel-.json', it is - # defined now because it's more convinient to have a fixed path that doesn't depend on the PID of the + # defined now because it's more convenient to have a fixed path that doesn't depend on the PID of the # running process, which doesn't benefit us anyway since the data dir self.connection_dir = runtime_dir self.connection_file = 'kernel.json' diff --git a/hathor/merged_mining/coordinator.py b/hathor/merged_mining/coordinator.py index 1873fa95a..c38a3287b 100644 --- a/hathor/merged_mining/coordinator.py +++ b/hathor/merged_mining/coordinator.py @@ -198,7 +198,7 @@ def to_stratum_params(self) -> list: [i[::-1].hex() for i in self.merkle_path], encode_uint32(self.version)[::-1].hex(), self.bits.hex(), - encode_uint32(self.timestamp)[::-1].hex(), # FIXME/TODO: verify actual endianess + encode_uint32(self.timestamp)[::-1].hex(), # FIXME/TODO: verify actual endianness self.clean ] diff --git a/hathor/metrics.py b/hathor/metrics.py index b53752342..d018438a1 100644 --- a/hathor/metrics.py +++ b/hathor/metrics.py @@ -121,10 +121,10 @@ class Metrics: def __post_init__(self) -> None: self.log = logger.new() - # Stores caculated tx weights saved in tx storage + # Stores calculated tx weights saved in tx storage self.weight_tx_deque: deque[WeightValue] = deque(maxlen=self.weight_tx_deque_len) - # Stores caculated block weights saved in tx storage + # Stores calculated block weights saved in tx storage self.weight_block_deque: deque[WeightValue] = deque(maxlen=self.weight_block_deque_len) # A timer to periodically collect data diff --git a/hathor/util.py b/hathor/util.py index 785b6712a..4163eed5c 100644 --- a/hathor/util.py +++ b/hathor/util.py @@ -632,7 +632,7 @@ class sorted_merger(Iterator[T]): """ Adaptor class to merge multiple sorted iterators into a single iterator that is also sorted. Note: for this adaptor to work as expected the input iterators have to already be sorted, but if they aren't, the - resulting iterator won't crash, or unexpecetdly stop working, however it will not be sorted. + resulting iterator won't crash, or unexpectedly stop working, however it will not be sorted. A custom key function can be supplied to customize the sort order, and the reverse flag can be set to request the result in descending order. @@ -697,7 +697,7 @@ def __next__(self) -> T: if not self._iterators: raise StopIteration cmp = max if self._reverse else min - # XXX: this line bellow is correct, but it's just really hard to convince mypy of that, ignoring for now + # XXX: this line below is correct, but it's just really hard to convince mypy of that, ignoring for now best_it = cmp(self._iterators, key=lambda it: self._key(it.peek())) # type: ignore return next(best_it)