Skip to content
Snippets Groups Projects
Commit 915107d6 authored by Holger's avatar Holger
Browse files

Disable not working nodes and improve beempy sign and broadcast

* Improve file reading for beempy sign and broadcast
* add option to write file for beempy sign
parent a34baffc
No related branches found
No related tags found
No related merge requests found
...@@ -1670,23 +1670,33 @@ def disapprovewitness(witness, account): ...@@ -1670,23 +1670,33 @@ def disapprovewitness(witness, account):
@cli.command() @cli.command()
@click.option('--file', help='Load transaction from file. If "-", read from stdin (defaults to "-")') @click.option('--file', '-i', help='Load transaction from file. If "-", read from stdin (defaults to "-")')
def sign(file): @click.option('--outfile', '-o', help='Load transaction from file. If "-", read from stdin (defaults to "-")')
def sign(file, outfile):
"""Sign a provided transaction with available and required keys""" """Sign a provided transaction with available and required keys"""
stm = shared_steem_instance() stm = shared_steem_instance()
if stm.rpc is not None: if stm.rpc is not None:
stm.rpc.rpcconnect() stm.rpc.rpcconnect()
if not unlock_wallet(stm):
return
if file and file != "-": if file and file != "-":
if not os.path.isfile(file): if not os.path.isfile(file):
raise Exception("File %s does not exist!" % file) raise Exception("File %s does not exist!" % file)
with open(file) as fp: with open(file) as fp:
tx = fp.read() tx = fp.read()
if tx.find('\0') > 0:
with open(file, encoding='utf-16') as fp:
tx = fp.read()
else: else:
tx = click.get_text_stream('stdin') tx = click.get_text_stream('stdin')
tx = ast.literal_eval(tx) tx = ast.literal_eval(tx)
tx = stm.sign(tx) tx = stm.sign(tx)
tx = json.dumps(tx, indent=4) tx = json.dumps(tx, indent=4)
print(tx) if outfile and outfile != "-":
with open(outfile, 'w') as fp:
fp.write(tx)
else:
print(tx)
@cli.command() @cli.command()
...@@ -1701,6 +1711,9 @@ def broadcast(file): ...@@ -1701,6 +1711,9 @@ def broadcast(file):
raise Exception("File %s does not exist!" % file) raise Exception("File %s does not exist!" % file)
with open(file) as fp: with open(file) as fp:
tx = fp.read() tx = fp.read()
if tx.find('\0') > 0:
with open(file, encoding='utf-16') as fp:
tx = fp.read()
else: else:
tx = click.get_text_stream('stdin') tx = click.get_text_stream('stdin')
tx = ast.literal_eval(tx) tx = ast.literal_eval(tx)
......
...@@ -122,7 +122,7 @@ class NodeList(list): ...@@ -122,7 +122,7 @@ class NodeList(list):
"version": "0.20.2", "version": "0.20.2",
"type": "appbase", "type": "appbase",
"owner": "themarkymark", "owner": "themarkymark",
"score": 20 "score": -20
}, },
{ {
"url": "wss://gtg.steem.house:8090", "url": "wss://gtg.steem.house:8090",
...@@ -213,7 +213,7 @@ class NodeList(list): ...@@ -213,7 +213,7 @@ class NodeList(list):
"version": "0.20.6", "version": "0.20.6",
"type": "appbase", "type": "appbase",
"owner": "anyx", "owner": "anyx",
"score": 50 "score": -10
}, },
{ {
"url": "https://anyx.io", "url": "https://anyx.io",
...@@ -227,14 +227,14 @@ class NodeList(list): ...@@ -227,14 +227,14 @@ class NodeList(list):
"version": "0.20.2", "version": "0.20.2",
"type": "appbase", "type": "appbase",
"owner": "curie", "owner": "curie",
"score": -10 "score": 50
}, },
{ {
"url": "wss://rpc.curiesteem.com", "url": "wss://rpc.curiesteem.com",
"version": "0.20.2", "version": "0.20.2",
"type": "appbase", "type": "appbase",
"owner": "curie", "owner": "curie",
"score": 50 "score": -10
}, },
{ {
"url": "wss://testnet.steem.vc", "url": "wss://testnet.steem.vc",
......
"""THIS FILE IS GENERATED FROM beem SETUP.PY.""" """THIS FILE IS GENERATED FROM beem SETUP.PY."""
version = '0.20.14' version = '0.20.15'
"""THIS FILE IS GENERATED FROM beem SETUP.PY.""" """THIS FILE IS GENERATED FROM beem SETUP.PY."""
version = '0.20.14' version = '0.20.15'
"""THIS FILE IS GENERATED FROM beem SETUP.PY.""" """THIS FILE IS GENERATED FROM beem SETUP.PY."""
version = '0.20.14' version = '0.20.15'
"""THIS FILE IS GENERATED FROM beem SETUP.PY.""" """THIS FILE IS GENERATED FROM beem SETUP.PY."""
version = '0.20.14' version = '0.20.15'
...@@ -16,7 +16,7 @@ except LookupError: ...@@ -16,7 +16,7 @@ except LookupError:
ascii = codecs.lookup('ascii') ascii = codecs.lookup('ascii')
codecs.register(lambda name, enc=ascii: {True: enc}.get(name == 'mbcs')) codecs.register(lambda name, enc=ascii: {True: enc}.get(name == 'mbcs'))
VERSION = '0.20.14' VERSION = '0.20.15'
tests_require = ['mock >= 2.0.0', 'pytest', 'pytest-mock', 'parameterized'] tests_require = ['mock >= 2.0.0', 'pytest', 'pytest-mock', 'parameterized']
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment