Skip to content
Snippets Groups Projects
Commit 9f7b220c authored by Fabian Schuh's avatar Fabian Schuh
Browse files

[transactionbuilder] renamed

parent e3bbd244
No related branches found
No related tags found
No related merge requests found
...@@ -18,7 +18,7 @@ from .exceptions import ( ...@@ -18,7 +18,7 @@ from .exceptions import (
MissingKeyError, MissingKeyError,
) )
from .wallet import Wallet from .wallet import Wallet
from .transaction import Transaction from .transactionbuilder import TransactionBuilder
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
...@@ -148,7 +148,7 @@ class BitShares(object): ...@@ -148,7 +148,7 @@ class BitShares(object):
self.wallet.newWallet() self.wallet.newWallet()
def finalizeOp(self, op, account, permission): def finalizeOp(self, op, account, permission):
tx = Transaction() tx = TransactionBuilder()
tx.appendOps(op) tx.appendOps(op)
tx.appendSigner(account, permission) tx.appendSigner(account, permission)
tx.constructTx() tx.constructTx()
......
...@@ -12,8 +12,9 @@ import logging ...@@ -12,8 +12,9 @@ import logging
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
class Transaction(dict): class TransactionBuilder(dict):
def __init__(self, bitshares_instance=None):
def __init__(self, tx=None, bitshares_instance=None):
if not bitshares_instance: if not bitshares_instance:
bitshares_instance = bts.BitShares() bitshares_instance = bts.BitShares()
self.bitshares = bitshares_instance self.bitshares = bitshares_instance
...@@ -22,7 +23,7 @@ class Transaction(dict): ...@@ -22,7 +23,7 @@ class Transaction(dict):
self.wifs = [] self.wifs = []
if not isinstance(tx, dict): if not isinstance(tx, dict):
raise ValueError("Invalid Transaction Format") raise ValueError("Invalid Transaction Format")
super(Transaction, self).__init__(tx) super(TransactionBuilder, self).__init__(tx)
def appendOps(self, ops): def appendOps(self, ops):
if isinstance(ops, list): if isinstance(ops, list):
...@@ -59,7 +60,7 @@ class Transaction(dict): ...@@ -59,7 +60,7 @@ class Transaction(dict):
expiration=expiration, expiration=expiration,
operations=ops operations=ops
) )
super(Transaction, self).__init__(tx.json()) super(TransactionBuilder, self).__init__(tx.json())
def sign(self): def sign(self):
""" Sign a provided transaction witht he provided key(s) """ Sign a provided transaction witht he provided key(s)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment