monero-ecosystem / monero-python

A comprehensive Python module for handling Monero cryptocurrency
BSD 3-Clause "New" or "Revised" License
246 stars 80 forks source link

Support for get_transfer_by_txid Wallet-RPC method and multiple destinations amount bugfix. #44

Closed lialsoftlab closed 5 years ago

lialsoftlab commented 5 years ago

Added support for get_transfer_by_txid wallet-RPC method, since we can't get info for concrete transfer by txid through wallet incoming()/outgoing() calls. Also added bug fix for outgoing transfers processing with multiple destinations, since amount must be from destinations array not from transfer amount.

coveralls commented 5 years ago

Pull Request Test Coverage Report for Build 230


Changes Missing Coverage Covered Lines Changed/Added Lines %
monero/account.py 1 2 50.0%
monero/backends/offline.py 1 2 50.0%
monero/wallet.py 1 2 50.0%
monero/backends/jsonrpc.py 1 7 14.29%
<!-- Total: 4 13 30.77% -->
Totals Coverage Status
Change from base Build 221: -0.7%
Covered Lines: 969
Relevant Lines: 1113

💛 - Coveralls
emesik commented 5 years ago

Hi Alexey,

Thanks for your input. Could you please cover that code with some tests? Apart from standard behavior three particular cases come to my mind as worth testing:

  1. Transaction with given hash is not found.
  2. Transaction exists but contains no payment related to the account/wallet.
  3. Transaction contains more than a single payment related to the account/wallet.

Thanks for signalling the bug as well, I'll check it separately.

lialsoftlab commented 5 years ago

Hi Michał! Ok I'll write a tests, but anyway:

  1. monero.exceptions.TransactionNotFound if hash is invalid or not existent.
  2. monero.exceptions.TransactionNotFound if hash for tx from some other wallet.
  3. You'll get the one transaction with amount equal to sum of the individual payments to this account.
emesik commented 5 years ago

The destinations bug has been fixed in d81b29182fdb9940accc9664144697e0d1fcf6ea and is present in v0.5.1

lialsoftlab commented 5 years ago

Ok. Thanks!