Skip to content
This repository has been archived by the owner on Oct 8, 2019. It is now read-only.

Commit

Permalink
fix(Balance): test
Browse files Browse the repository at this point in the history
  • Loading branch information
plondon committed Apr 23, 2018
1 parent 8bcda57 commit be7e630
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions assets/js/controllers/wallet.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion assets/js/services/wallet.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion tests/services/wallet_service_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit be7e630

Please sign in to comment.