From 5f24d42e10dfd7f7ac3114e5d24f704648492472 Mon Sep 17 00:00:00 2001 From: Vladimir Kamarzin Date: Tue, 12 Jun 2018 08:29:30 +0500 Subject: [PATCH 1/2] Unlimited reconnects to node by default --- golos/steem.py | 3 +++ golosbase/ws_client.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/golos/steem.py b/golos/steem.py index 2490c18..d3c6ddd 100644 --- a/golos/steem.py +++ b/golos/steem.py @@ -18,6 +18,9 @@ class Steem: no_broadcast (bool): If set to ``True``, committal actions like sending funds will have no effect (simulation only). + num_retries (int): Limit connection attempts to the node. Defaults to -1 + (unlimited). + Optional Arguments (kwargs): Args: diff --git a/golosbase/ws_client.py b/golosbase/ws_client.py index 97b703c..4f711ac 100644 --- a/golosbase/ws_client.py +++ b/golosbase/ws_client.py @@ -44,7 +44,7 @@ def __init__(self, nodes: list, **kwargs): self.return_with_args = kwargs.get('return_with_args', False) - self.num_retries = kwargs.get("num_retries", 20) + self.num_retries = kwargs.get("num_retries", -1) self.nodes = cycle(nodes) self.url = '' self.ws = None From e97f79b6e44dfa4cbf67103434695d60463ef5ae Mon Sep 17 00:00:00 2001 From: Vladimir Kamarzin Date: Wed, 13 Jun 2018 12:03:41 +0500 Subject: [PATCH 2/2] Restore verify_authority() in transactionbuilder --- golos/transactionbuilder.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/golos/transactionbuilder.py b/golos/transactionbuilder.py index 77a0562..8099731 100644 --- a/golos/transactionbuilder.py +++ b/golos/transactionbuilder.py @@ -121,6 +121,15 @@ def sign(self): signedtx.sign(self.wifs, chain=self.steemd.chain_params) self["signatures"].extend(signedtx.json().get("signatures")) + def verify_authority(self): + """ Verify the authority of the signed transaction + """ + try: + if not self.steemd.verify_authority(self.json()): + raise InsufficientAuthorityError + except Exception as e: + raise e + def broadcast(self): """ Broadcast a transaction to the Steem network