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

Fixing a bug in transactions

parent 2617284d
No related branches found
No related tags found
No related merge requests found
...@@ -10,6 +10,7 @@ from ucoinpy.documents.transaction import InputSource, OutputSource, Transaction ...@@ -10,6 +10,7 @@ from ucoinpy.documents.transaction import InputSource, OutputSource, Transaction
from ucoinpy.key import SigningKey from ucoinpy.key import SigningKey
from ..tools.exceptions import NotEnoughMoneyError from ..tools.exceptions import NotEnoughMoneyError
import logging import logging
import base64
class Wallet(object): class Wallet(object):
...@@ -100,7 +101,6 @@ class Wallet(object): ...@@ -100,7 +101,6 @@ class Wallet(object):
def send_money(self, salt, password, community, def send_money(self, salt, password, community,
recipient, amount, message): recipient, amount, message):
inputs = self.tx_inputs(int(amount), community) inputs = self.tx_inputs(int(amount), community)
logging.debug("Inputs : {0}".format(inputs)) logging.debug("Inputs : {0}".format(inputs))
outputs = self.tx_outputs(recipient, amount, inputs) outputs = self.tx_outputs(recipient, amount, inputs)
...@@ -117,9 +117,9 @@ class Wallet(object): ...@@ -117,9 +117,9 @@ class Wallet(object):
key = SigningKey("{0}{1}".format(salt, self.walletid), password) key = SigningKey("{0}{1}".format(salt, self.walletid), password)
logging.debug("Sender pubkey:{0}".format(key.pubkey)) logging.debug("Sender pubkey:{0}".format(key.pubkey))
signing = key.signature(bytes(tx.raw(), 'ascii')) signing = base64.b64encode(key.signature(bytes(tx.raw(), 'ascii')))
logging.debug("Signature : {0}".format(str(signing.signature))) logging.debug("Signature : {0}".format(signing.decode("ascii")))
tx.signatures = [str(signing.signature, 'ascii')] tx.signatures = [signing.decode("ascii")]
logging.debug("Transaction : {0}".format(tx.signed_raw())) logging.debug("Transaction : {0}".format(tx.signed_raw()))
community.post(bma.tx.Process, community.post(bma.tx.Process,
post_args={'transaction': tx.signed_raw()}) post_args={'transaction': tx.signed_raw()})
......
...@@ -38,6 +38,8 @@ class TransferMoneyDialog(QDialog, Ui_TransferMoneyDialog): ...@@ -38,6 +38,8 @@ class TransferMoneyDialog(QDialog, Ui_TransferMoneyDialog):
for contact in sender.contacts: for contact in sender.contacts:
self.combo_contact.addItem(contact.name) self.combo_contact.addItem(contact.name)
self.edit_message.setEnabled(False)
def accept(self): def accept(self):
message = self.edit_message.text() message = self.edit_message.text()
......
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