Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
114 changes: 113 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
2 changes: 2 additions & 0 deletions bin/check_spelling.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion src/monero/monero_daemon.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
...

Expand Down
2 changes: 1 addition & 1 deletion src/monero/monero_daemon_info.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/monero/monero_output_query.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/monero/monero_rpc_connection.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
...
Expand Down
2 changes: 1 addition & 1 deletion src/monero/monero_tx.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/monero/monero_tx_config.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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:
"""
Expand Down
2 changes: 1 addition & 1 deletion src/monero/monero_tx_set.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions src/monero/monero_wallet.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
...
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/sync_seed_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/tx_wallet_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/txs_structure_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/wallet_sweeper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/wallet_txs_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions tests/utils/wallet_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/wallet/test_accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
6 changes: 3 additions & 3 deletions tests/wallet/test_proofs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/wallet/test_transfers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading