Skip to content

Commit 51e1838

Browse files
committed
lint - no-unused-vars, empty blocks (catch (e) {} pattern), var -> let
1 parent c8f6929 commit 51e1838

File tree

1 file changed

+19
-18
lines changed
  • packages/bitcore-wallet-client/src/lib

1 file changed

+19
-18
lines changed

packages/bitcore-wallet-client/src/lib/api.ts

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ export class API extends EventEmitter {
728728
coin,
729729
network
730730
};
731-
} catch (ex) {
731+
} catch {
732732
throw new Error('Invalid secret');
733733
}
734734
}
@@ -774,7 +774,7 @@ export class API extends EventEmitter {
774774
};
775775
t.inputs[i].addSignature(t, s, txp.signingMethod);
776776
i++;
777-
} catch (e) { }
777+
} catch {/** no op */}
778778
}
779779

780780
if (i != txp.inputs.length) throw new Error('Wrong signatures');
@@ -1203,7 +1203,7 @@ export class API extends EventEmitter {
12031203
log.info('Wallet is already created');
12041204
if (cb) { cb(); }
12051205
return;
1206-
} catch {}
1206+
} catch {/** no op */}
12071207

12081208
const c = this.credentials;
12091209
const walletPrivKey = Bitcore.PrivateKey.fromString(c.walletPrivKey);
@@ -1308,7 +1308,7 @@ export class API extends EventEmitter {
13081308
let customData;
13091309
try {
13101310
customData = JSON.parse(Utils.decryptMessage(me.customData, this.credentials.personalEncryptingKey));
1311-
} catch (e) {
1311+
} catch {
13121312
log.warn('Could not decrypt customData:', me.customData);
13131313
}
13141314
if (customData) {
@@ -2246,15 +2246,15 @@ export class API extends EventEmitter {
22462246
*/
22472247
signTxProposalFromAirGapped(
22482248
/** Transaction proposal to sign */
2249-
txp: Txp,
2249+
_txp: Txp,
22502250
/** An encrypted string with the wallet's public key ring */
2251-
encryptedPkr: string,
2251+
_encryptedPkr: string,
22522252
/** Number of required signatures */
2253-
m: number,
2253+
_m: number,
22542254
/** Number of total signers */
2255-
n: number,
2255+
_n: number,
22562256
/** A password to decrypt the encrypted private key (if encryption is set). */
2257-
password?: PasswordMaybe
2257+
_password?: PasswordMaybe
22582258
) {
22592259
throw new Error('signTxProposalFromAirGapped not yet implemented');
22602260
// return API.signTxProposalFromAirGapped(this.credentials, txp, encryptedPkr, m, n, { password });
@@ -2293,16 +2293,16 @@ export class API extends EventEmitter {
22932293
*/
22942294
static signTxProposalFromAirGapped(
22952295
/** A mnemonic phrase or an xprv HD private key */
2296-
key: string,
2296+
_key: string,
22972297
/** Transaction proposal to sign */
2298-
txp: Txp,
2298+
_txp: Txp,
22992299
/** An unencrypted string with the wallet's public key ring */
2300-
unencryptedPkr: string,
2300+
_unencryptedPkr: string,
23012301
/** Number of required signatures */
2302-
m: number,
2302+
_m: number,
23032303
/** Number of total signers */
2304-
n: number,
2305-
opts?: {
2304+
_n: number,
2305+
_opts?: {
23062306
/** @deprecated Backward compatibility. Use `chain` instead */
23072307
coin?: string;
23082308
/** Chain to use. Default: 'btc' */
@@ -3221,10 +3221,11 @@ export class API extends EventEmitter {
32213221
const SEP2 = '%^#@';
32223222

32233223
let decrypted;
3224+
let passphrase;
32243225
try {
3225-
var passphrase = username + SEP1 + password;
3226+
passphrase = username + SEP1 + password;
32263227
decrypted = Encryption.decryptWithPassword(blob, passphrase);
3227-
} catch (e) {
3228+
} catch {
32283229
passphrase = username + SEP2 + password;
32293230
try {
32303231
decrypted = Encryption.decryptWithPassword(blob, passphrase);
@@ -3238,7 +3239,7 @@ export class API extends EventEmitter {
32383239
let ret;
32393240
try {
32403241
ret = JSON.parse(decrypted);
3241-
} catch (e) { }
3242+
} catch {/** no op */}
32423243
return ret;
32433244
}
32443245

0 commit comments

Comments
 (0)