From a967acf87c399a358d576128ebec10ea72f3c4fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Thu, 17 Nov 2016 17:14:20 -0300 Subject: [PATCH] fix paper wallet scanner --- src/js/controllers/paperWallet.js | 14 +++++++------- www/views/paperWallet.html | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/js/controllers/paperWallet.js b/src/js/controllers/paperWallet.js index b460b125e..21c58b108 100644 --- a/src/js/controllers/paperWallet.js +++ b/src/js/controllers/paperWallet.js @@ -1,7 +1,7 @@ angular.module('copayApp.controllers').controller('paperWalletController', function($scope, $timeout, $log, $ionicModal, $ionicHistory, popupService, gettextCatalog, platformInfo, configService, profileService, $state, bitcore, ongoingProcess, txFormatService, $stateParams, walletService) { - $scope.onQrCodeScanned = function(data) { + $scope.onQrCodeScannedPaperWallet = function(data) { $scope.formData.inputData = data; $scope.onData(data); }; @@ -14,11 +14,11 @@ angular.module('copayApp.controllers').controller('paperWalletController', function _scanFunds(cb) { function getPrivateKey(scannedKey, isPkEncrypted, passphrase, cb) { if (!isPkEncrypted) return cb(null, scannedKey); - wallet.decryptBIP38PrivateKey(scannedKey, passphrase, null, cb); + $scope.wallet.decryptBIP38PrivateKey(scannedKey, passphrase, null, cb); }; function getBalance(privateKey, cb) { - wallet.getBalanceFromPrivateKey(privateKey, cb); + $scope.wallet.getBalanceFromPrivateKey(privateKey, cb); }; function checkPrivateKey(privateKey) { @@ -66,13 +66,13 @@ angular.module('copayApp.controllers').controller('paperWalletController', }; function _sweepWallet(cb) { - walletService.getAddress(wallet, true, function(err, destinationAddress) { + walletService.getAddress($scope.wallet, true, function(err, destinationAddress) { if (err) return cb(err); - wallet.buildTxFromPrivateKey($scope.privateKey, destinationAddress, null, function(err, tx) { + $scope.wallet.buildTxFromPrivateKey($scope.privateKey, destinationAddress, null, function(err, tx) { if (err) return cb(err); - wallet.broadcastRawTx({ + $scope.wallet.broadcastRawTx({ rawTx: tx.serialize(), network: 'livenet' }, function(err, txid) { @@ -109,7 +109,7 @@ angular.module('copayApp.controllers').controller('paperWalletController', $scope.tx = {}; $scope.tx.amountStr = $scope.balance; $scope.type = type; - $scope.color = wallet.backgroundColor; + $scope.color = $scope.wallet.backgroundColor; $scope.cb = cb; $ionicModal.fromTemplateUrl('views/modals/tx-status.html', { diff --git a/www/views/paperWallet.html b/www/views/paperWallet.html index 548bc5308..e5472835e 100644 --- a/www/views/paperWallet.html +++ b/www/views/paperWallet.html @@ -32,7 +32,7 @@
- +