Remove unnused variable. Added tests to check amount validation
This commit is contained in:
parent
cf8670c64f
commit
6586a4b696
2 changed files with 23 additions and 6 deletions
|
|
@ -5,8 +5,6 @@ var preconditions = require('preconditions').singleton();
|
|||
angular.module('copayApp.controllers').controller('SendController',
|
||||
function($scope, $rootScope, $window, $timeout, $modal, $filter, notification, isMobile, rateService, txStatus, isCordova) {
|
||||
|
||||
var satToUnit;
|
||||
|
||||
$scope.init = function() {
|
||||
var w = $rootScope.wallet;
|
||||
preconditions.checkState(w);
|
||||
|
|
@ -23,8 +21,6 @@ angular.module('copayApp.controllers').controller('SendController',
|
|||
$scope.loading = false;
|
||||
$scope.error = $scope.success = null;
|
||||
|
||||
satToUnit = 1 / w.settings.unitToSatoshi;
|
||||
|
||||
$scope.alternativeName = w.settings.alternativeName;
|
||||
$scope.alternativeIsoCode = w.settings.alternativeIsoCode;
|
||||
|
||||
|
|
@ -101,7 +97,7 @@ angular.module('copayApp.controllers').controller('SendController',
|
|||
this.__alternative = newValue;
|
||||
if (typeof(newValue) === 'number' && $scope.isRateAvailable) {
|
||||
this._amount = parseFloat(
|
||||
(rateService.fromFiat(newValue, $scope.alternativeIsoCode) * satToUnit).toFixed(w.settings.unitDecimals), 10);
|
||||
(rateService.fromFiat(newValue, $scope.alternativeIsoCode) * 1 / w.settings.unitToSatoshi).toFixed(w.settings.unitDecimals), 10);
|
||||
} else {
|
||||
this._amount = 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue