Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for Wallet V5R1 to the pytoniq library, implementing the latest wallet version for the TON blockchain with enhanced features like signature control and extensions support.
- Implements
WalletV5R1wallet class with full create/import functionality - Adds
WalletV5WalletIDhelper class for wallet ID packing/unpacking - Updates pytoniq-core dependency to version 0.1.45
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| pytoniq/contract/wallets/wallet_v5.py | New file implementing WalletV5R1 class and WalletV5WalletID helper |
| pytoniq/contract/wallets/wallet.py | Moves message count assertion from raw_transfer to raw_create_transfer_msg |
| pytoniq/contract/wallets/init.py | Exports new WalletV5R1 and WalletV5WalletID classes |
| tests/test_wallet.py | Adds comprehensive tests for WalletV5WalletID packing/unpacking and wallet creation |
| setup.py | Updates pytoniq-core dependency to >=0.1.45 |
| examples/wallets/wallet_v5.py | Provides usage example for WalletV5R1 |
Comments suppressed due to low confidence (1)
pytoniq/contract/wallets/wallet.py:52
- Overridden method signature does not match call, where it is passed an argument named 'msgs'. Overriding method method HighloadWalletV3.raw_transfer matches the call.
Overridden method signature does not match call, where it is passed an argument named 'msgs'. Overriding method method HighloadWallet.raw_transfer matches the call.
Overridden method signature does not match call, where it is passed an argument named 'msgs'. Overriding method method BaseWallet.raw_transfer matches the call.
Overridden method signature does not match call, where it is passed an argument named 'msgs'. Overriding method method BaseWallet.raw_transfer matches the call.
Overridden method signature does not match call, where it is passed an argument named 'query_id'. Overriding method method HighloadWalletV3.raw_transfer matches the call.
async def raw_transfer(self, *args, **kwargs): ...
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| subwallet_number: int = 0, is_signature_allowed: bool = True): | ||
| public_key = private_key_to_public_key(private_key) | ||
| return await cls.from_data(provider=provider, public_key=public_key, network_global_id=network_global_id, wc=wc, wallet_id=wallet_id, | ||
| private_key=private_key, is_signature_allowed=is_signature_allowed) |
There was a problem hiding this comment.
Missing subwallet_number parameter in the call to from_data. The parameter is defined in from_private_key (line 107) but not passed through to from_data, which could lead to unexpected behavior when users specify a custom subwallet_number.
| private_key=private_key, is_signature_allowed=is_signature_allowed) | |
| private_key=private_key, subwallet_number=subwallet_number, is_signature_allowed=is_signature_allowed) |
| network_global_id: typing.Optional[int] = None, | ||
| subwallet_number: int = 0, is_signature_allowed: bool = True): | ||
| mnemo = mnemonic_new(24) | ||
| return mnemo, await cls.from_mnemonic(provider, mnemonics=mnemo, wc=wc, wallet_id=wallet_id, network_global_id=network_global_id, is_signature_allowed=is_signature_allowed) |
There was a problem hiding this comment.
Missing subwallet_number parameter in the call to from_mnemonic. The parameter is defined in create (line 128) but not passed through, which could lead to unexpected behavior when users specify a custom subwallet_number.
| return mnemo, await cls.from_mnemonic(provider, mnemonics=mnemo, wc=wc, wallet_id=wallet_id, network_global_id=network_global_id, is_signature_allowed=is_signature_allowed) | |
| return mnemo, await cls.from_mnemonic(provider, mnemonics=mnemo, wc=wc, wallet_id=wallet_id, network_global_id=network_global_id, subwallet_number=subwallet_number, is_signature_allowed=is_signature_allowed) |
| """ | ||
| :return: unpacked subwallet_id from wallet's get method | ||
| """ | ||
| wallet_id = (await super().run_get_method("get_subwallet_id"))[0] |
There was a problem hiding this comment.
Extra space between '=' and '(' operators.
| wallet_id = (await super().run_get_method("get_subwallet_id"))[0] | |
| wallet_id = (await super().run_get_method("get_subwallet_id"))[0] |
| network_global_id = -239, workchain = 0, version = 0', subwallet_number = 0 (client context) | ||
| gives wallet_id = 2147483409 | ||
| network_global_id = -239, workchain = -1, version = 0', subwallet_number = 0 (client context) | ||
| gives wallet_id = 8388369 | ||
| network_global_id = -3, workchain = 0, version = 0', subwallet_number = 0 (client context) | ||
| gives wallet_id = 2147483645 | ||
| network_global_id = -3, workchain = -1, version = 0', subwallet_number = 0 (client context) |
There was a problem hiding this comment.
Incorrect quote character in docstring. Should use double quote or remove the single quote after '0'.
| network_global_id = -239, workchain = 0, version = 0', subwallet_number = 0 (client context) | |
| gives wallet_id = 2147483409 | |
| network_global_id = -239, workchain = -1, version = 0', subwallet_number = 0 (client context) | |
| gives wallet_id = 8388369 | |
| network_global_id = -3, workchain = 0, version = 0', subwallet_number = 0 (client context) | |
| gives wallet_id = 2147483645 | |
| network_global_id = -3, workchain = -1, version = 0', subwallet_number = 0 (client context) | |
| network_global_id = -239, workchain = 0, version = 0, subwallet_number = 0 (client context) | |
| gives wallet_id = 2147483409 | |
| network_global_id = -239, workchain = -1, version = 0, subwallet_number = 0 (client context) | |
| gives wallet_id = 8388369 | |
| network_global_id = -3, workchain = 0, version = 0, subwallet_number = 0 (client context) | |
| gives wallet_id = 2147483645 | |
| network_global_id = -3, workchain = -1, version = 0, subwallet_number = 0 (client context) |
| network_global_id = -239, workchain = 0, version = 0', subwallet_number = 0 (client context) | ||
| gives wallet_id = 2147483409 | ||
| network_global_id = -239, workchain = -1, version = 0', subwallet_number = 0 (client context) | ||
| gives wallet_id = 8388369 | ||
| network_global_id = -3, workchain = 0, version = 0', subwallet_number = 0 (client context) | ||
| gives wallet_id = 2147483645 | ||
| network_global_id = -3, workchain = -1, version = 0', subwallet_number = 0 (client context) |
There was a problem hiding this comment.
Incorrect quote character in docstring. Should use double quote or remove the single quote after '0'.
| network_global_id = -239, workchain = 0, version = 0', subwallet_number = 0 (client context) | |
| gives wallet_id = 2147483409 | |
| network_global_id = -239, workchain = -1, version = 0', subwallet_number = 0 (client context) | |
| gives wallet_id = 8388369 | |
| network_global_id = -3, workchain = 0, version = 0', subwallet_number = 0 (client context) | |
| gives wallet_id = 2147483645 | |
| network_global_id = -3, workchain = -1, version = 0', subwallet_number = 0 (client context) | |
| network_global_id = -239, workchain = 0, version = 0, subwallet_number = 0 (client context) | |
| gives wallet_id = 2147483409 | |
| network_global_id = -239, workchain = -1, version = 0, subwallet_number = 0 (client context) | |
| gives wallet_id = 8388369 | |
| network_global_id = -3, workchain = 0, version = 0, subwallet_number = 0 (client context) | |
| gives wallet_id = 2147483645 | |
| network_global_id = -3, workchain = -1, version = 0, subwallet_number = 0 (client context) |
| network_global_id = -239, workchain = 0, version = 0', subwallet_number = 0 (client context) | ||
| gives wallet_id = 2147483409 | ||
| network_global_id = -239, workchain = -1, version = 0', subwallet_number = 0 (client context) | ||
| gives wallet_id = 8388369 | ||
| network_global_id = -3, workchain = 0, version = 0', subwallet_number = 0 (client context) | ||
| gives wallet_id = 2147483645 | ||
| network_global_id = -3, workchain = -1, version = 0', subwallet_number = 0 (client context) |
There was a problem hiding this comment.
Incorrect quote character in docstring. Should use double quote or remove the single quote after '0'.
| network_global_id = -239, workchain = 0, version = 0', subwallet_number = 0 (client context) | |
| gives wallet_id = 2147483409 | |
| network_global_id = -239, workchain = -1, version = 0', subwallet_number = 0 (client context) | |
| gives wallet_id = 8388369 | |
| network_global_id = -3, workchain = 0, version = 0', subwallet_number = 0 (client context) | |
| gives wallet_id = 2147483645 | |
| network_global_id = -3, workchain = -1, version = 0', subwallet_number = 0 (client context) | |
| network_global_id = -239, workchain = 0, version = 0, subwallet_number = 0 (client context) | |
| gives wallet_id = 2147483409 | |
| network_global_id = -239, workchain = -1, version = 0, subwallet_number = 0 (client context) | |
| gives wallet_id = 8388369 | |
| network_global_id = -3, workchain = 0, version = 0, subwallet_number = 0 (client context) | |
| gives wallet_id = 2147483645 | |
| network_global_id = -3, workchain = -1, version = 0, subwallet_number = 0 (client context) |
| network_global_id = -239, workchain = 0, version = 0', subwallet_number = 0 (client context) | ||
| gives wallet_id = 2147483409 | ||
| network_global_id = -239, workchain = -1, version = 0', subwallet_number = 0 (client context) | ||
| gives wallet_id = 8388369 | ||
| network_global_id = -3, workchain = 0, version = 0', subwallet_number = 0 (client context) | ||
| gives wallet_id = 2147483645 | ||
| network_global_id = -3, workchain = -1, version = 0', subwallet_number = 0 (client context) |
There was a problem hiding this comment.
Incorrect quote character in docstring. Should use double quote or remove the single quote after '0'.
| network_global_id = -239, workchain = 0, version = 0', subwallet_number = 0 (client context) | |
| gives wallet_id = 2147483409 | |
| network_global_id = -239, workchain = -1, version = 0', subwallet_number = 0 (client context) | |
| gives wallet_id = 8388369 | |
| network_global_id = -3, workchain = 0, version = 0', subwallet_number = 0 (client context) | |
| gives wallet_id = 2147483645 | |
| network_global_id = -3, workchain = -1, version = 0', subwallet_number = 0 (client context) | |
| network_global_id = -239, workchain = 0, version = 0, subwallet_number = 0 (client context) | |
| gives wallet_id = 2147483409 | |
| network_global_id = -239, workchain = -1, version = 0, subwallet_number = 0 (client context) | |
| gives wallet_id = 8388369 | |
| network_global_id = -3, workchain = 0, version = 0, subwallet_number = 0 (client context) | |
| gives wallet_id = 2147483645 | |
| network_global_id = -3, workchain = -1, version = 0, subwallet_number = 0 (client context) |
| @pytest.mark.asyncio | ||
| async def test_wallet_v5_creation(client): | ||
| with pytest.raises(WalletError): # wallet_id or network_global_id is required | ||
| m, w = await WalletV5R1.create(client, wc=-1) |
| @pytest.mark.asyncio | ||
| async def test_wallet_v5_creation(client): | ||
| with pytest.raises(WalletError): # wallet_id or network_global_id is required | ||
| m, w = await WalletV5R1.create(client, wc=-1) |
| import time | ||
| import typing | ||
|
|
||
| from .wallet import Wallet, WalletError, BaseWallet |
There was a problem hiding this comment.
Import of 'Wallet' is not used.
| from .wallet import Wallet, WalletError, BaseWallet | |
| from .wallet import WalletError, BaseWallet |
No description provided.