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

Add custom chains function to signed transactions

parent d6ef31aa
No related branches found
No related tags found
No related merge requests found
...@@ -291,7 +291,8 @@ class TransactionBuilder(dict): ...@@ -291,7 +291,8 @@ class TransactionBuilder(dict):
operations.default_prefix = self["blockchain"]["prefix"] operations.default_prefix = self["blockchain"]["prefix"]
try: try:
signedtx = Signed_Transaction(**self.json().update(custom_chains=self.steem.custom_chains)) signedtx = Signed_Transaction(**self.json())
signedtx.add_custom_chains(self.steem.custom_chains)
except: except:
raise ValueError("Invalid TransactionBuilder Format") raise ValueError("Invalid TransactionBuilder Format")
......
...@@ -29,6 +29,12 @@ class Signed_Transaction(GrapheneSigned_Transaction): ...@@ -29,6 +29,12 @@ class Signed_Transaction(GrapheneSigned_Transaction):
self.known_chains[c] = custom_chain[c] self.known_chains[c] = custom_chain[c]
super(Signed_Transaction, self).__init__(*args, **kwargs) super(Signed_Transaction, self).__init__(*args, **kwargs)
def add_custom_chains(self, custom_chain):
if len(custom_chain) > 0:
for c in custom_chain:
if c not in self.known_chains:
self.known_chains[c] = custom_chain[c]
def sign(self, wifkeys, chain=u"STEEM"): def sign(self, wifkeys, chain=u"STEEM"):
return super(Signed_Transaction, self).sign(wifkeys, chain) return super(Signed_Transaction, self).sign(wifkeys, chain)
......
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