<commit_before>'use strict';

angular.module('copay.transactions').controller('TransactionsController',
  function($scope, $rootScope, $location) {
    var bitcore = require('bitcore');

    $scope.title = 'Transactions';
    $scope.loading = false;



    var _updateTxs = function() {
      var w   =$rootScope.wallet;
      if (!w) return;

      var inT = w.getTxProposals();
      var txs  = [];

      inT.forEach(function(i){
        var tx  = i.builder.build();
        var outs = [];

        tx.outs.forEach(function(o) {
          var addr = bitcore.Address.fromScriptPubKey(o.getScript(), config.networkName)[0].toString();
          if (!w.addressIsOwn(addr, {excludeMain:true})) {
            outs.push({
              address: addr, 
              value: bitcore.util.valueToBigInt(o.getValue())/bitcore.util.COIN,
            });
          }
        });
        // extra fields
        i.outs = outs;
        i.fee = i.builder.feeSat/bitcore.util.COIN;
        i.missingSignatures = tx.countInputMissingSignatures(0);
        txs.push(i);
      });
      $scope.txs = txs;
      w.removeListener('txProposalsUpdated',_updateTxs)
      w.once('txProposalsUpdated',_updateTxs);
      $scope.loading = false;
    };

    $scope.send = function (ntxid) {
      $scope.loading = true;
      var w = $rootScope.wallet;
      w.sendTx(ntxid, function(txid) {
          console.log('[transactions.js.68:txid:] SENTTX CALLBACK',txid); //TODO
          $rootScope.flashMessage = txid
            ? {type:'success', message: 'Transactions SENT! txid:' + txid}
            : {type:'error', message: 'There was an error sending the Transaction'}
            ;
          _updateTxs();
          $rootScope.$digest();    
      });
    };

    $scope.sign = function (ntxid) {
      $scope.loading = true;
      var w = $rootScope.wallet;
      var ret = w.sign(ntxid);
<commit_msg>improve language<commit_after>'use strict';

angular.module('copay.transactions').controller('TransactionsController',
  function($scope, $rootScope, $location) {
    var bitcore = require('bitcore');

    $scope.title = 'Transactions';
    $scope.loading = false;



    var _updateTxs = function() {
      var w   =$rootScope.wallet;
      if (!w) return;

      var inT = w.getTxProposals();
      var txs  = [];

      inT.forEach(function(i){
        var tx  = i.builder.build();
        var outs = [];

        tx.outs.forEach(function(o) {
          var addr = bitcore.Address.fromScriptPubKey(o.getScript(), config.networkName)[0].toString();
          if (!w.addressIsOwn(addr, {excludeMain:true})) {
            outs.push({
              address: addr, 
              value: bitcore.util.valueToBigInt(o.getValue())/bitcore.util.COIN,
            });
          }
        });
        // extra fields
        i.outs = outs;
        i.fee = i.builder.feeSat/bitcore.util.COIN;
        i.missingSignatures = tx.countInputMissingSignatures(0);
        txs.push(i);
      });
      $scope.txs = txs;
      w.removeListener('txProposalsUpdated',_updateTxs)
      w.once('txProposalsUpdated',_updateTxs);
      $scope.loading = false;
    };

    $scope.send = function (ntxid) {
      $scope.loading = true;
      var w = $rootScope.wallet;
      w.sendTx(ntxid, function(txid) {
          console.log('[transactions.js.68:txid:] SENTTX CALLBACK',txid); //TODO
          $rootScope.flashMessage = txid
            ? {type:'success', message: 'Transaction broadcasted. txid: ' + txid}
            : {type:'error', message: 'There was an error sending the Transaction'}
            ;
          _updateTxs();
          $rootScope.$digest();    
      });
    };

    $scope.sign = function (ntxid) {
      $scope.loading = true;
      var w = $rootScope.wallet;
      var ret = w.sign(ntxid);

{'fraction_non_alphanumeric': 0.1472457627118644, 'fraction_numerical': 0.00211864406779661, 'mean_word_length': 2.1954314720812182, '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': '337549', 'n_tokens_mistral': 1222, 'n_tokens_neox': 1191, 'n_words': 211}