diff options
author | Fabio Berger <me@fabioberger.com> | 2018-06-12 05:42:30 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-06-12 05:42:30 +0800 |
commit | e1879ef4d91fc58203d9748eca38695b79c43674 (patch) | |
tree | 0a9a68927d5dc769b0c5cb2c5d9445849fb56e7c /packages/subproviders | |
parent | b6df727efb74084a849330273a44cfc5ae3a85af (diff) | |
download | dexon-sol-tools-e1879ef4d91fc58203d9748eca38695b79c43674.tar dexon-sol-tools-e1879ef4d91fc58203d9748eca38695b79c43674.tar.gz dexon-sol-tools-e1879ef4d91fc58203d9748eca38695b79c43674.tar.bz2 dexon-sol-tools-e1879ef4d91fc58203d9748eca38695b79c43674.tar.lz dexon-sol-tools-e1879ef4d91fc58203d9748eca38695b79c43674.tar.xz dexon-sol-tools-e1879ef4d91fc58203d9748eca38695b79c43674.tar.zst dexon-sol-tools-e1879ef4d91fc58203d9748eca38695b79c43674.zip |
Fix no-unused-variable tslint rule to include parameters and fix issues
Diffstat (limited to 'packages/subproviders')
6 files changed, 21 insertions, 21 deletions
diff --git a/packages/subproviders/src/subproviders/ganache.ts b/packages/subproviders/src/subproviders/ganache.ts index 73d0513cc..61b6bb5e9 100644 --- a/packages/subproviders/src/subproviders/ganache.ts +++ b/packages/subproviders/src/subproviders/ganache.ts @@ -28,7 +28,7 @@ export class GanacheSubprovider extends Subprovider { * @param end Callback to call if subprovider handled the request and wants to pass back the request. */ // tslint:disable-next-line:prefer-function-over-method async-suffix - public async handleRequest(payload: JSONRPCRequestPayload, next: Callback, end: ErrorCallback): Promise<void> { + public async handleRequest(payload: JSONRPCRequestPayload, _next: Callback, end: ErrorCallback): Promise<void> { this._ganacheProvider.sendAsync(payload, (err: Error | null, result: any) => { end(err, result && result.result); }); diff --git a/packages/subproviders/src/subproviders/nonce_tracker.ts b/packages/subproviders/src/subproviders/nonce_tracker.ts index 98773e79c..dcc421574 100644 --- a/packages/subproviders/src/subproviders/nonce_tracker.ts +++ b/packages/subproviders/src/subproviders/nonce_tracker.ts @@ -75,7 +75,7 @@ export class NonceTrackerSubprovider extends Subprovider { return next(); } case 'eth_sendRawTransaction': - return next((sendTransactionError: Error | null, txResult: any, cb: Callback) => { + return next((sendTransactionError: Error | null, _txResult: any, cb: Callback) => { if (_.isNull(sendTransactionError)) { this._handleSuccessfulTransaction(payload); } else { diff --git a/packages/subproviders/test/unit/ledger_subprovider_test.ts b/packages/subproviders/test/unit/ledger_subprovider_test.ts index d3efb6abc..bd1dad1f9 100644 --- a/packages/subproviders/test/unit/ledger_subprovider_test.ts +++ b/packages/subproviders/test/unit/ledger_subprovider_test.ts @@ -48,7 +48,7 @@ describe('LedgerSubprovider', () => { }; return ecSignature; }, - signTransaction: async (derivationPath: string, txHex: string) => { + signTransaction: async (_derivationPath: string, _txHex: string) => { const ecSignature = { v: '77', r: '88a95ef1378487bc82be558e82c8478baf840c545d5b887536bb1da63673a98b', @@ -193,7 +193,7 @@ describe('LedgerSubprovider', () => { params: [FAKE_ADDRESS, nonHexMessage], id: 1, }; - const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { + const callback = reportCallbackErrors(done)((err: Error, _response: JSONRPCResponsePayload) => { expect(err).to.not.be.a('null'); expect(err.message).to.be.equal('Expected data to be of type HexString, encountered: hello world'); done(); @@ -208,7 +208,7 @@ describe('LedgerSubprovider', () => { params: [nonHexMessage, FAKE_ADDRESS], id: 1, }; - const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { + const callback = reportCallbackErrors(done)((err: Error, _response: JSONRPCResponsePayload) => { expect(err).to.not.be.a('null'); expect(err.message).to.be.equal('Expected data to be of type HexString, encountered: hello world'); done(); @@ -226,7 +226,7 @@ describe('LedgerSubprovider', () => { params: [tx], id: 1, }; - const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { + const callback = reportCallbackErrors(done)((err: Error, _response: JSONRPCResponsePayload) => { expect(err).to.not.be.a('null'); expect(err.message).to.be.equal(WalletSubproviderErrors.SenderInvalidOrNotSupplied); done(); @@ -245,7 +245,7 @@ describe('LedgerSubprovider', () => { params: [tx], id: 1, }; - const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { + const callback = reportCallbackErrors(done)((err: Error, _response: JSONRPCResponsePayload) => { expect(err).to.not.be.a('null'); expect(err.message).to.be.equal(WalletSubproviderErrors.SenderInvalidOrNotSupplied); done(); diff --git a/packages/subproviders/test/unit/mnemonic_wallet_subprovider_test.ts b/packages/subproviders/test/unit/mnemonic_wallet_subprovider_test.ts index 794c40d1d..331e52ea1 100644 --- a/packages/subproviders/test/unit/mnemonic_wallet_subprovider_test.ts +++ b/packages/subproviders/test/unit/mnemonic_wallet_subprovider_test.ts @@ -130,7 +130,7 @@ describe('MnemonicWalletSubprovider', () => { params: [fixtureData.TEST_RPC_ACCOUNT_0, nonHexMessage], id: 1, }; - const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { + const callback = reportCallbackErrors(done)((err: Error, _response: JSONRPCResponsePayload) => { expect(err).to.not.be.a('null'); expect(err.message).to.be.equal('Expected data to be of type HexString, encountered: hello world'); done(); @@ -145,7 +145,7 @@ describe('MnemonicWalletSubprovider', () => { params: [nonHexMessage, fixtureData.TEST_RPC_ACCOUNT_0], id: 1, }; - const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { + const callback = reportCallbackErrors(done)((err: Error, _response: JSONRPCResponsePayload) => { expect(err).to.not.be.a('null'); expect(err.message).to.be.equal('Expected data to be of type HexString, encountered: hello world'); done(); @@ -160,7 +160,7 @@ describe('MnemonicWalletSubprovider', () => { params: [messageHex, fixtureData.NULL_ADDRESS], id: 1, }; - const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { + const callback = reportCallbackErrors(done)((err: Error, _response: JSONRPCResponsePayload) => { expect(err).to.not.be.a('null'); expect(err.message).to.be.equal( `${WalletSubproviderErrors.AddressNotFound}: ${fixtureData.NULL_ADDRESS}`, @@ -180,7 +180,7 @@ describe('MnemonicWalletSubprovider', () => { params: [tx], id: 1, }; - const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { + const callback = reportCallbackErrors(done)((err: Error, _response: JSONRPCResponsePayload) => { expect(err).to.not.be.a('null'); expect(err.message).to.be.equal(WalletSubproviderErrors.SenderInvalidOrNotSupplied); done(); @@ -199,7 +199,7 @@ describe('MnemonicWalletSubprovider', () => { params: [tx], id: 1, }; - const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { + const callback = reportCallbackErrors(done)((err: Error, _response: JSONRPCResponsePayload) => { expect(err).to.not.be.a('null'); expect(err.message).to.be.equal(WalletSubproviderErrors.SenderInvalidOrNotSupplied); done(); diff --git a/packages/subproviders/test/unit/nonce_tracker_subprovider_test.ts b/packages/subproviders/test/unit/nonce_tracker_subprovider_test.ts index 2475dde7a..d799bce9e 100644 --- a/packages/subproviders/test/unit/nonce_tracker_subprovider_test.ts +++ b/packages/subproviders/test/unit/nonce_tracker_subprovider_test.ts @@ -41,7 +41,7 @@ describe('NonceTrackerSubprovider', () => { let isFirstGetTransactionCount = true; const fixedBlockNumberAndTransactionCountProvider = new FixtureSubprovider({ eth_getBlockByNumber: '0x01', - eth_getTransactionCount: (data: any, next: any, end: any) => { + eth_getTransactionCount: (_data: any, _next: any, end: any) => { // For testing caching we return different results on the second call if (isFirstGetTransactionCount) { isFirstGetTransactionCount = false; @@ -88,7 +88,7 @@ describe('NonceTrackerSubprovider', () => { provider.addProvider(createFixtureSubprovider()); provider.addProvider( new FixtureSubprovider({ - eth_sendRawTransaction: (data: any, next: any, end: any) => { + eth_sendRawTransaction: (_data: any, _next: any, end: any) => { end(new Error('Transaction nonce is too low')); }, }), @@ -123,7 +123,7 @@ describe('NonceTrackerSubprovider', () => { provider.addProvider(createFixtureSubprovider()); provider.addProvider( new FixtureSubprovider({ - eth_sendRawTransaction: (data: any, next: any, end: any) => { + eth_sendRawTransaction: (_data: any, _next: any, end: any) => { end(null); }, }), diff --git a/packages/subproviders/test/unit/private_key_wallet_subprovider_test.ts b/packages/subproviders/test/unit/private_key_wallet_subprovider_test.ts index ef7919801..34295c25e 100644 --- a/packages/subproviders/test/unit/private_key_wallet_subprovider_test.ts +++ b/packages/subproviders/test/unit/private_key_wallet_subprovider_test.ts @@ -101,7 +101,7 @@ describe('PrivateKeyWalletSubprovider', () => { params: [fixtureData.TEST_RPC_ACCOUNT_0, nonHexMessage], id: 1, }; - const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { + const callback = reportCallbackErrors(done)((err: Error, _response: JSONRPCResponsePayload) => { expect(err).to.not.be.a('null'); expect(err.message).to.be.equal('Expected data to be of type HexString, encountered: hello world'); done(); @@ -116,7 +116,7 @@ describe('PrivateKeyWalletSubprovider', () => { params: [nonHexMessage, fixtureData.TEST_RPC_ACCOUNT_0], id: 1, }; - const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { + const callback = reportCallbackErrors(done)((err: Error, _response: JSONRPCResponsePayload) => { expect(err).to.not.be.a('null'); expect(err.message).to.be.equal('Expected data to be of type HexString, encountered: hello world'); done(); @@ -131,7 +131,7 @@ describe('PrivateKeyWalletSubprovider', () => { params: [messageHex, fixtureData.TEST_RPC_ACCOUNT_1], id: 1, }; - const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { + const callback = reportCallbackErrors(done)((err: Error, _response: JSONRPCResponsePayload) => { expect(err).to.not.be.a('null'); expect(err.message).to.be.equal( `Requested to sign message with address: ${ @@ -153,7 +153,7 @@ describe('PrivateKeyWalletSubprovider', () => { params: [tx], id: 1, }; - const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { + const callback = reportCallbackErrors(done)((err: Error, _response: JSONRPCResponsePayload) => { expect(err).to.not.be.a('null'); expect(err.message).to.be.equal(WalletSubproviderErrors.SenderInvalidOrNotSupplied); done(); @@ -172,7 +172,7 @@ describe('PrivateKeyWalletSubprovider', () => { params: [tx], id: 1, }; - const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { + const callback = reportCallbackErrors(done)((err: Error, _response: JSONRPCResponsePayload) => { expect(err).to.not.be.a('null'); expect(err.message).to.be.equal(WalletSubproviderErrors.SenderInvalidOrNotSupplied); done(); @@ -187,7 +187,7 @@ describe('PrivateKeyWalletSubprovider', () => { params: [messageHex, '0x0'], id: 1, }; - const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { + const callback = reportCallbackErrors(done)((err: Error, _response: JSONRPCResponsePayload) => { expect(err).to.not.be.a('null'); expect(err.message).to.be.equal(`Expected address to be of type ETHAddressHex, encountered: 0x0`); done(); |