diff --git a/.codespellrc b/.codespellrc index 071e75c..f86d81b 100644 --- a/.codespellrc +++ b/.codespellrc @@ -2,5 +2,7 @@ [codespell] # the words that are not typos: "statics" are the static variables of C++ ignore-words-list = statics +# the possessive 's is not a part of the word: a typo before it is found, and "doesn't" stays one word +regex = [\w\-]+(?:['’](?!s\b)[\w\-]+)* # what is not text skip = *.png,*.ico,*.svg,*.pdf,*.drawio diff --git a/.vscode/extensions.json b/.vscode/extensions.json index c75c7de..b9e9a0e 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -17,6 +17,7 @@ "compulim.indent4to2", "kevinrose.vsc-python-indent", "shardulm94.trailing-spaces", - "tamasfe.even-better-toml" + "tamasfe.even-better-toml", + "streetsidesoftware.code-spell-checker" ] } diff --git a/.vscode/settings.json b/.vscode/settings.json index 21974c2..8e4786e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -74,7 +74,119 @@ "files.trimTrailingWhitespace": true, "files.insertFinalNewline": true, + // the submodules are read only in the editor, which would change their files when it saves them: monero-cpp is changed in its own clone + "files.readonlyInclude": { "external/**": true }, + // the buttons of the status bar are of .vscode/extensions/status-bar-buttons: who has the extension Tasks installed too would see a // button for each task without this - "tasks.statusbar.default.hide": true + "tasks.statusbar.default.hide": true, + "cSpell.words": [ + "annot", + "armhf", + "armv", + "autoremove", + "backlink", + "badpassword", + "banhammer", + "beefdead", + "behaviour", + "bitmonero", + "blobdata", + "buildflags", + "buildopts", + "buildpackage", + "CFLAGS", + "conftest", + "cpus", + "Cryptonote", + "dbgsym", + "DCMAKE", + "decontextualize", + "decontextualized", + "dedup", + "dedups", + "DESTDIR", + "dests", + "DNSSEC", + "dpkg", + "elts", + "fakechain", + "FCFLAGS", + "feba", + "flto", + "fprofile", + "ftime", + "gcno", + "generateblocks", + "getmonero", + "getrusage", + "graphviz", + "histo", + "idxs", + "INTERPROCEDURAL", + "Keccak", + "kwonlyargs", + "Libmonero", + "libp", + "LTRANS", + "Makefiles", + "maxrss", + "metadatas", + "mkdocs", + "modifyitems", + "Monero", + "monerod", + "msgwriter", + "MSYS", + "multisign", + "multisignature", + "myval", + "NDEBUG", + "nettype", + "nodeid", + "notanaddress", + "nothex", + "OBJCFLAGS", + "OBJCXXFLAGS", + "ohhai", + "OMZG", + "posonlyargs", + "pubkeys", + "pybind", + "pytest", + "qttools", + "rapidjson", + "REGTEST", + "repointed", + "repoints", + "repr", + "rerunfailures", + "rescan", + "rescans", + "ringdb", + "rockstar", + "RUSAGE", + "scikit", + "shlibdeps", + "stagenet", + "stubgen", + "subaddr", + "Subaddress", + "subaddresses", + "subtractfeefrom", + "summ", + "supersecretpassword", + "sweepable", + "trixie", + "txes", + "unfound", + "unmixable", + "unrelayed", + "vout", + "wijqwnn", + "wipeable", + "woodser", + "wrongpass", + "wronguser" + ] } diff --git a/bin/check_spelling.sh b/bin/check_spelling.sh index 6b7d1ab..4cf8319 100755 --- a/bin/check_spelling.sh +++ b/bin/check_spelling.sh @@ -25,3 +25,5 @@ fi # the files of git, without the submodules, whose entries are folders, and without what the build and the tests leave around cd "$root" git ls-files -z | grep -zv '^external/' | xargs -0 "$venv/bin/codespell" "$@" +# codespell says nothing when it finds none +echo "codespell $version: no typos" diff --git a/src/monero/monero_daemon.pyi b/src/monero/monero_daemon.pyi index 7dd75de..c6baef6 100644 --- a/src/monero/monero_daemon.pyi +++ b/src/monero/monero_daemon.pyi @@ -361,7 +361,7 @@ class MoneroDaemon: :param int height: is the height to start computing the miner sum. :param int num_blocks: are the number of blocks to include in the sum. - :returns MoneroMinerTxSum: the sum emission and fees since the geneis block. + :returns MoneroMinerTxSum: the sum emission and fees since the genesis block. """ ... diff --git a/src/monero/monero_daemon_info.pyi b/src/monero/monero_daemon_info.pyi index dabe6a8..aba544c 100644 --- a/src/monero/monero_daemon_info.pyi +++ b/src/monero/monero_daemon_info.pyi @@ -53,7 +53,7 @@ class MoneroDaemonInfo(MoneroRpcPaymentInfo): num_offline_peers: int | None """Number of peers that are marked as not reachable on the network.""" num_online_peers: int | None - """Number of peers that are marked as reacheble on the network.""" + """Number of peers that are marked as reachable on the network.""" num_outgoing_connections: int | None """Number of peers that you are connected to and getting information from.""" num_rpc_connections: int | None diff --git a/src/monero/monero_output_query.pyi b/src/monero/monero_output_query.pyi index 931c478..4410f09 100644 --- a/src/monero/monero_output_query.pyi +++ b/src/monero/monero_output_query.pyi @@ -17,7 +17,7 @@ class MoneroOutputQuery(MoneroOutputWallet): min_amount: int | None """Filter outputs below this amount.""" subaddress_indices: list[int] - """Subadress indices to select (empty for all).""" + """Subaddress indices to select (empty for all).""" @property def tx_query(self) -> MoneroTxQuery | None: diff --git a/src/monero/monero_rpc_connection.pyi b/src/monero/monero_rpc_connection.pyi index af701fa..85af977 100644 --- a/src/monero/monero_rpc_connection.pyi +++ b/src/monero/monero_rpc_connection.pyi @@ -96,7 +96,7 @@ class MoneroRpcConnection(SerializableStruct): :param str password: password used for authentication. :param str proxy_uri: proxy uri. :param str zmq_uri: ZMQ uri. - :param int priority: priorioty of the connection. + :param int priority: priority of the connection. :param int|None timeout_ms: connection timeout in milliseconds. """ ... diff --git a/src/monero/monero_tx.pyi b/src/monero/monero_tx.pyi index 577f601..a27369c 100644 --- a/src/monero/monero_tx.pyi +++ b/src/monero/monero_tx.pyi @@ -71,7 +71,7 @@ class MoneroTx(SerializableStruct): rct_signatures: str | None """Signatures used in ring signature to hide the true origin of the transaction.""" received_timestamp: int | None - """Unix time at chich the transaction has been received.""" + """Unix time at which the transaction has been received.""" relay: bool | None """States if this transaction should be relayed (`True`) or not (`False`).""" ring_size: int | None diff --git a/src/monero/monero_tx_config.pyi b/src/monero/monero_tx_config.pyi index 88d6336..703c3d8 100644 --- a/src/monero/monero_tx_config.pyi +++ b/src/monero/monero_tx_config.pyi @@ -40,7 +40,7 @@ class MoneroTxConfig(SerializableStruct): subtract_fee_from: list[int] """Subtract fee from outputs.""" sweep_each_subaddress: bool | None - """Sweep each wallet subbaddress.""" + """Sweep each wallet subaddress.""" @staticmethod def deserialize(config_json: str) -> MoneroTxConfig: """ diff --git a/src/monero/monero_tx_set.pyi b/src/monero/monero_tx_set.pyi index 9d0f30e..2598b92 100644 --- a/src/monero/monero_tx_set.pyi +++ b/src/monero/monero_tx_set.pyi @@ -35,7 +35,7 @@ class MoneroTxSet(SerializableStruct): Deserialize a Monero transaction set from a JSON string. :param str tx_set_json: tx set as JSON string. - :returns MoneroTxSet: The deseriliazed transaction set. + :returns MoneroTxSet: The deserialized transaction set. """ ... def __init__(self) -> None: diff --git a/src/monero/monero_wallet.pyi b/src/monero/monero_wallet.pyi index ba0c949..b531399 100644 --- a/src/monero/monero_wallet.pyi +++ b/src/monero/monero_wallet.pyi @@ -450,8 +450,8 @@ class MoneroWallet: """ Get an integrated address from a standard address and a payment id. - :param str standard_address: is the integrated addresse's standard address (defaults to wallet's primary address). - :param str payment_id: is the integrated addresse's payment id (defaults to randomly generating new payment id). + :param str standard_address: is the integrated address's standard address (defaults to wallet's primary address). + :param str payment_id: is the integrated address's payment id (defaults to randomly generating new payment id). :returns MoneroIntegratedAddress: the integrated address. """ ... @@ -727,7 +727,7 @@ class MoneroWallet: :param int account_idx: is the index of the account to get transfers from. :param int subaddress_idx: is the index of the subaddress to get transfers from. - :returns list[MoneroTransfer]: transfers to/from the accsubaddressount. + :returns list[MoneroTransfer]: transfers to/from the account. """ ... def get_tx_key(self, tx_hash: str) -> str: diff --git a/tests/utils/sync_seed_tester.py b/tests/utils/sync_seed_tester.py index 137167b..b7c1a66 100644 --- a/tests/utils/sync_seed_tester.py +++ b/tests/utils/sync_seed_tester.py @@ -54,7 +54,7 @@ def __init__( :param Callable[[MoneroWalletConfig, bool], MoneroWalletFull] create_wallet: wallet creation function. :param int | None start_height: blockchain start height. :param int | None restore_height: wallet restore height. - :param bool skip_gt_comparison: Skip wallet ground thruth verification (default `False`). + :param bool skip_gt_comparison: Skip wallet ground truth verification (default `False`). :param bool test_post_sync_notifications: Test wallet post-sync notifications (default `False`). """ self.daemon = daemon diff --git a/tests/utils/tx_wallet_tester.py b/tests/utils/tx_wallet_tester.py index f296d7f..3105915 100644 --- a/tests/utils/tx_wallet_tester.py +++ b/tests/utils/tx_wallet_tester.py @@ -105,7 +105,7 @@ def _test_pool_status(self) -> None: # these should be initialized unless a response from sending # TODO re-enable when received timestamp returned in wallet rpc - #if cself.self.tx.is_send_response: + #if self.tx.is_send_response: # assert self.tx.received_timestamp > 0 else: assert self.tx.last_relayed_timestamp is None diff --git a/tests/utils/txs_structure_tester.py b/tests/utils/txs_structure_tester.py index c9d455b..91543d3 100644 --- a/tests/utils/txs_structure_tester.py +++ b/tests/utils/txs_structure_tester.py @@ -90,7 +90,7 @@ def _test_block_txs_order(self, tx: MoneroTx, block: MoneroBlock, index: int) -> # verify tx order is self-consistent with blocks unless txs manually re-ordered by querying by hash assert other is tx else: - # TODO regtest wallet2 has inconsinstent txs order between calls + # TODO regtest wallet2 has inconsistent txs order between calls assert other in block.txs, "Tx not found in block" def _test_txs_order(self) -> None: diff --git a/tests/utils/wallet_sweeper.py b/tests/utils/wallet_sweeper.py index 6280faf..fbc2052 100644 --- a/tests/utils/wallet_sweeper.py +++ b/tests/utils/wallet_sweeper.py @@ -17,7 +17,7 @@ class WalletSweeper: _wallet: MoneroWallet """Test wallet instance to sweep funds from.""" _sweep_each_subaddress: bool | None - """Indicates if each subaddress must be sweeped out.""" + """Indicates if each subaddress must be swept out.""" def __init__(self, wallet: MoneroWallet, sweep_each_subaddress: bool | None) -> None: """Initialize a new wallet sweeper. diff --git a/tests/utils/wallet_txs_utils.py b/tests/utils/wallet_txs_utils.py index 024691e..bc3cbf6 100644 --- a/tests/utils/wallet_txs_utils.py +++ b/tests/utils/wallet_txs_utils.py @@ -91,7 +91,7 @@ def get_unrelayed_tx(cls, wallet: MoneroWallet, account_idx: int) -> MoneroTxWal :param MoneroWallet wallet: wallet to get unrelayed tx from. :param int account_idx: wallet account index to get unrelayed tx from. - :returns MoneroTxWallet: unrealyed wallet tx. + :returns MoneroTxWallet: unrelayed wallet tx. """ # TODO monero-project assert account_idx > 0, "Txs sent from/to same account are not properly synced from the pool" diff --git a/tests/utils/wallet_utils.py b/tests/utils/wallet_utils.py index 506c34c..f1de9b4 100644 --- a/tests/utils/wallet_utils.py +++ b/tests/utils/wallet_utils.py @@ -114,14 +114,14 @@ def test_account(cls, account: Optional[MoneroAccount], network_type: MoneroNetw if full: GenUtils.test_unsigned_big_integer(account.balance) GenUtils.test_unsigned_big_integer(account.unlocked_balance) - num_subadresses: int = len(account.subaddresses) + num_subaddresses: int = len(account.subaddresses) # if given, test subaddresses and that their balances add up to account balances - if num_subadresses > 0: + if num_subaddresses > 0: balance: int = 0 unlocked_balance: int = 0 - for i in range(num_subadresses): + for i in range(num_subaddresses): cls.test_subaddress(account.subaddresses[i]) assert account.index == account.subaddresses[i].account_index assert i == account.subaddresses[i].index diff --git a/tests/wallet/test_accounts.py b/tests/wallet/test_accounts.py index 8a14a39..dc8f829 100644 --- a/tests/wallet/test_accounts.py +++ b/tests/wallet/test_accounts.py @@ -156,7 +156,7 @@ def test_set_account_label(self, wallet: MoneroWallet) -> None: wallet.set_account_label(1, label) assert label == wallet.get_subaddress(1, 0).label - # Can get subaddresses at a aspecified account index + # Can get subaddresses at a specified account index @pytest.mark.skipif(TestUtils.TEST_NON_RELAYS is False, reason="TEST_NON_RELAYS disabled") def test_get_subaddresses(self, wallet: MoneroWallet) -> None: accounts: list[MoneroAccount] = wallet.get_accounts() diff --git a/tests/wallet/test_proofs.py b/tests/wallet/test_proofs.py index 0a268fa..8579bdd 100644 --- a/tests/wallet/test_proofs.py +++ b/tests/wallet/test_proofs.py @@ -185,7 +185,7 @@ def test_check_tx_proof(self, wallet: MoneroWallet) -> None: assert str(e) == "Must provide signature to check tx proof" # Can prove a spend using a generated signature and no destination public address - @pytest.mark.skipif(TestUtils.TEST_NON_RELAYS is False, reason="TEST_NON_RELAYS disablde") + @pytest.mark.skipif(TestUtils.TEST_NON_RELAYS is False, reason="TEST_NON_RELAYS disabled") def test_check_spend_proof(self, wallet: MoneroWallet) -> None: # get random confirmed outgoing txs query: MoneroTxQuery = MoneroTxQuery() @@ -235,7 +235,7 @@ def test_check_spend_proof(self, wallet: MoneroWallet) -> None: assert result is False # Can prove reserves in the wallet - @pytest.mark.skipif(TestUtils.TEST_NON_RELAYS is False, reason="TEST_NON_RELAYS disablde") + @pytest.mark.skipif(TestUtils.TEST_NON_RELAYS is False, reason="TEST_NON_RELAYS disabled") def test_get_reserve_proof_wallet(self, wallet: MoneroWallet) -> None: # get proof of entire wallet signature: str = wallet.get_reserve_proof_wallet("Test message") @@ -275,7 +275,7 @@ def test_get_reserve_proof_wallet(self, wallet: MoneroWallet) -> None: WalletErrorUtils.test_signature_header_error(exc_info.value) # Can prove reserves in an account - @pytest.mark.skipif(TestUtils.TEST_NON_RELAYS is False, reason="TEST_NON_RELAYS disablde") + @pytest.mark.skipif(TestUtils.TEST_NON_RELAYS is False, reason="TEST_NON_RELAYS disabled") def test_get_reserve_proof_account(self, wallet: MoneroWallet) -> None: # test proofs of accounts num_non_zero_tests: int = 0 diff --git a/tests/wallet/test_transfers.py b/tests/wallet/test_transfers.py index 4877fe1..9863a71 100644 --- a/tests/wallet/test_transfers.py +++ b/tests/wallet/test_transfers.py @@ -232,7 +232,7 @@ def test_get_transfers_with_query(self, wallet: MoneroWallet) -> None: assert transfer.tx.is_outgoing is True assert transfer.tx.outgoing_transfer is None - # get incoming transfers to a spefici address + # get incoming transfers to a specific address subaddress: str = wallet.get_address(1, 0) query = MoneroTransferQuery() query.incoming = True