KomodoPlatform / electrum-komodo

Komodo Electrum wallet
MIT License
4 stars 7 forks source link

rewards calc add missing min 10 KMD amount check #33

Closed pbca26 closed 4 years ago

smk762 commented 4 years ago

I got error -

  File "/home/smk762/pbca/electrum-komodo/gui/qt/__init__.py", line 227, in start_new_window
    w = self.create_window_for_wallet(wallet)
  File "/home/smk762/pbca/electrum-komodo/gui/qt/__init__.py", line 180, in create_window_for_wallet
    w = ElectrumWindow(self, wallet)
  File "/home/smk762/pbca/electrum-komodo/gui/qt/main_window.py", line 200, in __init__
    self.load_wallet(wallet)
  File "/home/smk762/pbca/electrum-komodo/lib/util.py", line 293, in <lambda>
    return lambda *args, **kw_args: do_profile(func, args, kw_args)
  File "/home/smk762/pbca/electrum-komodo/lib/util.py", line 289, in do_profile
    o = func(*args, **kw_args)
  File "/home/smk762/pbca/electrum-komodo/gui/qt/main_window.py", line 345, in load_wallet
    self.history_list.update()
  File "/home/smk762/pbca/electrum-komodo/gui/qt/util.py", line 508, in update
    self.on_update()
  File "/home/smk762/pbca/electrum-komodo/lib/util.py", line 293, in <lambda>
    return lambda *args, **kw_args: do_profile(func, args, kw_args)
  File "/home/smk762/pbca/electrum-komodo/lib/util.py", line 289, in do_profile
    o = func(*args, **kw_args)
  File "/home/smk762/pbca/electrum-komodo/gui/qt/history_list.py", line 216, in on_update
    r = self.wallet.get_full_history(domain=self.get_domain(), from_timestamp=self.start_timestamp, to_timestamp=self.end_timestamp, fx=fx)
  File "/home/smk762/pbca/electrum-komodo/lib/util.py", line 293, in <lambda>
    return lambda *args, **kw_args: do_profile(func, args, kw_args)
  File "/home/smk762/pbca/electrum-komodo/lib/util.py", line 289, in do_profile
    o = func(*args, **kw_args)
  File "/home/smk762/pbca/electrum-komodo/lib/wallet.py", line 1061, in get_full_history
    h = self.get_history(domain)
  File "/home/smk762/pbca/electrum-komodo/lib/wallet.py", line 1026, in get_history
    c, u, x, interest = self.get_balance(domain)
  File "/home/smk762/pbca/electrum-komodo/lib/wallet.py", line 753, in get_balance
    c, u, x, interest = self.get_addr_balance(addr)
  File "/home/smk762/pbca/electrum-komodo/lib/wallet.py", line 699, in get_addr_balance
    interest += calcInterest(utxos[utxo]['locktime'], utxos[utxo]['value'], utxos[utxo]['height'], True)
TypeError: calcInterest() takes 3 positional arguments but 4 were given

Seems fourth function param (inSats) missing from calcInterest() function, but given in https://github.com/pbca26/electrum-komodo/blob/patch-1/lib/wallet.py#L699

smk762 commented 4 years ago

also same issue in https://github.com/pbca26/electrum-komodo/blob/patch-1/lib/coinchooser.py#L242 and https://github.com/pbca26/electrum-komodo/blob/patch-1/lib/coinchooser.py#L245

pbca26 commented 4 years ago

thanks @smk762 the issue is indeed due to wrong number of function params

smk762 commented 4 years ago

I still have problems doing partial send using nano on https://github.com/pbca26/electrum-komodo/commit/85db0645217f0bf85ce8e957ec556e48e9941aaf and https://github.com/KomodoPlatform/electrum-komodo/commit/dac4b4fe92872917452c210e5d74ccc732330efa
max send works though on nano with https://github.com/KomodoPlatform/electrum-komodo/commit/dac4b4fe92872917452c210e5d74ccc732330efa

tonymorony commented 4 years ago

Can confirm that if not send max. to self it's failing with such trace (however if send whole balance to self it works fine, so maybe clue is in vouts amount) :

Exception: Exception : Invalid status 6d00
Traceback (most recent call last):
  File "/home/tony/test-patch/electrum-komodo/plugins/ledger/ledger.py", line 433, in sign_transaction
    outputData = self.get_client().finalizeInput(b'', 0, 0, changePath, bfh(rawTx))
  File "/home/tony/test-patch/electrum-komodo/plugins/ledger/btchip_zcash.py", line 199, in finalizeInput
    response = self.dongle.exchange(bytearray(apdu))
  File "/home/tony/.local/lib/python3.7/site-packages/btchip/btchipComm.py", line 127, in exchange
    raise BTChipException("Invalid status %04x" % sw, sw)
btchip.btchipException.BTChipException: Exception : Invalid status 6d00
Traceback (most recent call last):
  File "/home/tony/test-patch/electrum-komodo/plugins/ledger/ledger.py", line 433, in sign_transaction
    outputData = self.get_client().finalizeInput(b'', 0, 0, changePath, bfh(rawTx))
  File "/home/tony/test-patch/electrum-komodo/plugins/ledger/btchip_zcash.py", line 199, in finalizeInput
    response = self.dongle.exchange(bytearray(apdu))
  File "/home/tony/.local/lib/python3.7/site-packages/btchip/btchipComm.py", line 127, in exchange
    raise BTChipException("Invalid status %04x" % sw, sw)
btchip.btchipException.BTChipException: Exception : Invalid status 6d00

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/tony/test-patch/electrum-komodo/gui/qt/util.py", line 648, in run
    result = task.task()
  File "/home/tony/test-patch/electrum-komodo/lib/wallet.py", line 1452, in sign_transaction
    k.sign_transaction(tx, password)
  File "/home/tony/test-patch/electrum-komodo/plugins/ledger/ledger.py", line 252, in wrapper
    return func(self, *args, **kwargs)
  File "/home/tony/test-patch/electrum-komodo/plugins/ledger/ledger.py", line 501, in sign_transaction
    self.give_error(e, True)
  File "/home/tony/test-patch/electrum-komodo/plugins/ledger/ledger.py", line 245, in give_error
    raise Exception(message)
Exception: Exception : Invalid status 6d00

Not sure if it helpful but if you try to send transaction when Ledger is in sleeping mode (and require pin input to wake up) it failing with same Exception: Exception : Invalid status 6d00