diff --git a/docs/source/address.rst b/docs/source/address.rst index 2ca9c30..4bb9e62 100644 --- a/docs/source/address.rst +++ b/docs/source/address.rst @@ -1,9 +1,6 @@ Addresses and payment IDs ========================= -In Monero v0.11.x the wallet had only one address. This is changing now. A -concept of **subaddress** has been introduced. - The first, original address of the wallet is usually known as the *master address*. All others are just *subaddresses*, even if they represent a separate account within the wallet. diff --git a/docs/source/transactions.rst b/docs/source/transactions.rst index e26f487..e2d090e 100644 --- a/docs/source/transactions.rst +++ b/docs/source/transactions.rst @@ -84,7 +84,7 @@ Or limit by both criteria at the same time: In [3]: wallet.incoming(payment_id='f75ad90e25d71a12', min_height=1087601) Out[3]: [in: f34b495cec77822a70f829ec8a5a7f1e727128d62e6b1438e9cb7799654d610e @ 1087601 3.000000000000 id=f75ad90e25d71a12] -With Monero releases > 0.11.x you will be also able to filter payments by the address: +You may also filter payments by the address: .. code-block:: python diff --git a/docs/source/wallet.rst b/docs/source/wallet.rst index b190fe6..572f99b 100644 --- a/docs/source/wallet.rst +++ b/docs/source/wallet.rst @@ -1,10 +1,8 @@ Using wallet and accounts ========================= -The wallet, up to Monero 'Helium Hydra' (0.11.x) release, had only single -address and no concept of accounts. This will change with the next version -which is planned to be published in March 2018 and already is available for -testing. +Since Monero 'Helium Hydra' (0.11.x) the wallet handles accounts and deterministically +generated addresses, known as *subaddresses*. The wallet ---------- @@ -26,15 +24,11 @@ addresses: Accounts and subaddresses ------------------------- -The following part may look strange if you are still using v0.11.x, because the -concept of multiple accounts and subaddresses didn't exist back then. - The accounts are stored in wallet's ``accounts`` attribute, which is a list. Regardless of the version, **the wallet by default operates on its account of index 0**, which makes it consistent with the behavior of the CLI wallet -client. On v0.11 the following code will work, even though it doesn't make much -sense. +client. .. code-block:: python @@ -58,8 +52,6 @@ Every wallet can have separate accounts and each account can have numerous addresses. The ``Wallet.new_account()`` and ``Account.new_address()`` will create new instances. -(This snippet will fail on Monero v0.11.x) - .. code-block:: python In [9]: w.new_address() diff --git a/monero/backends/jsonrpc.py b/monero/backends/jsonrpc.py index 01ae60b..bcc8253 100644 --- a/monero/backends/jsonrpc.py +++ b/monero/backends/jsonrpc.py @@ -130,7 +130,6 @@ class JSONRPCWallet(object): return self.raw_request('getheight')['height'] def spend_key(self): - # NOTE: This will fail on 0.11.x, the method was missing return self.raw_request('query_key', {'key_type': 'spend_key'})['key'] def view_key(self): @@ -158,10 +157,6 @@ class JSONRPCWallet(object): def addresses(self, account=0): _addresses = self.raw_request('getaddress', {'account_index': account}) - if 'addresses' not in _addresses: - # monero <= 0.11 - _log.debug('Monero <= 0.11 found, assuming single address') - return [Address(_addresses['address'])] addresses = [None] * (max(map(operator.itemgetter('address_index'), _addresses['addresses'])) + 1) for _addr in _addresses['addresses']: addresses[_addr['address_index']] = address( @@ -329,10 +324,6 @@ class JSONRPCWallet(object): if 'error' in result: err = result['error'] _log.error(u"JSON RPC error:\n{result}".format(result=_ppresult)) - # XXX: workaround for 0.11 bug throwing a wrong error code - if err['code'] == -4 and 'not enough money' in err['message']: - raise exceptions.NotEnoughMoney(err['message']) - # if err['code'] in _err2exc: raise _err2exc[err['code']](err['message']) else: diff --git a/monero/wallet.py b/monero/wallet.py index 5f24d02..f53cf63 100644 --- a/monero/wallet.py +++ b/monero/wallet.py @@ -15,9 +15,10 @@ class Wallet(object): Provides interface to operate on a wallet. - Wallet consists of :class:`accounts `. In Monero 0.11 and earlier the wallet has only a single account - with index 0. In later versions there might be multiple accounts, but a fresh wallet starts - with only one. + A wallet consists of :class:`accounts `. Fresh wallets start + with only one account but you may create more. Although it's possible to combine funds + from different accounts, or even wallets, in a single transaction, this code closely + follows the idea of separation introduced in the original wallet software. The list of accounts will be initialized under the `accounts` attribute.