• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

blockchain / My-Wallet-V3-Frontend / 11592

pending completion
11592

Pull #1461

travis-ci

web-flow
Merge branch 'master' into v1.33-release
Pull Request #1461: v1.33 release

1579 of 3384 branches covered (46.66%)

95 of 95 new or added lines in 17 files covered. (100.0%)

5299 of 8007 relevant lines covered (66.18%)

76.12 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

5.71
/assets/js/controllers/ethMewSweepController.controller.js
1
angular
1✔
2
  .module('walletApp')
3
  .controller('EthMewSweepController', EthMewSweepController);
4

5
function EthMewSweepController ($q, $scope, Alerts, Ethereum, AngularHelper, Upload, Wallet) {
1✔
6
  let reader = new FileReader();
×
7
  AngularHelper.installLock.call($scope);
×
8
  $scope.form = {};
×
9

10
  $scope.$watch('file', (newVal) => {
×
11
    reader.onloadend = (evt) => {
×
12
      if (evt.target.readyState === 2) {
×
13
        $scope.keystore = evt.target.result;
×
14
        try {
×
15
          JSON.parse($scope.keystore);
×
16
          $scope.fileError = null;
×
17
        } catch (e) {
18
          $scope.fileError = e;
×
19
        }
20
      }
21
    };
22

23
    newVal && reader.readAsText(newVal);
×
24
  });
25

26
  $scope.submit = () => {
×
27
    $scope.lock();
×
28
    try {
×
29
      $scope.account = Ethereum.eth.fromMew($scope.keystore, $scope.password, true);
×
30
      return $q.all([$scope.account.fetchBalance(), Ethereum.fetchFees()]).then(([balance, fees]) => {
×
31
        $scope.payment = $scope.account.createPayment();
×
32
        $scope.payment.setGasPrice(fees.regular);
×
33
        $scope.payment.setGasLimit(fees.gasLimit);
×
34
        $scope.payment.setSweep();
×
35
        $scope.payment.setTo(Ethereum.defaultAccount.address);
×
36
        let privateKey = $scope.account.privateKey;
×
37
        $scope.payment.sign(privateKey);
×
38
        return $scope.payment.publish().then(() => {
×
39
          $scope.$dismiss();
×
40
          Wallet.api.incrementEventStat('mew_sweep_success');
×
41
          Alerts.displaySentBitcoin('ETHER_SEND_SUCCESS_MEW');
×
42
        }).catch((e) => {
43
          $scope.free();
×
44
          if (e.message.toLowerCase().indexOf('insufficient funds') > -1) Alerts.displayError('MEW.fund_error');
×
45
          else Alerts.displayError(e.message);
×
46
        });
47
      });
48
    } catch (err) {
49
      $scope.free();
×
50
      Alerts.displayError(err.message);
×
51
    }
52
  };
53
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc