fix karma test. rm unused code

This commit is contained in:
Matias Alejo Garcia 2014-11-12 21:59:58 -03:00
commit 376ee5359b
4 changed files with 15 additions and 57 deletions

View file

@ -275,45 +275,6 @@ Identity.prototype.close = function(cb) {
}, cb);
};
/**
* @desc Imports a wallet from an encrypted string
* @param {string} cypherText - the encrypted object
* @param {string} passphrase - passphrase to decrypt it
* @param {string[]} opts.skipFields - fields to ignore when importing
* @param {string[]} opts.salt -
* @param {string[]} opts.iterations -
* @param {string[]} opts.importFunction - for stubbing
* @return {Wallet}
*/
// This is not used in favor of Compatibility. importEncryptedWallet
// Identity.prototype.importEncryptedWallet = function(cypherText, password, opts, cb) {
// var crypto = opts.cryptoUtil || cryptoUtil;
// var obj = crypto.decrypt(password, cypherText);
// console.log('[Identity.js.290:obj:]',obj); //TODO
//
// if (!obj) {
// // 0.7.3 broken KDF
// log.debug('Trying legacy encryption...');
// console.log('[Identity.js.296:password:]',password); //TODO
// var passphrase = crypto.kdf(password, 'mjuBtGybi/4=', 100);
// console.log('[Identity.js.296:passphrase:]',passphrase); //TODO
// obj = crypto.decrypt(passphrase, ejson);
// console.log('[Identity.js.297:obj:]',obj); //TODO
// }
// console.log('[Identity.js.300:obj:]',obj); //TOD
//
// if (!obj)
// return cb(new Error('Could not decrypt'));
// try {
// obj = JSON.parse(obj);
// } catch (e) {
// return cb(new Error('Could not decrypt'));
// }
// return this.importWalletFromObj(obj, opts, cb)
// };
//
Identity.prototype.importWalletFromObj = function(obj, opts, cb) {
var self = this;
preconditions.checkArgument(cb);

View file

@ -266,8 +266,8 @@ angular.module('copayApp.services')
r.totalBalance = balanceSat * satToUnit;
r.totalBalanceBTC = (balanceSat / COIN);
r.availableBalance = safeBalanceSat * satToUnit;
r.safeUnspentCount = safeUnspentCount;
r.availableBalanceBTC = (safeBalanceSat / COIN);
r.safeUnspentCount = safeUnspentCount;
r.lockedBalance = (balanceSat - safeBalanceSat) * satToUnit;
r.lockedBalanceBTC = (balanceSat - safeBalanceSat) / COIN;
@ -309,6 +309,7 @@ angular.module('copayApp.services')
};
root.updateBalance = function(w, cb, refreshAll) {
w = w || $rootScope.wallet;
if (!w) return root.onErrorDigest();
if (!w.isReady()) return;