Skip to content
Snippets Groups Projects
Commit cd0772f8 authored by inso's avatar inso
Browse files

Compatibility with duniterpy 0.30

parent 2d5e95dd
No related branches found
No related tags found
No related merge requests found
...@@ -206,7 +206,7 @@ class Wallet(QObject): ...@@ -206,7 +206,7 @@ class Wallet(QObject):
""" """
inputs = [] inputs = []
for s in sources: for s in sources:
inputs.append(InputSource(s['type'], s['identifier'], s['noffset'])) inputs.append(InputSource(None, None, s['type'], s['identifier'], s['noffset']))
return inputs return inputs
def tx_unlocks(self, sources): def tx_unlocks(self, sources):
...@@ -248,10 +248,11 @@ class Wallet(QObject): ...@@ -248,10 +248,11 @@ class Wallet(QObject):
outputs.append(OutputSource(overhead, overhead_base, output.Condition.token(output.SIG.token(self.pubkey)))) outputs.append(OutputSource(overhead, overhead_base, output.Condition.token(output.SIG.token(self.pubkey))))
return outputs return outputs
def prepare_tx(self, pubkey, amount, message, community): def prepare_tx(self, pubkey, blockstamp, amount, message, community):
""" """
Prepare a simple Transaction document Prepare a simple Transaction document
:param str pubkey: the target of the transaction :param str pubkey: the target of the transaction
:param duniterpy.documents.BlockUID blockstamp: the blockstamp
:param int amount: the amount sent to the receiver :param int amount: the amount sent to the receiver
:param Community community: the target community :param Community community: the target community
:return: the transaction document :return: the transaction document
...@@ -266,7 +267,7 @@ class Wallet(QObject): ...@@ -266,7 +267,7 @@ class Wallet(QObject):
unlocks = self.tx_unlocks(sources) unlocks = self.tx_unlocks(sources)
outputs = self.tx_outputs(pubkey, amount, sources) outputs = self.tx_outputs(pubkey, amount, sources)
logging.debug("Outputs : {0}".format(outputs)) logging.debug("Outputs : {0}".format(outputs))
tx = Transaction(PROTOCOL_VERSION, community.currency, 0, tx = Transaction(PROTOCOL_VERSION, community.currency, blockstamp, 0,
[self.pubkey], inputs, unlocks, [self.pubkey], inputs, unlocks,
outputs, message, None) outputs, message, None)
return tx return tx
...@@ -324,7 +325,7 @@ class Wallet(QObject): ...@@ -324,7 +325,7 @@ class Wallet(QObject):
transfer = Transfer.initiate(metadata) transfer = Transfer.initiate(metadata)
self.caches[community.currency]._transfers.append(transfer) self.caches[community.currency]._transfers.append(transfer)
try: try:
tx = self.prepare_tx(recipient, amount, message, community) tx = self.prepare_tx(recipient, blockUID, amount, message, community)
logging.debug("TX : {0}".format(tx.raw())) logging.debug("TX : {0}".format(tx.raw()))
tx.sign([key]) tx.sign([key])
......
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