From be7e630e86de48fa3595e2427432a360f450d334 Mon Sep 17 00:00:00 2001 From: plondon Date: Mon, 23 Apr 2018 09:24:14 -0400 Subject: [PATCH] fix(Balance): test --- assets/js/controllers/wallet.controller.js | 2 -- assets/js/services/wallet.service.js | 2 +- tests/services/wallet_service_spec.js | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/assets/js/controllers/wallet.controller.js b/assets/js/controllers/wallet.controller.js index d18e19f791..492787d843 100644 --- a/assets/js/controllers/wallet.controller.js +++ b/assets/js/controllers/wallet.controller.js @@ -94,8 +94,6 @@ function WalletCtrl ($scope, $rootScope, Wallet, $uibModal, $timeout, Alerts, $i ); $scope.$on('$stateChangeStart', (event, toState, toParams, fromState, fromParams) => { - let wallet = MyWallet.wallet; - let featureDisabledWhen = (disabled, reason) => { if (disabled) { Alerts.featureDisabled(reason); diff --git a/assets/js/services/wallet.service.js b/assets/js/services/wallet.service.js index 957cf91374..f6f86d8ea3 100644 --- a/assets/js/services/wallet.service.js +++ b/assets/js/services/wallet.service.js @@ -802,7 +802,7 @@ function Wallet ($http, $window, $timeout, $location, $injector, Alerts, MyWalle case '': case void 0: if (wallet.my.wallet.isUpgradedToHD) { - if (wallet.my.wallet.balanceActiveLegacy == null || wallet.my.wallet.hdwallet.balanceActiveAccounts == null) return null; + if (wallet.my.wallet.balanceSpendableActiveLegacy == null || wallet.my.wallet.hdwallet.balanceActiveAccounts == null) return null; return wallet.my.wallet.hdwallet.balanceActiveAccounts + wallet.my.wallet.balanceSpendableActiveLegacy; } else { return wallet.my.wallet.balanceSpendableActiveLegacy; diff --git a/tests/services/wallet_service_spec.js b/tests/services/wallet_service_spec.js index 31c9017db4..10d3c90a45 100644 --- a/tests/services/wallet_service_spec.js +++ b/tests/services/wallet_service_spec.js @@ -295,7 +295,7 @@ describe('walletServices', () => { it('should return the sum of all accounts and addresses', inject(function (Wallet) { Wallet.my.wallet.hdwallet.balanceActiveAccounts = 3; - Wallet.my.wallet.balanceActiveLegacy = 1; + Wallet.my.wallet.balanceSpendableActiveLegacy = 1; expect(Wallet.total("")).toBeGreaterThan(0); expect(Wallet.total("")).toBe(4);