lint: reenable tslint radix, fix issues

This commit is contained in:
Jason Dreyzehner 2018-02-16 15:17:06 -05:00
parent e55dfe42d4
commit 7db7f31231
12 changed files with 17 additions and 18 deletions

View File

@ -237,7 +237,7 @@ export class BuyAmazonPage {
let outputs = [];
let toAddress = invoice.bitcoinAddress;
let amountSat = parseInt((invoice.btcDue * 100000000).toFixed(0)); // BTC to Satoshi
let amountSat = parseInt((invoice.btcDue * 100000000).toFixed(0), 10); // BTC to Satoshi
outputs.push({
'toAddress': toAddress,
@ -334,7 +334,7 @@ export class BuyAmazonPage {
// Sometimes API does not return this element;
invoice['buyerPaidBtcMinerFee'] = invoice.buyerPaidBtcMinerFee || 0;
let invoiceFeeSat = parseInt((invoice.buyerPaidBtcMinerFee * 100000000).toFixed());
let invoiceFeeSat = parseInt((invoice.buyerPaidBtcMinerFee * 100000000).toFixed(), 10);
this.message = this.amountUnitStr + " for Amazon.com Gift Card"; // TODO: translate

View File

@ -224,7 +224,7 @@ export class BitPayCardTopUpPage {
let outputs = [];
let toAddress = invoice.bitcoinAddress;
let amountSat = parseInt((invoice.btcDue * 100000000).toFixed(0)); // BTC to Satoshi
let amountSat = parseInt((invoice.btcDue * 100000000).toFixed(0), 10); // BTC to Satoshi
outputs.push({
'toAddress': toAddress,
@ -297,7 +297,7 @@ export class BitPayCardTopUpPage {
amount: maxAmountBtc,
currency: 'BTC'
}).then((inv) => {
let invoiceFeeSat = parseInt((inv.buyerPaidBtcMinerFee * 100000000).toFixed());
let invoiceFeeSat = parseInt((inv.buyerPaidBtcMinerFee * 100000000).toFixed(), 10);
let newAmountSat = maxValues.amount - invoiceFeeSat;
if (newAmountSat <= 0) {

View File

@ -300,7 +300,7 @@ export class SellCoinbasePage {
}
let outputs = [];
let toAddress = data.data.address;
let amountSat = parseInt((this.sellRequestInfo.amount.amount * 100000000).toFixed(0));
let amountSat = parseInt((this.sellRequestInfo.amount.amount * 100000000).toFixed(0), 10);
let comment = 'Sell bitcoin (Coinbase)';
outputs.push({

View File

@ -174,7 +174,7 @@ export class SellGlideraPage {
this.showError(err);
return;
}
let amount = parseInt((this.sellInfo.qty * 100000000).toFixed(0));
let amount = parseInt((this.sellInfo.qty * 100000000).toFixed(0), 10);
let comment = 'Glidera transaction';
outputs.push({

View File

@ -232,7 +232,7 @@ export class BuyMercadoLibrePage {
let outputs = [];
let toAddress = invoice.bitcoinAddress;
let amountSat = parseInt((invoice.btcDue * 100000000).toFixed(0)); // BTC to Satoshi
let amountSat = parseInt((invoice.btcDue * 100000000).toFixed(0), 10); // BTC to Satoshi
outputs.push({
'toAddress': toAddress,
@ -324,7 +324,7 @@ export class BuyMercadoLibrePage {
// Sometimes API does not return this element;
invoice['buyerPaidBtcMinerFee'] = invoice.buyerPaidBtcMinerFee || 0;
let invoiceFeeSat = parseInt((invoice.buyerPaidBtcMinerFee * 100000000).toFixed());
let invoiceFeeSat = parseInt((invoice.buyerPaidBtcMinerFee * 100000000).toFixed(), 10);
this.message = this.amountUnitStr + " for Mercado Livre Brazil Gift Card"; // TODO: translate

View File

@ -119,14 +119,14 @@ export class ChooseFeeLevelPage {
let value: any = _.find(this.feeLevels.levels[this.network], (feeLevel: any) => {
return feeLevel.level == 'superEconomy';
});
return parseInt((value.feePerKb / 1000).toFixed());
return parseInt((value.feePerKb / 1000).toFixed(), 10);
}
private getMaxRecommended(): number {
let value: any = _.find(this.feeLevels.levels[this.network], (feeLevel: any) => {
return feeLevel.level == 'urgent';
});
return parseInt((value.feePerKb / 1000).toFixed());
return parseInt((value.feePerKb / 1000).toFixed(), 10);
}
public checkFees(feePerSatByte: string): void {

View File

@ -108,7 +108,7 @@ export class ConfirmPage {
this.tx = {
toAddress: this.navParams.data.toAddress,
amount: parseInt(this.navParams.data.amount),
amount: parseInt(this.navParams.data.amount, 10),
sendMax: this.navParams.data.useSendMax ? true : false,
description: this.navParams.data.description,
paypro: this.navParams.data.paypro,
@ -661,7 +661,7 @@ export class ConfirmPage {
this.tx.feeLevel = data.newFeeLevel;
this.tx.feeLevelName = this.feeProvider.feeOpts[this.tx.feeLevel];
if (this.usingCustomFee) this.tx.feeRate = parseInt(data.customFeePerKB);
if (this.usingCustomFee) this.tx.feeRate = parseInt(data.customFeePerKB, 10);
this.updateTx(this.tx, this.wallet, { clearCache: true, dryRun: true }).catch((err: any) => {
this.logger.warn(err);

View File

@ -56,7 +56,7 @@ export class WalletColorPage {
private getColorCount() {
let count = window.getComputedStyle(document.getElementsByClassName('wallet-color-count')[0]).content;
return parseInt(count.replace(/[^0-9]/g, ''));
return parseInt(count.replace(/[^0-9]/g, ''), 10);
};
private getColorDefault(): string {

View File

@ -219,7 +219,7 @@ export class CoinbaseProvider {
this.feeProvider.getFeeRate('btc', 'livenet', 'normal').then((feePerKb) => {
var feeBTC = (feePerKb * txNormalFeeKB / 100000000).toFixed(8);
return cb(null, amount - parseInt(feeBTC), parseInt(feeBTC));
return cb(null, amount - parseInt(feeBTC, 10), parseInt(feeBTC, 10));
}).catch((err) => {
return cb('Could not get fee rate');
});

View File

@ -220,7 +220,7 @@ export class TxFormatProvider {
amount = (amountSat * satToBtc).toFixed(8);
currency = (coin).toUpperCase();
} else {
amountSat = parseInt((amount * unitToSatoshi).toFixed(0));
amountSat = parseInt((amount * unitToSatoshi).toFixed(0), 10);
amountUnitStr = this.formatAmountStr(coin, amountSat);
// convert unit to BTC or BCH
amount = (amountSat * satToBtc).toFixed(8);

View File

@ -702,7 +702,7 @@ export class WalletProvider {
});
let lowLevelRate: string = (normalLevelRate.feePerKb / 1000).toFixed(0);
let size = this.getEstimatedTxSize(wallet, nbOutputs);
return resolve(size * parseInt(lowLevelRate));
return resolve(size * parseInt(lowLevelRate, 10));
}).catch((err) => {
return reject(err);
});
@ -731,7 +731,7 @@ export class WalletProvider {
let nbInputs = 1; //Assume 1 input
let size = overhead + inputSize * nbInputs + outputSize * nbOutputs;
return parseInt((size * (1 + safetyMargin)).toFixed(0));
return parseInt((size * (1 + safetyMargin)).toFixed(0), 10);
}
public getTxNote(wallet: any, txid: string): Promise<any> {

View File

@ -21,7 +21,6 @@
"no-implicit-dependencies": false,
"jsdoc-format": false,
"object-literal-sort-keys": false,
"radix": false,
"interface-name": false,
"prefer-conditional-expression": false,
"prefer-for-of": false,