From 4092f0cb9de29a437abe1ca529456674cadbbf49 Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Mon, 21 Apr 2014 20:28:57 -0300 Subject: [PATCH] works sometimes --- js/controllers/transactions.js | 13 +++--- js/models/core/PrivateKey.js | 2 + js/models/core/PublicKeyRing.js | 1 + js/models/core/Wallet.js | 7 ++-- js/services/controllerUtils.js | 2 +- test/test.TxProposals.js | 70 +++++++++++++++++++++++++++++---- 6 files changed, 78 insertions(+), 17 deletions(-) diff --git a/js/controllers/transactions.js b/js/controllers/transactions.js index d4356a62a..6f29bdd40 100644 --- a/js/controllers/transactions.js +++ b/js/controllers/transactions.js @@ -51,17 +51,20 @@ console.log('[transactions.js.68:txid:] SENTTX CALLBACK',txid); //TODO $scope.sign = function (ntxid) { var w = $rootScope.wallet; var ret = w.sign(ntxid); - _updateTxs(); + if (!ret) { + $rootScope.flashMessage = {type:'error', message: 'There was an error signing the Transaction'}; + _updateTxs(); + $rootScope.$digest(); + return; + } var p = w.getTxProposal(ntxid); if (p.txp.builder.isFullySigned()) { $scope.send(ntxid); + _updateTxs(); + $rootScope.$digest(); } else { - $rootScope.flashMessage = ret - ? {type:'success', message: 'Transactions signed'} - : {type:'error', message: 'There was an error signing the Transaction'} - ; _updateTxs(); $rootScope.$digest(); } diff --git a/js/models/core/PrivateKey.js b/js/models/core/PrivateKey.js index 2002a14b6..5e7ab06cf 100644 --- a/js/models/core/PrivateKey.js +++ b/js/models/core/PrivateKey.js @@ -71,6 +71,8 @@ PrivateKey.prototype.get = function(index,isChange) { PrivateKey.prototype.getAll = function(addressIndex, changeAddressIndex) { var ret = []; +console.log('[PrivateKey.js.75:addressIndex:]',addressIndex); //TODO +console.log('[PrivateKey.js.79:changeAddressIndex:]',changeAddressIndex); //TODO for(var i=0;i