aboutsummaryrefslogtreecommitdiffstats
path: root/packages/subproviders/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/subproviders/src')
-rw-r--r--packages/subproviders/src/subproviders/eth_lightwallet_subprovider.ts4
-rw-r--r--packages/subproviders/src/subproviders/fake_gas_estimate_subprovider.ts2
-rw-r--r--packages/subproviders/src/subproviders/ganache.ts2
-rw-r--r--packages/subproviders/src/subproviders/ledger.ts12
-rw-r--r--packages/subproviders/src/subproviders/mnemonic_wallet.ts4
-rw-r--r--packages/subproviders/src/subproviders/nonce_tracker.ts2
-rw-r--r--packages/subproviders/src/subproviders/private_key_wallet.ts4
-rw-r--r--packages/subproviders/src/subproviders/redundant_subprovider.ts2
-rw-r--r--packages/subproviders/src/subproviders/rpc_subprovider.ts4
-rw-r--r--packages/subproviders/src/subproviders/signer.ts2
-rw-r--r--packages/subproviders/src/utils/wallet_utils.ts4
11 files changed, 21 insertions, 21 deletions
diff --git a/packages/subproviders/src/subproviders/eth_lightwallet_subprovider.ts b/packages/subproviders/src/subproviders/eth_lightwallet_subprovider.ts
index a9ebbb790..454dae58e 100644
--- a/packages/subproviders/src/subproviders/eth_lightwallet_subprovider.ts
+++ b/packages/subproviders/src/subproviders/eth_lightwallet_subprovider.ts
@@ -12,8 +12,8 @@ import { PrivateKeyWalletSubprovider } from './private_key_wallet';
* Source: https://github.com/MetaMask/provider-engine/blob/master/subproviders/subprovider.js
*/
export class EthLightwalletSubprovider extends BaseWalletSubprovider {
- private _keystore: lightwallet.keystore;
- private _pwDerivedKey: Uint8Array;
+ private readonly _keystore: lightwallet.keystore;
+ private readonly _pwDerivedKey: Uint8Array;
constructor(keystore: lightwallet.keystore, pwDerivedKey: Uint8Array) {
super();
this._keystore = keystore;
diff --git a/packages/subproviders/src/subproviders/fake_gas_estimate_subprovider.ts b/packages/subproviders/src/subproviders/fake_gas_estimate_subprovider.ts
index d750505e7..bc1b34aba 100644
--- a/packages/subproviders/src/subproviders/fake_gas_estimate_subprovider.ts
+++ b/packages/subproviders/src/subproviders/fake_gas_estimate_subprovider.ts
@@ -14,7 +14,7 @@ import { Subprovider } from './subprovider';
* It intercepts the `eth_estimateGas` JSON RPC call and always returns a constant gas amount when queried.
*/
export class FakeGasEstimateSubprovider extends Subprovider {
- private _constantGasAmount: number;
+ private readonly _constantGasAmount: number;
/**
* Instantiates an instance of the FakeGasEstimateSubprovider
* @param constantGasAmount The constant gas amount you want returned
diff --git a/packages/subproviders/src/subproviders/ganache.ts b/packages/subproviders/src/subproviders/ganache.ts
index 79c43bc68..986094dba 100644
--- a/packages/subproviders/src/subproviders/ganache.ts
+++ b/packages/subproviders/src/subproviders/ganache.ts
@@ -10,7 +10,7 @@ import { Subprovider } from './subprovider';
* It intercepts all JSON RPC requests and relays them to an in-process ganache instance.
*/
export class GanacheSubprovider extends Subprovider {
- private _ganacheProvider: Provider;
+ private readonly _ganacheProvider: Provider;
/**
* Instantiates a GanacheSubprovider
* @param opts The desired opts with which to instantiate the Ganache provider
diff --git a/packages/subproviders/src/subproviders/ledger.ts b/packages/subproviders/src/subproviders/ledger.ts
index 8345be33c..6ad5de2e2 100644
--- a/packages/subproviders/src/subproviders/ledger.ts
+++ b/packages/subproviders/src/subproviders/ledger.ts
@@ -32,14 +32,14 @@ const DEFAULT_ADDRESS_SEARCH_LIMIT = 1000;
*/
export class LedgerSubprovider extends BaseWalletSubprovider {
// tslint:disable-next-line:no-unused-variable
- private _nonceLock = new Lock();
- private _connectionLock = new Lock();
- private _networkId: number;
+ private readonly _nonceLock = new Lock();
+ private readonly _connectionLock = new Lock();
+ private readonly _networkId: number;
private _baseDerivationPath: string;
- private _ledgerEthereumClientFactoryAsync: LedgerEthereumClientFactoryAsync;
+ private readonly _ledgerEthereumClientFactoryAsync: LedgerEthereumClientFactoryAsync;
private _ledgerClientIfExists?: LedgerEthereumClient;
- private _shouldAlwaysAskForConfirmation: boolean;
- private _addressSearchLimit: number;
+ private readonly _shouldAlwaysAskForConfirmation: boolean;
+ private readonly _addressSearchLimit: number;
/**
* Instantiates a LedgerSubprovider. Defaults to derivationPath set to `44'/60'/0'`.
* TestRPC/Ganache defaults to `m/44'/60'/0'/0`, so set this in the configs if desired.
diff --git a/packages/subproviders/src/subproviders/mnemonic_wallet.ts b/packages/subproviders/src/subproviders/mnemonic_wallet.ts
index 596300425..1495112b6 100644
--- a/packages/subproviders/src/subproviders/mnemonic_wallet.ts
+++ b/packages/subproviders/src/subproviders/mnemonic_wallet.ts
@@ -20,10 +20,10 @@ const DEFAULT_ADDRESS_SEARCH_LIMIT = 1000;
* all requests with accounts derived from the supplied mnemonic.
*/
export class MnemonicWalletSubprovider extends BaseWalletSubprovider {
- private _addressSearchLimit: number;
+ private readonly _addressSearchLimit: number;
private _baseDerivationPath: string;
private _derivedKeyInfo: DerivedHDKeyInfo;
- private _mnemonic: string;
+ private readonly _mnemonic: string;
/**
* Instantiates a MnemonicWalletSubprovider. Defaults to baseDerivationPath set to `44'/60'/0'/0`.
diff --git a/packages/subproviders/src/subproviders/nonce_tracker.ts b/packages/subproviders/src/subproviders/nonce_tracker.ts
index dcc421574..eea722aee 100644
--- a/packages/subproviders/src/subproviders/nonce_tracker.ts
+++ b/packages/subproviders/src/subproviders/nonce_tracker.ts
@@ -17,7 +17,7 @@ const NONCE_TOO_LOW_ERROR_MESSAGE = 'Transaction nonce is too low';
* We added the additional feature of clearing the cached nonce value when a `nonce value too low` error occurs.
*/
export class NonceTrackerSubprovider extends Subprovider {
- private _nonceCache: { [address: string]: string } = {};
+ private readonly _nonceCache: { [address: string]: string } = {};
private static _reconstructTransaction(payload: JSONRPCRequestPayload): EthereumTx {
const raw = payload.params[0];
if (_.isUndefined(raw)) {
diff --git a/packages/subproviders/src/subproviders/private_key_wallet.ts b/packages/subproviders/src/subproviders/private_key_wallet.ts
index b3f48fd90..9d6fc487e 100644
--- a/packages/subproviders/src/subproviders/private_key_wallet.ts
+++ b/packages/subproviders/src/subproviders/private_key_wallet.ts
@@ -13,8 +13,8 @@ import { BaseWalletSubprovider } from './base_wallet_subprovider';
* all requests with the supplied Ethereum private key.
*/
export class PrivateKeyWalletSubprovider extends BaseWalletSubprovider {
- private _address: string;
- private _privateKeyBuffer: Buffer;
+ private readonly _address: string;
+ private readonly _privateKeyBuffer: Buffer;
/**
* Instantiates a PrivateKeyWalletSubprovider.
* @param privateKey The corresponding private key to an Ethereum address
diff --git a/packages/subproviders/src/subproviders/redundant_subprovider.ts b/packages/subproviders/src/subproviders/redundant_subprovider.ts
index a60d6706e..7aa6226d5 100644
--- a/packages/subproviders/src/subproviders/redundant_subprovider.ts
+++ b/packages/subproviders/src/subproviders/redundant_subprovider.ts
@@ -12,7 +12,7 @@ import { Subprovider } from './subprovider';
* set of JSON RPC endpoints.
*/
export class RedundantSubprovider extends Subprovider {
- private _subproviders: Subprovider[];
+ private readonly _subproviders: Subprovider[];
private static async _firstSuccessAsync(
subproviders: Subprovider[],
payload: JSONRPCRequestPayload,
diff --git a/packages/subproviders/src/subproviders/rpc_subprovider.ts b/packages/subproviders/src/subproviders/rpc_subprovider.ts
index 3ad0e5325..d874c6f05 100644
--- a/packages/subproviders/src/subproviders/rpc_subprovider.ts
+++ b/packages/subproviders/src/subproviders/rpc_subprovider.ts
@@ -13,8 +13,8 @@ import { Subprovider } from './subprovider';
* It forwards on JSON RPC requests to the supplied `rpcUrl` endpoint
*/
export class RPCSubprovider extends Subprovider {
- private _rpcUrl: string;
- private _requestTimeoutMs: number;
+ private readonly _rpcUrl: string;
+ private readonly _requestTimeoutMs: number;
constructor(rpcUrl: string, requestTimeoutMs: number = 20000) {
super();
assert.isString('rpcUrl', rpcUrl);
diff --git a/packages/subproviders/src/subproviders/signer.ts b/packages/subproviders/src/subproviders/signer.ts
index f7329e00c..d5fd86897 100644
--- a/packages/subproviders/src/subproviders/signer.ts
+++ b/packages/subproviders/src/subproviders/signer.ts
@@ -12,7 +12,7 @@ import { Subprovider } from './subprovider';
* are passed onwards for subsequent subproviders to handle.
*/
export class SignerSubprovider extends Subprovider {
- private _web3Wrapper: Web3Wrapper;
+ private readonly _web3Wrapper: Web3Wrapper;
/**
* Instantiates a new SignerSubprovider
* @param provider Web3 provider that should handle all user account related requests
diff --git a/packages/subproviders/src/utils/wallet_utils.ts b/packages/subproviders/src/utils/wallet_utils.ts
index 3748077ef..4c233645b 100644
--- a/packages/subproviders/src/utils/wallet_utils.ts
+++ b/packages/subproviders/src/utils/wallet_utils.ts
@@ -6,8 +6,8 @@ import { DerivedHDKeyInfo } from '../types';
const DEFAULT_ADDRESS_SEARCH_LIMIT = 1000;
class DerivedHDKeyInfoIterator implements IterableIterator<DerivedHDKeyInfo> {
- private _parentDerivedKeyInfo: DerivedHDKeyInfo;
- private _searchLimit: number;
+ private readonly _parentDerivedKeyInfo: DerivedHDKeyInfo;
+ private readonly _searchLimit: number;
private _index: number;
constructor(initialDerivedKey: DerivedHDKeyInfo, searchLimit: number = DEFAULT_ADDRESS_SEARCH_LIMIT) {