<commit_before>angular.module("omniServices")
	.service("WalletAssets",["$rootScope", "userService", "AddressManager", "SATOSHI_UNIT", "MIN_MINER_FEE", "MSC_PROTOCOL_COST",
		function WalletAssetsService($rootScope, userService, AddressManager, SATOSHI_UNIT, MIN_MINER_FEE, MSC_PROTOCOL_COST){
			var self = this;

			self.initialize = function(){

				self.currencyList = userService.getCurrencies().filter(function(currency){
				       return currency.tradable;
				}); // [{symbol: 'BTC', addresses:[], name: 'BTC'}, {symbol: 'MSC', addresses:[], name: 'MSC'}, {symbol: 'TMSC', addresses:[], name: 'TMSC'}]
				  
				  
			    self.selectedCoin = self.currencyList[0];
			    self.currencyList.forEach(function(e, i) {
			      if (e.symbol == "MSC")
			        self.selectedCoin = e;
			    });
					  
				self.addressList = self.selectedCoin ? userService.getAddressesWithPrivkey(self.selectedCoin.tradableAddresses) : [];
					  
				self.selectedAddress = self.addressList[0] || null;

				self.minerFees = +MIN_MINER_FEE.valueOf(); //set default miner fees
				
				

				// [ Retrieve Balances ]
				self.currencyUnit = 'stom'; // satoshi to millibitt
				self.amountUnit = 'mtow';
				self.balanceData = [0];
				var addrListBal = [];
				// fill the addrBalanceList with all the addresses on the wallet for which we've got private keys.
				userService.getAddressesWithPrivkey().forEach(function(e, i) {
				    var balances = [
				      {
				        symbol: 'MSC',
				        value: '0'
				      },
				      {
				        symbol: 'TMSC',
				        value: '0'
				      },
				      {
				        symbol: 'BTC',
				        value: '0'
				      }];
				    addrListBal[i] = {
				      address: e,
				      balance: balances
				    };
				    var promise = AddressManager.getAddressData(e);
				    promise.then(function(successData) {
				      var successData = successData.data;
				      addrListBal[i].balance =  successData.balance;
				      self.setBalance();
				    }, function(errorData) {
				      alert("We have encountered a problem accessing the server ... Please try again in a few minutes");
				      //console.log('Error, no balance data found for ' + e + ' setting defaults...');
				    });<commit_msg>Refactor - Fixed missing dependency and variable scopes for WalletAssetsService<commit_after>angular.module("omniServices")
	.service("WalletAssets",["$rootScope", "$injector", "userService", "AddressManager", "SATOSHI_UNIT", "MIN_MINER_FEE", "MSC_PROTOCOL_COST",
		function WalletAssetsService($rootScope, $injector, userService, AddressManager, SATOSHI_UNIT, MIN_MINER_FEE, MSC_PROTOCOL_COST){
			var self = this;
			var addrListBal = [];

			self.initialize = function(){

				self.currencyList = userService.getCurrencies().filter(function(currency){
				       return currency.tradable;
				}); // [{symbol: 'BTC', addresses:[], name: 'BTC'}, {symbol: 'MSC', addresses:[], name: 'MSC'}, {symbol: 'TMSC', addresses:[], name: 'TMSC'}]
				  
				  
			    self.selectedCoin = self.currencyList[0];
			    self.currencyList.forEach(function(e, i) {
			      if (e.symbol == "MSC")
			        self.selectedCoin = e;
			    });
					  
				self.addressList = self.selectedCoin ? userService.getAddressesWithPrivkey(self.selectedCoin.tradableAddresses) : [];
					  
				self.selectedAddress = self.addressList[0] || null;

				self.minerFees = +MIN_MINER_FEE.valueOf(); //set default miner fees
				
				

				// [ Retrieve Balances ]
				self.currencyUnit = 'stom'; // satoshi to millibitt
				self.amountUnit = 'mtow';
				self.balanceData = [0];
				// fill the addrListBal with all the addresses on the wallet for which we've got private keys.
				userService.getAddressesWithPrivkey().forEach(function(e, i) {
				    var balances = [
				      {
				        symbol: 'MSC',
				        value: '0'
				      },
				      {
				        symbol: 'TMSC',
				        value: '0'
				      },
				      {
				        symbol: 'BTC',
				        value: '0'
				      }];
				    addrListBal[i] = {
				      address: e,
				      balance: balances
				    };
				    var promise = AddressManager.getAddressData(e);
				    promise.then(function(successData) {
				      var successData = successData.data;
				      addrListBal[i].balance =  successData.balance;
				      self.setBalance();
				    }, function(errorData) {
				      alert("We have encountered a problem accessing the server ... Please try again in a few minutes");
				      //console.log('Error, no balance data found for ' + e + ' setting defaults...');
				    });
{'fraction_non_alphanumeric': 0.13256169469316445, 'fraction_numerical': 0.00262065953264905, 'mean_word_length': 2.443609022556391, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3210015', 'n_tokens_mistral': 1740, 'n_tokens_neox': 1340, 'n_words': 298}