Electron-cash: CLI commands encrypt and decrypt not working

Created on 7 Apr 2019  路  6Comments  路  Source: Electron-Cash/Electron-Cash

I tried to use command line
electron-cash -w wallet_file decrypt $pk $message
But I get errors from command:

Traceback (most recent call last):
File "/usr/bin/electron-cash", line 424, in
result = server.run_cmdline(config_options)
File "/usr/lib/python3.7/site-packages/jsonrpclib/jsonrpc.py", line 748, in __call__
return self.__send(self.__name, args)
File "/usr/lib/python3.7/site-packages/jsonrpclib/jsonrpc.py", line 629, in _request
response = self._run_request(request)
File "/usr/lib/python3.7/site-packages/jsonrpclib/jsonrpc.py", line 662, in _run_request
verbose=self.__verbose
File "/usr/lib/python3.7/xmlrpc/client.py", line 1154, in request
return self.single_request(host, handler, request_body, verbose)
File "/usr/lib/python3.7/site-packages/jsonrpclib/jsonrpc.py", line 391, in single_request
response.msg)
jsonrpclib.jsonrpc.ProtocolError: ('user:[email protected]:46227/', 500, 'Internal Server

and from daemon:

Traceback (most recent call last):
File "/usr/lib/python3.7/site-packages/jsonrpclib/SimpleJSONRPCServer.py", line 460, in do_POST
data, getattr(self, '_dispatch', None), self.path)
File "/usr/lib/python3.7/site-packages/jsonrpclib/SimpleJSONRPCServer.py", line 280, in _marshaled_dispatch
return jsonrpclib.jdumps(response, self.encoding)
File "/usr/lib/python3.7/site-packages/jsonrpclib/jsonrpc.py", line 164, in jdumps
return json.dumps(obj)
File "/usr/lib/python3.7/json/__init__.py", line 231, in dumps
return _default_encoder.encode(obj)
File "/usr/lib/python3.7/json/encoder.py", line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib/python3.7/json/encoder.py", line 257, in iterencode
return _iterencode(o, 0)
File "/usr/lib/python3.7/json/encoder.py", line 179, in default
raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type bytes is not JSON serializable

though it works in electrum.

Imaginary_username said no other commands are affected, only encrypt and decrypt.

Command Line bug

All 6 comments

Yep. Definitely a bug. Fixing now.

Electrum has the same bug, FWIW.

Not sure what the best fix is -- working on it.

Ok, just fixed in latest commit. You can run off github, right?

Sure, but I'm not near my pc right now, I'll be there in few hours :/
Thanks for the fix, I'll test it when I'll be back home.

Works like charm :)

W00t w00t :)

Was this page helpful?
0 / 5 - 0 ratings