Author

Topic: Electrum dumpprivkeys() fails with TypeError and parameter count confusion (Read 439 times)

newbie
Activity: 1
Merit: 0
I have the same problem with the python console. I am unable to run any of the functioins by passing an argument.
I always get the same error.

For instance if i wirte:
>> version()
´2.9.2´

This works fine, but, if I want to pass an argument to the function
i.e. to get help of the function...
>> version(`-h´)
TypeError: version() takes exactly 1 argument (2give)

in Linux, I just can pass the argument and it works fine
$ version -h
'2.9.2'

but I do not know how to di it with the python console
newbie
Activity: 2
Merit: 0
I see on GitHub that dumpprivkeys() is deprecated.  Use getprivatekeys() instead.  I succeeded with that.

I tried to delete my earlier post but don't have the permissions.
newbie
Activity: 2
Merit: 0
I always get this error in Electrum's python console on both my Ubuntu and Windows machines.  Here it is:

>> dumpprivkeys(map(lambda x:x.get('address'), listunspent()))
Traceback (most recent call last):
  File "C:\Users\User\AppData\Local\Temp\_MEI70962\gui\qt\main_window.py", line 1675, in
    return lambda *args: apply( f, (method, args, self.password_dialog ))
  File "C:\Users\User\AppData\Local\Temp\_MEI70962\lib\commands.py", line 105, in _run
    result = f(*args)
  File "C:\Users\User\AppData\Local\Temp\_MEI70962\lib\commands.py", line 83, in func_wrapper
    return func(*args, **kwargs)
TypeError: dumpprivkeys() takes exactly 1 argument (2 given)

I am using dumpprivkeys() exactly as specified in the documentation at https://electrum.readthedocs.io/en/latest/console.html.

Does anyone know what is going wrong here?

Here is supporting info:

>> print(sys.version)
2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:42:59) [MSC v.1500 32 bit (Intel)]

The problem is not the map() or listunspent() functions, it is dumpprivkeys():

>> dumpprivkeys(["17N9XSNwqzdYVug59LbPM5GfbPT5eJ24CB"])
Traceback (most recent call last):
  File "C:\Users\User\AppData\Local\Temp\_MEI70962\gui\qt\main_window.py", line 1675, in
    return lambda *args: apply( f, (method, args, self.password_dialog ))
  File "C:\Users\User\AppData\Local\Temp\_MEI70962\lib\commands.py", line 105, in _run
    result = f(*args)
  File "C:\Users\User\AppData\Local\Temp\_MEI70962\lib\commands.py", line 83, in func_wrapper
    return func(*args, **kwargs)
TypeError: dumpprivkeys() takes exactly 1 argument (2 given)
>>

where:

>> listunspent()
[
    {
        "address": "17N9XSNwqzdYVug59LbPM5GfbPT5eJ24CB",
...redacted...
    }
]
Jump to: