This commit is contained in:
Matias Alejo Garcia 2014-11-03 17:28:36 -03:00
commit 7a610c1b5b
4 changed files with 5 additions and 5 deletions

View file

@ -378,7 +378,6 @@ angular.module('copayApp.controllers').controller('SendController',
$scope.getAvailableAmount = function() { $scope.getAvailableAmount = function() {
if (!$rootScope.safeUnspentCount) return null; if (!$rootScope.safeUnspentCount) return null;
// Each signature takes
var estimatedFee = copay.Wallet.estimatedFee($rootScope.safeUnspentCount); var estimatedFee = copay.Wallet.estimatedFee($rootScope.safeUnspentCount);
var amount = ((($rootScope.availableBalance * w.settings.unitToSatoshi).toFixed(0) - estimatedFee) / w.settings.unitToSatoshi); var amount = ((($rootScope.availableBalance * w.settings.unitToSatoshi).toFixed(0) - estimatedFee) / w.settings.unitToSatoshi);

View file

@ -2335,9 +2335,8 @@ Wallet.prototype.createTx = function(toAddress, amountSatStr, comment, opts, cb)
var ntxid; var ntxid;
try { try {
ntxid = self.createTxSync(toAddress, amountSatStr, comment, safeUnspent, opts); ntxid = self.createTxSync(toAddress, amountSatStr, comment, safeUnspent, opts);
log.debub('TX Created: ntxid', ntxid); //TODO log.debug('TX Created: ntxid', ntxid); //TODO
} catch (e) { } catch (e) {
console.log('[Wallet.js.2340]', e); //TODO
return cb(e); return cb(e);
} }

View file

@ -42,6 +42,7 @@ describe("Unit: Controllers", function() {
beforeEach(inject(function($controller, $rootScope) { beforeEach(inject(function($controller, $rootScope) {
scope = $rootScope.$new(); scope = $rootScope.$new();
$rootScope.iden = sinon.stub(); $rootScope.iden = sinon.stub();
$rootScope.safeUnspentCount = 1;
var w = {}; var w = {};
w.isReady = sinon.stub().returns(true); w.isReady = sinon.stub().returns(true);
@ -467,6 +468,7 @@ describe("Unit: Controllers", function() {
expect(form.amount.$pristine).to.equal(false); expect(form.amount.$pristine).to.equal(false);
}); });
it('should return available amount', function() { it('should return available amount', function() {
form.amount.$setViewValue(123356);
var amount = scope.getAvailableAmount(); var amount = scope.getAvailableAmount();
expect(amount).to.equal(123356); expect(amount).to.equal(123356);
}); });

View file

@ -11,9 +11,9 @@
<div class="row collapse m0"> <div class="row collapse m0">
<div class="large-6 columns"> <div class="large-6 columns">
<form name="sendForm" ng-submit="submitForm(sendForm)" novalidate> <form name="sendForm" ng-submit="submitForm(sendForm)" novalidate>
<p class="text-warning size-12" <p class="text-warning size-16"
ng-show="error"> ng-show="error">
<i class="fi-x"></i> <i class="fi-alert"></i>
{{error|translate}} {{error|translate}}
</p> </p>