Skip to content

Commit

Permalink
Fix beempy walletinfo and sign
Browse files Browse the repository at this point in the history
  • Loading branch information
holgern committed Jan 4, 2019
1 parent 915107d commit 577ec41
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 8 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
Changelog
=========
0.20.16
-------
* Fix beempy walletinfo and sign

0.20.15
-------
* Improve file reading for beempy sign and broadcast
* add option to write file for beempy sign
* Disable not working nodes
* add missing prefix to comment_options op (by crokkon)
* fix beempy verify --use-api (by crokkon)
* Update installation.rst (by Nick Foster)

0.20.14
-------
* unit tests fixed
Expand Down
4 changes: 3 additions & 1 deletion beem/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,8 @@ def walletinfo(test_unlock):
""" Show info about wallet
"""
stm = shared_steem_instance()
if stm.rpc is not None:
stm.rpc.rpcconnect()
t = PrettyTable(["Key", "Value"])
t.align = "l"
t.add_row(["created", stm.wallet.created()])
Expand Down Expand Up @@ -1690,7 +1692,7 @@ def sign(file, outfile):
else:
tx = click.get_text_stream('stdin')
tx = ast.literal_eval(tx)
tx = stm.sign(tx)
tx = stm.sign(tx, reconstruct_tx=False)
tx = json.dumps(tx, indent=4)
if outfile and outfile != "-":
with open(outfile, 'w') as fp:
Expand Down
8 changes: 6 additions & 2 deletions beem/steem.py
Original file line number Diff line number Diff line change
Expand Up @@ -950,22 +950,26 @@ def finalizeOp(self, ops, account, permission, **kwargs):
self.txbuffer.sign()
return self.txbuffer.broadcast()

def sign(self, tx=None, wifs=[]):
def sign(self, tx=None, wifs=[], reconstruct_tx=True):
""" Sign a provided transaction with the provided key(s)
:param dict tx: The transaction to be signed and returned
:param string wifs: One or many wif keys to use for signing
a transaction. If not present, the keys will be loaded
from the wallet as defined in "missing_signatures" key
of the transactions.
:param bool reconstruct_tx: when set to False and tx
is already contructed, it will not reconstructed
and already added signatures remain
"""
if tx:
txbuffer = TransactionBuilder(tx, steem_instance=self)
else:
txbuffer = self.txbuffer
txbuffer.appendWif(wifs)
txbuffer.appendMissingSignatures()
txbuffer.sign()
txbuffer.sign(reconstruct_tx=reconstruct_tx)
return txbuffer.json()

def broadcast(self, tx=None):
Expand Down
2 changes: 1 addition & 1 deletion beem/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""THIS FILE IS GENERATED FROM beem SETUP.PY."""
version = '0.20.15'
version = '0.20.16'
2 changes: 1 addition & 1 deletion beemapi/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""THIS FILE IS GENERATED FROM beem SETUP.PY."""
version = '0.20.15'
version = '0.20.16'
2 changes: 1 addition & 1 deletion beembase/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""THIS FILE IS GENERATED FROM beem SETUP.PY."""
version = '0.20.15'
version = '0.20.16'
2 changes: 1 addition & 1 deletion beemgraphenebase/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""THIS FILE IS GENERATED FROM beem SETUP.PY."""
version = '0.20.15'
version = '0.20.16'
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
ascii = codecs.lookup('ascii')
codecs.register(lambda name, enc=ascii: {True: enc}.get(name == 'mbcs'))

VERSION = '0.20.15'
VERSION = '0.20.16'

tests_require = ['mock >= 2.0.0', 'pytest', 'pytest-mock', 'parameterized']

Expand Down

0 comments on commit 577ec41

Please sign in to comment.