From 328e4e74f81bbcf3b45abfd1904b491caec58bfd Mon Sep 17 00:00:00 2001 From: Inso <insomniak.fr@gmail.com> Date: Wed, 24 Dec 2014 10:10:48 +0000 Subject: [PATCH] Some fixes in transactions --- src/cutecoin/core/wallet.py | 7 ++++--- src/cutecoin/gui/mainwindow.py | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/cutecoin/core/wallet.py b/src/cutecoin/core/wallet.py index 0254e61b..289ad548 100644 --- a/src/cutecoin/core/wallet.py +++ b/src/cutecoin/core/wallet.py @@ -10,6 +10,7 @@ from ucoinpy.documents.transaction import InputSource, OutputSource, Transaction from ucoinpy.key import SigningKey from ..tools.exceptions import NotEnoughMoneyError import logging +import base64 class Wallet(object): @@ -117,9 +118,9 @@ class Wallet(object): key = SigningKey("{0}{1}".format(salt, self.walletid), password) logging.debug("Sender pubkey:{0}".format(key.pubkey)) - signing = key.signature(bytes(tx.raw(), 'ascii')) - logging.debug("Signature : {0}".format(str(signing.signature))) - tx.signatures = [str(signing.signature, 'ascii')] + signing = base64.b64encode(key.signature(bytes(tx.raw(), 'ascii'))) + logging.debug("Signature : {0}".format(signing.decode("ascii"))) + tx.signatures = [signing.decode("ascii")] logging.debug("Transaction : {0}".format(tx.signed_raw())) community.post(bma.tx.Process, post_args={'transaction': tx.signed_raw()}) diff --git a/src/cutecoin/gui/mainwindow.py b/src/cutecoin/gui/mainwindow.py index a583b69b..46ba336e 100644 --- a/src/cutecoin/gui/mainwindow.py +++ b/src/cutecoin/gui/mainwindow.py @@ -53,6 +53,10 @@ class MainWindow(QMainWindow, Ui_MainWindow): dialog.accepted.connect(self.refresh_wallets) dialog.exec_() + def refresh_wallets(self): + currency_tab = self.currencies_tabwidget.currentWidget() + currency_tab.refresh_wallets() + ''' Refresh main window When the selected account changes, all the widgets -- GitLab