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

Add missing changes to transactionbuilder

Add parameter for enabling usage of condenser_api  for broadcasting
Add ref_block_num and ref_block_prefix to constructTx for offline signing
parent e61c802c
No related branches found
No related tags found
No related merge requests found
...@@ -54,6 +54,7 @@ class TransactionBuilder(dict): ...@@ -54,6 +54,7 @@ class TransactionBuilder(dict):
def __init__( def __init__(
self, self,
tx={}, tx={},
use_condenser_api=True,
steem_instance=None, steem_instance=None,
**kwargs **kwargs
): ):
...@@ -66,7 +67,7 @@ class TransactionBuilder(dict): ...@@ -66,7 +67,7 @@ class TransactionBuilder(dict):
self._require_reconstruction = False self._require_reconstruction = False
else: else:
self._require_reconstruction = True self._require_reconstruction = True
self._use_condenser_api = True self._use_condenser_api = use_condenser_api
self.set_expiration(kwargs.get("expiration", self.steem.expiration)) self.set_expiration(kwargs.get("expiration", self.steem.expiration))
def set_expiration(self, p): def set_expiration(self, p):
...@@ -230,7 +231,7 @@ class TransactionBuilder(dict): ...@@ -230,7 +231,7 @@ class TransactionBuilder(dict):
"""Clear all stored wifs""" """Clear all stored wifs"""
self.wifs = set() self.wifs = set()
def constructTx(self): def constructTx(self, ref_block_num=None, ref_block_prefix=None):
""" Construct the actual transaction and store it in the class's dict """ Construct the actual transaction and store it in the class's dict
store store
...@@ -250,8 +251,9 @@ class TransactionBuilder(dict): ...@@ -250,8 +251,9 @@ class TransactionBuilder(dict):
expiration = formatTimeFromNow( expiration = formatTimeFromNow(
self.expiration or self.steem.expiration self.expiration or self.steem.expiration
) )
ref_block_num, ref_block_prefix = transactions.getBlockParams( if ref_block_num is None or ref_block_prefix is None:
self.steem.rpc) ref_block_num, ref_block_prefix = transactions.getBlockParams(
self.steem.rpc)
self.tx = Signed_Transaction( self.tx = Signed_Transaction(
ref_block_prefix=ref_block_prefix, ref_block_prefix=ref_block_prefix,
expiration=expiration, expiration=expiration,
......
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