diff options
| author | benevanoff <benjaminevanoff99@gmail.com> | 2023-11-03 18:40:57 -0500 |
|---|---|---|
| committer | nahuhh <50635951+nahuhh@users.noreply.github.com> | 2025-07-07 22:21:39 +0000 |
| commit | 678f5dab31aa27c9e6e1fb24a4c1f683ef242e1a (patch) | |
| tree | 8bf8f3eb46f40f9f4d4da0d61fb687acd5fe0651 /tests | |
| parent | 8f5a7b0f1a0c2954a249318cf2f3760096991b67 (diff) | |
| download | monzero-core-678f5dab31aa27c9e6e1fb24a4c1f683ef242e1a.tar.gz monzero-core-678f5dab31aa27c9e6e1fb24a4c1f683ef242e1a.tar.xz monzero-core-678f5dab31aa27c9e6e1fb24a4c1f683ef242e1a.zip | |
wallet: create set_subaddress_lookahead wallet rpc endpoint
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/functional_tests/wallet.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/functional_tests/wallet.py b/tests/functional_tests/wallet.py index 8182cecb2..1cbe4ee68 100755 --- a/tests/functional_tests/wallet.py +++ b/tests/functional_tests/wallet.py @@ -47,6 +47,7 @@ class WalletTest(): self.check_keys() self.create_subaddresses() self.tags() + self.update_lookahead() self.attributes() self.open_close() self.languages() @@ -164,6 +165,20 @@ class WalletTest(): res = wallet.label_account(0, "main") + def update_lookahead(self): + print('Updating subaddress lookahead') + wallet = Wallet() + address_0_999 = '8BQKgTSSqJjP14AKnZUBwnXWj46MuNmLvHfPTpmry52DbfNjjHVvHUk4mczU8nj8yZ57zBhksTJ8kM5xKeJXw55kCMVqyG7' # this is the address for address 999 of the main account in the test wallet + try: # assert address_1_999 is not in the current pubkey table + wallet.get_address_index(address_0_999) + except Exception as e: + assert str(e) == "{'error': {'code': -2, 'message': \"Address doesn't belong to the wallet\"}, 'id': '0', 'jsonrpc': '2.0'}" + # update the lookahead and assert the high index address is now in the table + wallet.set_subaddress_lookahead(50, 1000) + r = wallet.get_address_index(address_0_999) + assert r['index']['major'] == 0 + assert r['index']['minor'] == 999 + def tags(self): print('Testing tags') wallet = Wallet() |
