Fix bwcError service

This commit is contained in:
Gustavo Maximiliano Cortez 2016-07-13 14:00:21 -03:00
commit c8058fefa4
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF

View file

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('buyAmazonController',
function($rootScope, $scope, $ionicModal, $log, $timeout, lodash, profileService, bwsError, configService, walletService, fingerprintService, amazonService, ongoingProcess) {
function($rootScope, $scope, $ionicModal, $log, $timeout, lodash, profileService, bwcError, configService, walletService, fingerprintService, amazonService, ongoingProcess) {
var self = this;
var client;
@ -76,7 +76,7 @@ angular.module('copayApp.controllers').controller('buyAmazonController',
amazonService.createBitPayInvoice(dataSrc, function(err, data) {
if (err) {
ongoingProcess.set('Processing Transaction...', false);
self.error = bwsError.msg(err);
self.error = bwcError.msg(err);
$timeout(function() {
$scope.$digest();
});
@ -108,7 +108,7 @@ angular.module('copayApp.controllers').controller('buyAmazonController',
walletService.createTx(client, txp, function(err, createdTxp) {
ongoingProcess.set('Processing Transaction...', false);
if (err) {
self.error = bwsError.msg(err);
self.error = bwcError.msg(err);
$timeout(function() {
$scope.$digest();
});
@ -119,7 +119,7 @@ angular.module('copayApp.controllers').controller('buyAmazonController',
self.confirmTx(createdTxp, function(err, tx) {
if (err) {
ongoingProcess.set('Processing Transaction...', false);
self.error = bwsError.msg(err);
self.error = bwcError.msg(err);
$timeout(function() {
$scope.$digest();
});
@ -135,7 +135,7 @@ angular.module('copayApp.controllers').controller('buyAmazonController',
amazonService.createGiftCard(gift, function(err, giftCard) {
ongoingProcess.set('Processing Transaction...', false);
if (err) {
self.error = bwsError.msg(err);
self.error = bwcError.msg(err);
self.errorInfo = gift;
$timeout(function() {
$scope.$digest();
@ -167,14 +167,14 @@ angular.module('copayApp.controllers').controller('buyAmazonController',
handleEncryptedWallet(client, function(err) {
if (err) {
$log.debug(err);
return bwsError.cb(err, null, cb);
return bwcError.cb(err, null, cb);
}
ongoingProcess.set('Processing Transaction...', true);
walletService.publishTx(client, txp, function(err, publishedTxp) {
if (err) {
$log.debug(err);
return bwsError.cb(err, null, cb);
return bwcError.cb(err, null, cb);
}
walletService.signTx(client, publishedTxp, function(err, signedTxp) {
@ -184,7 +184,7 @@ angular.module('copayApp.controllers').controller('buyAmazonController',
walletService.removeTx(client, signedTxp, function(err) {
if (err) $log.debug(err);
});
return bwsError.cb(err, null, cb);
return bwcError.cb(err, null, cb);
}
walletService.broadcastTx(client, signedTxp, function(err, broadcastedTxp) {
@ -193,7 +193,7 @@ angular.module('copayApp.controllers').controller('buyAmazonController',
walletService.removeTx(client, broadcastedTxp, function(err) {
if (err) $log.debug(err);
});
return bwsError.cb(err, null, cb);
return bwcError.cb(err, null, cb);
}
$timeout(function() {
return cb(null, broadcastedTxp);